test: align imageRef selftests with Aipod spec source
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user