diff --git a/scripts/test-live-shard.mjs b/scripts/test-live-shard.mjs index d2afe1d387f3..68aafb8be845 100644 --- a/scripts/test-live-shard.mjs +++ b/scripts/test-live-shard.mjs @@ -42,6 +42,7 @@ const OPTIONAL_LIVE_SHARD_FILE_ENVS = new Map([ ["src/gateway/gateway-cli-backend.live.test.ts", ["OPENCLAW_LIVE_CLI_BACKEND"]], ["src/gateway/gateway-codex-bind.live.test.ts", ["OPENCLAW_LIVE_CODEX_BIND"]], ["src/gateway/gateway-codex-harness.live.test.ts", ["OPENCLAW_LIVE_CODEX_HARNESS"]], + ["src/gateway/gateway-openai-long-context.live.test.ts", ["OPENCLAW_LIVE_OPENAI_LONG_CONTEXT"]], ["src/gateway/gateway-trajectory-export.live.test.ts", ["OPENCLAW_LIVE_CODEX_HARNESS"]], ["src/infra/push-apns-http2.live.test.ts", ["OPENCLAW_LIVE_APNS_REACHABILITY"]], ["test/image-generation.infer-cli.live.test.ts", ["OPENCLAW_LIVE_INFER_CLI_TEST"]], diff --git a/test/scripts/test-live-shard.test.ts b/test/scripts/test-live-shard.test.ts index 98ed7205dc61..5afff7ecfc1e 100644 --- a/test/scripts/test-live-shard.test.ts +++ b/test/scripts/test-live-shard.test.ts @@ -394,6 +394,38 @@ describe("scripts/test-live-shard", () => { }); }); + it("allows the OpenAI long-context live file to be skipped until its env is enabled", () => { + const profilesFile = "src/gateway/gateway-models.profiles.live.test.ts"; + const longContextFile = "src/gateway/gateway-openai-long-context.live.test.ts"; + const payload = { + numPassedTests: 1, + numTotalTests: 2, + testResults: [ + { + name: path.join(process.cwd(), profilesFile), + assertionResults: [{ status: "passed" }], + }, + { + name: path.join(process.cwd(), longContextFile), + assertionResults: [{ status: "skipped" }], + }, + ], + }; + const expectedFiles = [profilesFile, longContextFile]; + + expect(validateLiveShardReportPayload(payload, expectedFiles, process.cwd(), {})).toEqual({ + ok: true, + }); + expect( + validateLiveShardReportPayload(payload, expectedFiles, process.cwd(), { + OPENCLAW_LIVE_OPENAI_LONG_CONTEXT: "1", + }), + ).toEqual({ + ok: false, + reason: `Vitest report selected live test files had no passing assertions: ${longContextFile}`, + }); + }); + it("allows the experience review live file to be skipped until its env is enabled", () => { const reviewFile = "src/skills/workshop/experience-review.live.test.ts"; const payload = {