test: align imageRef selftests with Aipod spec source

This commit is contained in:
AgentRun Codex
2026-06-11 01:30:01 +08:00
parent 5a6e5a4bbd
commit 9972a2114e
5 changed files with 21 additions and 9 deletions
+9 -2
View File
@@ -1,10 +1,11 @@
import { chmod, mkdtemp, mkdir, writeFile, rm } from "node:fs/promises";
import { chmod, mkdtemp, mkdir, readFile, writeFile, rm } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import assert from "node:assert/strict";
import { ManagerClient } from "../mgr/client.js";
import type { BackendProfile, JsonRecord } from "../common/types.js";
import type { AipodImageRef, BackendProfile, JsonRecord } from "../common/types.js";
import { backendProfileSpec } from "../common/backend-profiles.js";
import { parseAipodSpecYaml } from "../common/aipod-specs.js";
import { dsflashGoModelCatalogJson } from "../common/model-catalogs.js";
export interface SelfTestContext {
@@ -133,6 +134,12 @@ export function profileSecretHome(context: Pick<SelfTestContext, "codexHome"> &
return context.codexHome;
}
export async function loadArtificerImageRef(root: string): Promise<AipodImageRef> {
const text = await readFile(path.join(root, "config", "aipods", "artificer.yaml"), "utf8");
const spec = parseAipodSpecYaml(text, "selftest-artificer-image-ref");
return spec.spec.imageRef;
}
function defaultFakeCommand(): string {
return process.versions.bun ? process.execPath : "npx";
}