mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 20:32:20 +03:00
v3.8.40 cycle integration → main. All test gates green (Unit/Integration/Coverage/Node-compat/Quality-Ratchet). The only red check, 'PR Test Policy', is the test-masking heuristic firing on the cumulative ~57-commit release diff (legitimate assert consolidations already reviewed per-PR — Gemini CLI removal #5246, retired GPT models #5280, provider catalog refreshes); overridden with --admin per the documented release-PR convention. CodeQL/SonarQube advisory scans non-blocking; #5278's code already passed CodeQL on main. Homologated on VPS 192.168.0.15 (v3.8.40 healthy).
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import test from "node:test";
|
||
import assert from "node:assert/strict";
|
||
import { renderTestGreen } from "../../../open-sse/services/compression/engines/rtk/renderers/testGreen.ts";
|
||
|
||
const det = (t: string) => ({
|
||
type: t,
|
||
command: "",
|
||
confidence: 1,
|
||
category: "test",
|
||
matchedPatterns: [],
|
||
});
|
||
|
||
test("pytest all-green collapses to summary", () => {
|
||
const input = `============ test session starts ============
|
||
collected 142 items
|
||
tests/a.py ....................
|
||
tests/b.py ....................
|
||
============ 142 passed in 3.21s ============`;
|
||
const r = renderTestGreen(input, det("test-pytest"));
|
||
assert.equal(r.changed, true);
|
||
assert.ok(r.text.includes("142 passed"));
|
||
assert.ok(!r.text.includes("...................."));
|
||
});
|
||
|
||
test("any failure ⇒ no-op (preserve diagnostics)", () => {
|
||
const input = `tests/a.py ..F..
|
||
=== 1 failed, 4 passed in 1.0s ===
|
||
E AssertionError: nope`;
|
||
const r = renderTestGreen(input, det("test-pytest"));
|
||
assert.equal(r.changed, false);
|
||
});
|
||
|
||
test("ANSI-colored FAIL with no numeric failed-count ⇒ no-op (regression: \\bFAIL\\b defeated by ANSI)", () => {
|
||
// jest/vitest emit a colored FAIL header; the ESC[31m byte 'm' before 'F' kills the
|
||
// word boundary. With the per-test failed-count line already stripped by an upstream
|
||
// filter, the ANSI strip in the guard is the only thing preventing a collapsed failure.
|
||
const input = "[1m[31mFAIL[39m[22m src/auth.test.ts\nTests: 3 passed, 3 total";
|
||
const r = renderTestGreen(input, det("test-jest"));
|
||
assert.equal(r.changed, false);
|
||
});
|