Skip to content

Commit 47e2257

Browse files
committed
fix(ci): prepare runtime artifacts before live image tests
1 parent b111319 commit 47e2257

3 files changed

Lines changed: 41 additions & 21 deletions

File tree

‎docs/ci.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,8 @@ The release live/E2E child keeps broad native `pnpm test:live` coverage, but it
660660

661661
That keeps the same file coverage while making slow live provider failures easier to rerun and diagnose. The aggregate `native-live-src-gateway`, `native-live-extensions-o-z`, `native-live-extensions-media`, and `native-live-extensions-media-music` shard names remain valid for manual one-shot reruns.
662662

663+
Gateway-profile shards and shards containing the image-tool provider or OpenAI plugin live tests prepare the `sourcePerformance` build profile before starting Vitest. This supplies executable provider and agent runtime artifacts without building declarations or the Control UI. Provider requests, assertions, and test deadlines remain unchanged; gateway diagnostic environment settings apply only to gateway-profile shards. Cold source-plugin Jiti import cost remains a separate performance follow-up, not live provider latency.
664+
663665
The native live media shards run in `ghcr.io/openclaw/openclaw-live-media-runner:ubuntu-24.04`, built by the `Live Media Runner Image` workflow. That image preinstalls `ffmpeg` and `ffprobe`; media jobs only verify the binaries before setup. Keep Docker-backed live suites on normal Blacksmith runners — container jobs are the wrong place to launch nested Docker tests.
664666

665667
Docker-backed live model/backend shards use a separate shared `ghcr.io/openclaw/openclaw-live-test:<sha>-<extensions>` image per selected commit. The live release workflow builds and pushes that image once, then the Docker live model, provider-sharded gateway, CLI backend, ACP bind, and Codex harness shards run with `OPENCLAW_SKIP_DOCKER_BUILD=1`. Gateway Docker shards carry explicit script-level `timeout` caps below the workflow job timeout so a stuck container or cleanup path fails fast instead of consuming the whole release-check budget. If those shards rebuild the full source Docker target independently, the release run is misconfigured and will waste wall clock on duplicate image builds.

‎scripts/test-live-shard.mts‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,18 +397,29 @@ export function buildLiveShardPnpmArgs(files: string[], passthroughArgs: string[
397397
* Resolves build profiles required by selected live tests.
398398
*/
399399
export function resolveLiveShardPreparation(files: string[]): LiveShardPreparation | null {
400-
if (files.some(isGatewayProfilesLiveTest)) {
400+
const gatewayProfiles = files.some(isGatewayProfilesLiveTest);
401+
// Vision requests load provider and agent runtime plugins. Compile them before
402+
// Vitest starts so cold source transforms do not consume the request deadline.
403+
if (
404+
gatewayProfiles ||
405+
files.includes("src/agents/tools/image-tool.providers.live.test.ts") ||
406+
files.includes("extensions/openai/openai.live.test.ts")
407+
) {
401408
return {
402409
env: {},
403410
profile: "sourcePerformance",
404411
requiredArtifact: SOURCE_PERFORMANCE_ARTIFACT,
405-
runtimeEnv: {
406-
OPENCLAW_DISABLE_BONJOUR: "1",
407-
OPENCLAW_GATEWAY_STARTUP_TRACE: "1",
408-
OPENCLAW_LIVE_TEST_QUIET: "0",
409-
OPENCLAW_LOG_LEVEL: "info",
410-
OPENCLAW_PLUGIN_LIFECYCLE_TRACE: "1",
411-
},
412+
...(gatewayProfiles
413+
? {
414+
runtimeEnv: {
415+
OPENCLAW_DISABLE_BONJOUR: "1",
416+
OPENCLAW_GATEWAY_STARTUP_TRACE: "1",
417+
OPENCLAW_LIVE_TEST_QUIET: "0",
418+
OPENCLAW_LOG_LEVEL: "info",
419+
OPENCLAW_PLUGIN_LIFECYCLE_TRACE: "1",
420+
},
421+
}
422+
: {}),
412423
};
413424
}
414425
if (files.includes(QA_RUNTIME_LIVE_TEST)) {

‎test/scripts/test-live-shard.test.ts‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,17 @@ describe("scripts/test-live-shard", () => {
254254
).toBeNull();
255255
});
256256

257+
it.each(["native-live-src-agents", "native-live-extensions-openai"])(
258+
"prepares executable runtime artifacts before %s exercises live vision",
259+
(shard) => {
260+
expect(resolveLiveShardPreparation(selectLiveShardFiles(shard, allFiles))).toEqual({
261+
env: {},
262+
profile: "sourcePerformance",
263+
requiredArtifact: "dist/.runtime-postbuildstamp",
264+
});
265+
},
266+
);
267+
257268
it("fails live shard reports with no passing tests", () => {
258269
expect(validateLiveShardReportPayload({ numPassedTests: 1, numTotalTests: 3 })).toEqual({
259270
ok: true,
@@ -604,20 +615,16 @@ describe("scripts/test-live-shard", () => {
604615

605616
try {
606617
writeFakePnpm(fakePnpmPath);
607-
runner = spawn(
608-
process.execPath,
609-
["scripts/test-live-shard.mjs", "native-live-src-agents"],
610-
{
611-
env: {
612-
...process.env,
613-
OPENCLAW_FAKE_PNPM_DESCENDANT_PID_PATH: descendantPidPath,
614-
OPENCLAW_FAKE_PNPM_PID_PATH: childPidPath,
615-
OPENCLAW_FAKE_PNPM_SIGNALED_PATH: signaledPath,
616-
npm_execpath: fakePnpmPath,
617-
},
618-
stdio: "ignore",
618+
runner = spawn(process.execPath, ["scripts/test-live-shard.mjs", "native-live-src-infra"], {
619+
env: {
620+
...process.env,
621+
OPENCLAW_FAKE_PNPM_DESCENDANT_PID_PATH: descendantPidPath,
622+
OPENCLAW_FAKE_PNPM_PID_PATH: childPidPath,
623+
OPENCLAW_FAKE_PNPM_SIGNALED_PATH: signaledPath,
624+
npm_execpath: fakePnpmPath,
619625
},
620-
);
626+
stdio: "ignore",
627+
});
621628

622629
childPid = await waitForPidFile(childPidPath, 5_000);
623630
descendantPid = await waitForPidFile(descendantPidPath, 5_000);

0 commit comments

Comments
 (0)