From 6360b2514e9895a31e4d607f1e53d15cdfea815f Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Sun, 19 Jul 2026 13:04:35 -0300 Subject: [PATCH] test(router-eval): assert regression reasons instead of counting entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test named 'captures AIQ and cost regressions' only asserted regressions.length > 0, which re-implements a condition the production comparison owns and passes even if either regression stops being reported. Assert the actual AIQ and cost reasons instead — strictly stronger and clears the weakened-assert gate. --- .../maintenance/router-eval-test-assert-strengthen.md | 1 + tests/unit/router-eval.test.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelog.d/maintenance/router-eval-test-assert-strengthen.md diff --git a/changelog.d/maintenance/router-eval-test-assert-strengthen.md b/changelog.d/maintenance/router-eval-test-assert-strengthen.md new file mode 100644 index 0000000000..c6f6e86046 --- /dev/null +++ b/changelog.d/maintenance/router-eval-test-assert-strengthen.md @@ -0,0 +1 @@ +- Strengthen the `compareRouterEvalRuns` regression test to assert the actual AIQ and cost regression reasons instead of counting entries, clearing the weakened-assert (test-masking) gate on the release tip. diff --git a/tests/unit/router-eval.test.ts b/tests/unit/router-eval.test.ts index ba520a6c86..4d6527704f 100644 --- a/tests/unit/router-eval.test.ts +++ b/tests/unit/router-eval.test.ts @@ -73,7 +73,14 @@ test("compareRouterEvalRuns captures AIQ and cost regressions", () => { relativeCostIncrease: 1.2, }); - assert.equal(comparison.regressions.length > 0, true); + assert.ok( + comparison.regressions.some((reason) => reason.startsWith("AIQ dropped by")), + "expected an AIQ regression to be reported" + ); + assert.ok( + comparison.regressions.some((reason) => reason.startsWith("cost increased by")), + "expected a cost regression to be reported" + ); assert.equal(comparison.delta.aiq <= 0, true); assert.equal(comparison.delta.costUsd > 0, true); });