From d3c907193f0b74039744eccc13acfdad481efc77 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 21 Jun 2026 18:23:44 +0200 Subject: [PATCH] fix(test): route qa otel smoke parser --- scripts/test-projects.test-support.mjs | 4 ++++ test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts | 2 +- test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts | 12 ++++++++++++ test/scripts/test-projects.test.ts | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/test-projects.test-support.mjs b/scripts/test-projects.test-support.mjs index 4ae18a569c82..95da15a9655f 100644 --- a/scripts/test-projects.test-support.mjs +++ b/scripts/test-projects.test-support.mjs @@ -2040,6 +2040,10 @@ const SOURCE_TEST_TARGETS = new Map([ "test/helpers/agents/happy-path-prompt-snapshots.ts", HAPPY_PATH_PROMPT_SNAPSHOT_HELPER_TEST_TARGETS, ], + [ + "test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts", + ["test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts"], + ], ["src/plugins/runtime-sidecar-paths-baseline.ts", RUNTIME_SIDECAR_BASELINE_OWNER_TEST_TARGETS], ["src/plugins/runtime-sidecar-paths.ts", RUNTIME_SIDECAR_PATH_CONSUMER_TEST_TARGETS], ["ui/config/control-ui-chunking.ts", ["ui/src/ui/control-ui-chunking.test.ts"]], diff --git a/test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts b/test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts index 75306ad80fc9..e7212556259a 100644 --- a/test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts +++ b/test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts @@ -242,7 +242,7 @@ function parseArgs(argv: string[]): CliOptions { } const readValue = () => { const value = args[index + 1]?.trim(); - if (!value) { + if (!value || value.startsWith("-")) { throw new Error(`${arg} requires a value`); } index += 1; diff --git a/test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts b/test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts index eb25fb4981ab..981db5762276 100644 --- a/test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts +++ b/test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts @@ -135,6 +135,18 @@ describe("qa-otel-smoke receiver bounds", () => { }); }); + it.each([ + ["--collector", ["--collector", "--logs-exporter"]], + ["--logs-exporter", ["--logs-exporter", "--collector"]], + ["--output-dir", ["--output-dir", "--collector"]], + ["--provider-mode", ["--provider-mode", "--collector"]], + ["--scenario", ["--scenario", "--collector"]], + ["--model", ["--model", "--collector"]], + ["--alt-model", ["--alt-model", "--collector"]], + ])("rejects missing values for %s before shifting parser state", (flag, args) => { + expect(() => testing.parseArgs(args)).toThrow(`${flag} requires a value`); + }); + it("selects the matching scenario for the requested log exporter", () => { expect(testing.parseArgs(["--logs-exporter", "otlp"]).scenarioId).toBe("otel-trace-smoke"); expect(testing.parseArgs(["--logs-exporter", "stdout"]).scenarioId).toBe( diff --git a/test/scripts/test-projects.test.ts b/test/scripts/test-projects.test.ts index b587e4b2d585..cbe777603b12 100644 --- a/test/scripts/test-projects.test.ts +++ b/test/scripts/test-projects.test.ts @@ -439,6 +439,10 @@ describe("scripts/test-projects changed-target routing", () => { "scripts/e2e/lib/openwebui/http-probe.mjs", ["test/e2e/qa-lab/runtime/openwebui-probe.e2e.test.ts"], ], + [ + "test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts", + ["test/e2e/qa-lab/runtime/qa-otel-smoke.e2e.test.ts"], + ], ["scripts/e2e/lib/text-file-utils.mjs", ["test/scripts/e2e-text-file-utils.test.ts"]], [ "scripts/e2e/lib/plugins/npm-registry-server.mjs",