Skip to content

Commit 26cb189

Browse files
authored
fix(qa): stabilize primary smoke runtime evidence (#99784)
* fix(qa): restore fast smoke profile evidence * fix(qa): reuse one package across smoke Docker lanes * fix(qa): keep OTEL smoke output repo-relative
1 parent 9d68f87 commit 26cb189

4 files changed

Lines changed: 42 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,12 +872,17 @@ jobs:
872872
;;
873873
qa-smoke-ci)
874874
output_dir=".artifacts/qa-e2e/smoke-ci-profile"
875+
package_dir=".artifacts/qa-e2e/smoke-ci-package"
875876
export OPENCLAW_BUILD_PRIVATE_QA=1
876877
export OPENCLAW_ENABLE_PRIVATE_QA_CLI=1
877878
export OPENCLAW_DISABLE_BUNDLED_PLUGINS=0
878879
export OPENCLAW_QA_REDACT_PUBLIC_METADATA=1
879880
export OPENCLAW_QA_TRANSPORT_READY_TIMEOUT_MS=180000
880-
NODE_OPTIONS=--max-old-space-size=8192 node scripts/build-all.mjs qaRuntime
881+
export NODE_OPTIONS=--max-old-space-size=12288
882+
node scripts/package-openclaw-for-docker.mjs \
883+
--output-dir "$package_dir" \
884+
--output-name openclaw-current.tgz
885+
export OPENCLAW_CURRENT_PACKAGE_TGZ="$PWD/$package_dir/openclaw-current.tgz"
881886
qa_exit_code=0
882887
pnpm openclaw qa run \
883888
--repo-root . \

test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,15 @@ function buildQaEnv(port: number): NodeJS.ProcessEnv {
15051505
return env;
15061506
}
15071507

1508-
function buildQaArgs(options: CliOptions): string[] {
1508+
function resolveQaOutputDir(outputDir: string, repoRoot = process.cwd()): string {
1509+
const relative = path.relative(repoRoot, path.resolve(repoRoot, outputDir));
1510+
if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
1511+
throw new Error("--output-dir must stay within the repo root");
1512+
}
1513+
return relative ? relative.split(path.sep).join("/") : ".";
1514+
}
1515+
1516+
function buildQaArgs(options: CliOptions, repoRoot = process.cwd()): string[] {
15091517
const args = [
15101518
"qa",
15111519
"suite",
@@ -1516,7 +1524,7 @@ function buildQaArgs(options: CliOptions): string[] {
15161524
"--concurrency",
15171525
"1",
15181526
"--output-dir",
1519-
options.outputDir,
1527+
resolveQaOutputDir(options.outputDir, repoRoot),
15201528
"--fast",
15211529
];
15221530
if (options.primaryModel) {
@@ -2018,6 +2026,7 @@ export const testing = {
20182026
appendGatewayStdoutArtifactLogs,
20192027
appendCapturedBodyText,
20202028
assertSmoke,
2029+
buildQaArgs,
20212030
buildQaEnv,
20222031
createBoundedTextAccumulator,
20232032
createStdoutDiagnosticLogCapture,

test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,27 @@ describe("qa-otel-smoke receiver bounds", () => {
200200
);
201201
});
202202

203+
it("passes a repo-relative output dir to the child QA suite", () => {
204+
const repoRoot = path.join(path.sep, "repo");
205+
const options = testing.parseArgs([
206+
"--output-dir",
207+
path.join(repoRoot, ".artifacts", "qa-e2e", "otel-smoke"),
208+
]);
209+
210+
expect(testing.buildQaArgs(options, repoRoot)).toContain(".artifacts/qa-e2e/otel-smoke");
211+
const repoRootArgs = testing.buildQaArgs(
212+
testing.parseArgs(["--output-dir", repoRoot]),
213+
repoRoot,
214+
);
215+
expect(repoRootArgs[repoRootArgs.indexOf("--output-dir") + 1]).toBe(".");
216+
expect(() =>
217+
testing.buildQaArgs(
218+
testing.parseArgs(["--output-dir", path.join(path.sep, "outside", "otel-smoke")]),
219+
repoRoot,
220+
),
221+
).toThrow("--output-dir must stay within the repo root");
222+
});
223+
203224
it("parses body-size limit env values as strict positive integers", () => {
204225
expect(testing.readPositiveIntegerEnv("OTEL_TEST_LIMIT", 64, {})).toBe(64);
205226
expect(

test/scripts/ci-workflow-guards.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,10 @@ describe("ci workflow guards", () => {
916916
expect(runStep.run).not.toContain("--allow-failures");
917917
expect(runStep.run).toContain("qa_exit_code=0");
918918
expect(runStep.run).toContain('exit "$qa_exit_code"');
919-
expect(runStep.run).toContain("scripts/build-all.mjs qaRuntime");
919+
expect(runStep.run).toContain("scripts/package-openclaw-for-docker.mjs");
920+
expect(runStep.run).toContain("OPENCLAW_CURRENT_PACKAGE_TGZ");
921+
expect(runStep.run).toContain("--max-old-space-size=12288");
922+
expect(runStep.run).not.toContain("scripts/build-all.mjs qaRuntime");
920923
expect(runStep.run).not.toContain("OPENAI_API_KEY");
921924
expect(runStep.run).toMatch(
922925
/bundled-protocol\)\s+pnpm test:bundled\s+pnpm protocol:check\s+;;\s+qa-smoke-ci\)/,

0 commit comments

Comments
 (0)