mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:10:44 +00:00
test: harden qa private runtime staging
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
c25e4b5e1c1469ec66bd9ced3759c2542a05b6ecb0db9aa71fa5a8054f8ef0a2 config-baseline.json
|
||||
e77c14ad4db1be62275667537716917e4d0da73e1afb89be1edeb78d73346ae4 config-baseline.json
|
||||
ed4e305904b4b954ffa72c07ea1900a116bfd874ac0c637227883abb99f753f9 config-baseline.core.json
|
||||
6c0069b971ae298ae68516ebcd3eae0e8c82820d2e8f42ecbd2f53a2f9077371 config-baseline.channel.json
|
||||
e5b7756b5f45ba227aa1bfab990dcf8a2a8b409b9ca01ea8bb1d5cd7adc06c90 config-baseline.plugin.json
|
||||
9096ec947597b03f97eef44186a3102fd80ffb7f3e791fb64544464d4571448f config-baseline.plugin.json
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
3fa4d37ea6dbe5dfd540bcaa8c3bb2b81f2cfd439fa446d548ba159388c7b520 plugin-sdk-api-baseline.json
|
||||
bfb88286eeb8dd11871242d17de4d4bd9196fb27ce5d30dbaa1c0d277c27be85 plugin-sdk-api-baseline.jsonl
|
||||
55b39075f07def786f5056b029921db64fcbdc5e2cab3d645215eccc857ba9a4 plugin-sdk-api-baseline.json
|
||||
4a6b8f4afc9e6aa7c56b0cbab0886dacc4ead534c47761ab30eb76480d8fd673 plugin-sdk-api-baseline.jsonl
|
||||
|
||||
@@ -718,7 +718,7 @@ const withRunNodeBuildLock = async (deps, callback) => {
|
||||
|
||||
const syncRuntimeArtifacts = async (deps) => {
|
||||
try {
|
||||
await deps.runRuntimePostBuild({ cwd: deps.cwd });
|
||||
await deps.runRuntimePostBuild({ cwd: deps.cwd, env: deps.env });
|
||||
} catch (error) {
|
||||
logRunner(
|
||||
`Failed to write runtime build artifacts: ${error?.message ?? "unknown error"}`,
|
||||
|
||||
@@ -209,7 +209,10 @@ async function runStatusCommand(params: {
|
||||
spawn: (cmd: string, args: string[]) => ReturnType<typeof createExitedProcess>;
|
||||
spawnSync?: (cmd: string, args: string[]) => { status: number; stdout: string };
|
||||
env?: Record<string, string>;
|
||||
runRuntimePostBuild?: (params?: { cwd?: string }) => void | Promise<void>;
|
||||
runRuntimePostBuild?: (params?: {
|
||||
cwd?: string;
|
||||
env?: Record<string, string | undefined>;
|
||||
}) => void | Promise<void>;
|
||||
}) {
|
||||
return await runNodeMain({
|
||||
cwd: params.tmp,
|
||||
@@ -232,7 +235,10 @@ async function runQaCommand(params: {
|
||||
spawn: (cmd: string, args: string[]) => ReturnType<typeof createExitedProcess>;
|
||||
spawnSync?: (cmd: string, args: string[]) => { status: number; stdout: string };
|
||||
env?: Record<string, string>;
|
||||
runRuntimePostBuild?: (params?: { cwd?: string }) => void | Promise<void>;
|
||||
runRuntimePostBuild?: (params?: {
|
||||
cwd?: string;
|
||||
env?: Record<string, string | undefined>;
|
||||
}) => void | Promise<void>;
|
||||
}) {
|
||||
return await runNodeMain({
|
||||
cwd: params.tmp,
|
||||
@@ -571,6 +577,37 @@ describe("run-node script", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("passes the synthesized private QA env into runtime postbuild staging", async () => {
|
||||
await withTempDir({ prefix: "openclaw-run-node-" }, async (tmp) => {
|
||||
await setupTrackedProject(tmp, {
|
||||
files: {
|
||||
[ROOT_SRC]: "export const value = 1;\n",
|
||||
[QA_LAB_PLUGIN_SDK_ENTRY]: "export const qaLab = true;\n",
|
||||
},
|
||||
oldPaths: [ROOT_SRC, ROOT_TSCONFIG, ROOT_PACKAGE, QA_LAB_PLUGIN_SDK_ENTRY],
|
||||
buildPaths: [DIST_ENTRY, BUILD_STAMP],
|
||||
});
|
||||
|
||||
const runRuntimePostBuild = vi.fn();
|
||||
const { spawn, spawnSync } = createSpawnRecorder({
|
||||
gitHead: "abc123\n",
|
||||
gitStatus: "",
|
||||
});
|
||||
const exitCode = await runQaCommand({ tmp, spawn, spawnSync, runRuntimePostBuild });
|
||||
|
||||
expect(exitCode).toBe(0);
|
||||
expect(runRuntimePostBuild).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
cwd: tmp,
|
||||
env: expect.objectContaining({
|
||||
OPENCLAW_BUILD_PRIVATE_QA: "1",
|
||||
OPENCLAW_ENABLE_PRIVATE_QA_CLI: "1",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("derives private QA facade checks from distRoot for direct freshness checks", async () => {
|
||||
await withTempDir({ prefix: "openclaw-run-node-" }, async (tmp) => {
|
||||
await setupTrackedProject(tmp, {
|
||||
|
||||
Reference in New Issue
Block a user