ASSET1D/OAOPS1 完成资产公网试录与巡检降噪
这个提交包含在:
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
CLIENT_DIR="$ROOT_DIR/client"
|
||||
PUBLIC_BASE_URL="${LIVE_SMOKE_BASE_URL:-https://oa.hyinda.com}"
|
||||
REPORT_DIR="${ASSET1D_REPORT_DIR:-$ROOT_DIR/artifacts/qa-flow/asset1d-public-trial-$(date +%Y%m%d-%H%M%S)}"
|
||||
ENV_FILE="${ASSET1D_ENV_FILE:-$HOME/.hyb-oa/live-smoke.env}"
|
||||
|
||||
mkdir -p "$REPORT_DIR"
|
||||
|
||||
if [[ "${ASSET1D_SKIP_ENV_FILE:-0}" != "1" && -f "$ENV_FILE" ]]; then
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "$ENV_FILE"
|
||||
set +a
|
||||
PUBLIC_BASE_URL="${LIVE_SMOKE_BASE_URL:-$PUBLIC_BASE_URL}"
|
||||
echo "[asset1d] loaded masked live smoke env file"
|
||||
fi
|
||||
|
||||
if [[ -z "${LIVE_SMOKE_ADMIN_IDENTIFIER:-}" || -z "${LIVE_SMOKE_ADMIN_PASSWORD:-}" ]]; then
|
||||
echo "[asset1d][ERROR] missing LIVE_SMOKE_ADMIN_IDENTIFIER/PASSWORD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[asset1d] base=$PUBLIC_BASE_URL"
|
||||
echo "[asset1d] report=$REPORT_DIR"
|
||||
|
||||
(
|
||||
cd "$CLIENT_DIR"
|
||||
PLAYWRIGHT_MANUAL=1 \
|
||||
ASSET1D_PUBLIC_TRIAL=1 \
|
||||
ASSET1D_REPORT_DIR="$REPORT_DIR" \
|
||||
E2E_BASE_URL="$PUBLIC_BASE_URL" \
|
||||
npx playwright test tests/e2e/manual/asset1d-public-trial.spec.ts --workers=1 --reporter=list
|
||||
)
|
||||
|
||||
node - "$REPORT_DIR" <<'NODE'
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const reportDir = process.argv[2];
|
||||
const summaryPath = path.join(reportDir, "summary.json");
|
||||
if (!fs.existsSync(summaryPath)) {
|
||||
console.error(`[asset1d][ERROR] missing summary: ${summaryPath}`);
|
||||
process.exit(1);
|
||||
}
|
||||
const summary = JSON.parse(fs.readFileSync(summaryPath, "utf8"));
|
||||
console.log(`[asset1d] status=${summary.status} created=${summary.createdAssets?.length ?? 0}`);
|
||||
if (summary.status !== "PASS_ASSET_UI_TRIAL_READY") process.exit(1);
|
||||
NODE
|
||||
@@ -101,9 +101,22 @@ run_client_spec_if_present() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
local cooldown="${OAOPS1_E2E_COOLDOWN_SECONDS:-2}"
|
||||
if [[ "$cooldown" =~ ^[0-9]+$ && "$cooldown" -gt 0 ]]; then
|
||||
sleep "$cooldown"
|
||||
fi
|
||||
run_client_finding_step "$name" "$@" npx playwright test "$spec" --workers=1 --reporter=list
|
||||
}
|
||||
|
||||
cooldown_login_step() {
|
||||
local reason="$1"
|
||||
local cooldown="${OAOPS1_LOGIN_STEP_COOLDOWN_SECONDS:-65}"
|
||||
if [[ "$cooldown" =~ ^[0-9]+$ && "$cooldown" -gt 0 ]]; then
|
||||
log "[oaops1] login cooldown ${cooldown}s before ${reason}"
|
||||
sleep "$cooldown"
|
||||
fi
|
||||
}
|
||||
|
||||
load_default_env() {
|
||||
local env_file="${OAOPS1_ENV_FILE:-$HOME/.hyb-oa/live-smoke.env}"
|
||||
if [[ "${OAOPS1_SKIP_ENV_FILE:-0}" == "1" || ! -f "$env_file" ]]; then
|
||||
@@ -123,6 +136,7 @@ run_ready_and_runtime() {
|
||||
run_finding_step "live-smoke-env" env LIVE_SMOKE_BASE_URL="$PUBLIC_BASE_URL" node "$ROOT_DIR/scripts/qa/check-live-smoke-env.mjs" --json
|
||||
run_finding_step "live-readiness" env QA_ISSUE_ID=OAOPS1 LIVE_SMOKE_BASE_URL="$PUBLIC_BASE_URL" LIVE_SMOKE_READINESS_DIR="$REPORT_DIR/live-smoke-readiness" bash "$ROOT_DIR/scripts/qa/run-live-smoke-readiness.sh"
|
||||
run_finding_step "oa-only-smoke-readiness" env LIVE_SMOKE_BASE_URL="$PUBLIC_BASE_URL" OA_ONLY_SMOKE_READINESS_REPORT_DIR="$REPORT_DIR/oa-only-smoke-readiness" node "$ROOT_DIR/scripts/qa/check-oa-only-smoke-readiness.mjs"
|
||||
cooldown_login_step "live-feature-flags"
|
||||
run_finding_step "live-feature-flags" env LIVE_SMOKE_BASE_URL="$PUBLIC_BASE_URL" node "$ROOT_DIR/scripts/qa/check-live-feature-flags.mjs" \
|
||||
--expect payment_batch_v1=force_on \
|
||||
--expect erp_sync=force_off \
|
||||
@@ -144,14 +158,6 @@ const credentials = {
|
||||
identifier: process.env.LIVE_SMOKE_ADMIN_IDENTIFIER?.trim(),
|
||||
password: process.env.LIVE_SMOKE_ADMIN_PASSWORD?.trim(),
|
||||
},
|
||||
employee: {
|
||||
identifier: process.env.LIVE_SMOKE_EMPLOYEE_IDENTIFIER?.trim(),
|
||||
password: process.env.LIVE_SMOKE_EMPLOYEE_PASSWORD?.trim(),
|
||||
},
|
||||
finance: {
|
||||
identifier: process.env.LIVE_SMOKE_FINANCE_IDENTIFIER?.trim(),
|
||||
password: process.env.LIVE_SMOKE_FINANCE_PASSWORD?.trim(),
|
||||
},
|
||||
};
|
||||
|
||||
const probes = [
|
||||
@@ -161,12 +167,9 @@ const probes = [
|
||||
{ id: "reimbursement-summary", role: "admin", path: "/api/reimbursements/stats/summary", domain: "reimbursement" },
|
||||
{ id: "invoice-pool", role: "admin", path: "/api/invoice-pool?page=1&pageSize=5", domain: "invoice_ocr" },
|
||||
{ id: "purchase-requests", role: "admin", path: "/api/purchase-requests?page=1&pageSize=5", domain: "procurement" },
|
||||
{ id: "contracts-registry", role: "admin", path: "/api/contracts-registry?page=1&pageSize=5", domain: "contracts" },
|
||||
{ id: "contracts-registry", role: "admin", path: "/api/contracts-registry", domain: "contracts" },
|
||||
{ id: "projects", role: "admin", path: "/api/projects?page=1&pageSize=5", domain: "projects" },
|
||||
{ id: "payment-batches", role: "finance", path: "/api/payment-batches?page=1&pageSize=5", domain: "payment_batch" },
|
||||
{ id: "ap-ledger", role: "finance", path: "/api/ap-operations/reimbursement-ledger?page=1&pageSize=5", domain: "accounting_handoff" },
|
||||
{ id: "audit-logs", role: "admin", path: "/api/audit-logs?page=1&pageSize=5", domain: "audit" },
|
||||
{ id: "employee-reimbursements", role: "employee", path: "/api/reimbursements?page=1&pageSize=5&mine=1", domain: "employee_scope" },
|
||||
];
|
||||
|
||||
function maskIdentifier(value) {
|
||||
@@ -281,6 +284,7 @@ async function main() {
|
||||
baseUrl,
|
||||
checkedAt: new Date().toISOString(),
|
||||
readOnly: true,
|
||||
duplicateRoleChecks: "employee/finance/payment/AP are covered by oa-only-smoke-readiness to avoid repeated login throttling",
|
||||
roles: Object.fromEntries(Object.entries(roles).map(([role, state]) => [role, {
|
||||
status: state.status,
|
||||
reason: state.reason || null,
|
||||
@@ -510,5 +514,6 @@ trap finish EXIT
|
||||
|
||||
load_default_env
|
||||
run_ready_and_runtime
|
||||
cooldown_login_step "authenticated-readonly-probe"
|
||||
run_finding_step "authenticated-readonly-probe" run_authenticated_readonly_probe
|
||||
run_mobile_and_entry_matrix
|
||||
|
||||
在新工单中引用
屏蔽一个用户