fix(e2e): preserve frozen scenario error diagnostics (#142645)

This commit is contained in:
Vincent Koc 2026-09-09 08:26:49 +08:00 • committed by GitHub
parent 738c982be2
commit 2d25402ecb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View file

@ -71,7 +71,7 @@ if ! docker_e2e_run_with_harness \
-v "$SCENARIO_PATH:/app/scripts/e2e/lib/release-typed-onboarding/scenario.sh:ro" \
-v "$ONBOARD_ASSERTIONS:/app/scripts/e2e/lib/release-scenarios/assertions.mjs:ro" \
-v "$ONBOARD_MOCK_OPENAI_CONFIG:/app/scripts/e2e/lib/fixtures/mock-openai-config.mjs:ro" \
-i "$IMAGE_NAME" bash scripts/e2e/lib/release-typed-onboarding/scenario.sh >"$run_log" 2>&1; then
-i "$IMAGE_NAME" bash -E scripts/e2e/lib/release-typed-onboarding/scenario.sh >"$run_log" 2>&1; then
docker_e2e_print_log "$run_log"
exit 1
fi

View file

@ -3016,6 +3016,27 @@ docker_e2e_docker_run_cmd run demo
);
});
it("propagates frozen typed-onboarding ERR traps through nested helpers", () => {
const runner = readFileSync(RELEASE_TYPED_ONBOARDING_DOCKER_E2E_PATH, "utf8");
const invocation = runner.match(
/-i "\$IMAGE_NAME" bash(?<flags>(?: +-[A-Za-z]+)*) scripts\/e2e\/lib\/release-typed-onboarding\/scenario\.sh/u,
);
expect(invocation?.groups?.flags).toBeDefined();
const bashFlags = invocation?.groups?.flags?.trim().split(/ +/u).filter(Boolean) ?? [];
const diagnostic = "typed-onboarding diagnostic status=23";
const script = `set -euo pipefail
trap 'status=$?; printf "typed-onboarding diagnostic status=%s\\n" "$status" >&2' ERR
inner() { return 23; }
outer() { inner; }
outer
`;
const result = spawnSync("bash", [...bashFlags, "-c", script], { encoding: "utf8" });
expect(result.status).toBe(23);
expect(result.stderr.trim().split("\n")).toEqual([diagnostic]);
});
it("prints channel-add failures through the shared E2E logger", () => {
const script = readFileSync(NPM_ONBOARD_CHANNEL_AGENT_DOCKER_E2E_PATH, "utf8");
expect(script).toContain(