test(workspace): harden release gate automation

This commit is contained in:
huanghuoguoguo
2026-07-20 17:13:19 +08:00
parent 7615c40f73
commit e3df35e7f7
18 changed files with 293 additions and 53 deletions
+44 -3
View File
@@ -3708,7 +3708,7 @@ test("MCP stdio tool-call case setups pipeline and registered MCP server", () =>
assert.deepEqual(
run.setup_automation.map((item: { entry: string }) => item.entry),
[
"node:scripts/e2e/ensure-local-agent-pipeline.mjs --write-env",
"node:scripts/e2e/ensure-fake-provider-pipeline.mjs --write-env",
"case:mcp-stdio-register",
],
);
@@ -3739,8 +3739,8 @@ test("MCP stdio tool-call case setups pipeline and registered MCP server", () =>
assert.equal(planResult.code, 0);
const plan = JSON.parse(planResult.output);
assert.deepEqual(plan.setup_provides_env, [
"LANGBOT_LOCAL_AGENT_PIPELINE_URL",
"LANGBOT_LOCAL_AGENT_PIPELINE_NAME",
"LANGBOT_FAKE_PROVIDER_PIPELINE_URL",
"LANGBOT_FAKE_PROVIDER_PIPELINE_NAME",
"LANGBOT_MCP_QA_STDIO_SERVER_UUID",
]);
assert.ok(
@@ -4588,6 +4588,47 @@ test("test report classifies model route failures as env_issue", () => {
}
});
test("test report classifies provider quota tracebacks as env_issue", () => {
const tmp = mkdtempSync(join(tmpdir(), "lbs-report-quota-env-issue-"));
try {
const logPath = join(tmp, "backend.log");
writeFileSync(
logPath,
[
"[05-21 10:31:00.000] chat.py (2) - [ERROR] : Request Failed: Traceback (most recent call last):",
" File \"provider.py\", line 1, in invoke",
"openai.PermissionDeniedError: insufficient user quota",
"[05-21 10:31:01.000] pipeline.py (3) - [ERROR] : runner.llm_error All models failed during streaming setup: insufficient user quota",
].join("\n"),
);
const result = capture(() =>
commandTestReport(
ctx([
"test",
"report",
"local-agent-complex-coding-task-debug-chat",
"--backend-log",
logPath,
"--json",
]),
),
);
assert.equal(result.code, 0);
const report = JSON.parse(result.output);
assert.equal(report.log_guard.status, "env_issue");
assert.ok(
report.log_guard.findings.some(
(finding: { severity?: string; pattern?: string }) =>
finding.severity === "env_issue" &&
finding.pattern === "insufficient user quota",
),
);
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("test report infers scan window from automation result evidence", () => {
const tmp = mkdtempSync(join(tmpdir(), "lbs-report-evidence-window-"));
try {