test(qa): 加入目录规则浏览器回归和暂存门禁
build / build (push) Failing after 7m7s

在 QA 虚拟机通过 Chromium 复跑和本地提交检查,并验证必填校验失效会触发失败。Gitea 将浏览器回归纳入必需检查。
This commit is contained in:
姚章浩
2026-11-22 19:57:24 +08:00
parent d7d636792d
commit 5d00715c3a
18 changed files with 407 additions and 8 deletions
+12 -2
View File
@@ -249,6 +249,8 @@ def checks() -> list[Check]:
[g, "test", "-count=1", "-json", "./..."], env=env, judge=judge_go_tests),
Check("tests-web", "前端测试(vitest,必须真跑)",
[py3, "scripts/ci_checks.py", "--internal-web-test"], env=env),
Check("tests-e2e", "Chromium 浏览器回归(CI 必需)", ["make", "tests-e2e-ci"],
env=env, required_in=("ci",), note="本地用 make tests-e2e,复用已安装的浏览器"),
Check("contracts", "版本与变更记录契约(不许 SKIP;开发构建不许自称正式版)",
[py3, "scripts/ci_checks.py", "--internal-contracts", g], env=env),
Check("version", "CHANGELOG 与版本记录(四类小节无空栏目 + 正式 tag 与提交内版本一致)",
@@ -356,8 +358,7 @@ def cmd_internal_web_test() -> int:
def cmd_internal_contracts(go: str) -> int:
"""版本契约:结构 + 注入身份必须**真 PASS**(SKIP 判红),
并且**开发构建不许自称正式版**(负例:标成 release ⇒ 必须红)。"""
qa_rc = subprocess.run(py("-m", "unittest", "discover", "-s", "scripts", "-p", "test_qa_env.py", "-v"),
cwd=ROOT).returncode
qa_rc = subprocess.run(["make", "test-tooling"], cwd=ROOT).returncode
if qa_rc:
return qa_rc
snapshot_rc = subprocess.run(py("scripts/development_snapshot.py","--self-test"),cwd=ROOT).returncode
@@ -442,6 +443,7 @@ CHECK_MANIFEST: dict[str, tuple[str, ...]] = {
"build-web": ("local", "ci"),
"tests-go": ("local", "ci"),
"tests-web": ("local", "ci"),
"tests-e2e": ("ci",),
"contracts": ("local", "ci"),
"version": ("local", "ci"),
"security-secrets": ("local", "ci"),
@@ -635,6 +637,14 @@ def main(argv: list[str]) -> int:
print(f"\n── [{c.id}] {c.title} ──\n {'✅' if status == SUCCESS else ('⏭️' if status == SKIPPED else '❌')} {reason}")
continue
if args.profile not in c.required_in:
reason = f"{args.profile} 档案不要求此项。{c.note}".strip()
results.append({"id": c.id, "title": c.title, "required_in": list(c.required_in),
"status": SKIPPED, "reason": reason, "command": "",
"exit_code": None, "duration_s": 0})
print(f"\n── [{c.id}] {c.title} ──\n ⏭️ {reason}")
continue
print(f"\n── [{c.id}] {c.title} ──")
print(" $ " + " ".join(c.argv))
t0 = time.time()