fix(scripts): bound Z.AI fallback repro output

This commit is contained in:
Vincent Koc
2026-05-28 18:02:28 +02:00
parent a85ff92c05
commit 716fd67e03
4 changed files with 60 additions and 7 deletions

View File

@@ -214,6 +214,13 @@ describe("scripts/test-projects changed-target routing", () => {
});
});
it("routes Z.AI fallback repro script changes through its regression test", () => {
expect(resolveChangedTestTargetPlan(["scripts/zai-fallback-repro.ts"])).toEqual({
mode: "targets",
targets: ["test/scripts/zai-fallback-repro.test.ts"],
});
});
it("routes group visible reply config changes through channel delivery regressions", () => {
expect(
resolveChangedTestTargetPlan([

View File

@@ -1,5 +1,8 @@
import { describe, expect, it } from "vitest";
import { resolveZaiFallbackPnpmCommand } from "../../scripts/zai-fallback-repro.ts";
import {
appendBoundedReproOutput,
resolveZaiFallbackPnpmCommand,
} from "../../scripts/zai-fallback-repro.ts";
describe("zai fallback repro command resolution", () => {
it("wraps Windows pnpm.cmd without Node shell argv", () => {
@@ -24,4 +27,12 @@ describe("zai fallback repro command resolution", () => {
windowsVerbatimArguments: true,
});
});
it("keeps only a bounded child output tail", () => {
const first = appendBoundedReproOutput({ text: "", truncatedChars: 0 }, "abcdef", 5);
const second = appendBoundedReproOutput(first, "ghij", 5);
expect(first).toEqual({ text: "bcdef", truncatedChars: 1 });
expect(second).toEqual({ text: "fghij", truncatedChars: 5 });
});
});