Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1pqmwfsand is past its budget: trevato/forge: "the gate audit before any shard > a new file is in the gate with no list naming it, and explicit files … #5698
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/5607-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork
1 file
changed +21
−7
test/shards.test.ts +21 −7
| @@ -613,7 +613,16 @@ describe("the gate audit before any shard", () => { | ||
| 613 | 613 | stdout: "ignore", |
| 614 | 614 | stderr: "ignore", |
| 615 | 615 | }).exitCode; |
| 616 | const run = async (extra: string[], args: string[], drop: string[] = [], commit = false) => { | |
| 616 | // `stopAt`: kill the runner once stderr carries it. The audit and the slice | |
| 617 | // banner come before any bun test spawns; what runs after them is the | |
| 618 | // machine's load, not the code under test. | |
| 619 | const run = async ( | |
| 620 | extra: string[], | |
| 621 | args: string[], | |
| 622 | drop: string[] = [], | |
| 623 | commit = false, | |
| 624 | stopAt?: string, | |
| 625 | ) => { | |
| 617 | 626 | const dir = mkdtempSync(join(tmpdir(), "forge-audit-")); |
| 618 | 627 | mkdirSync(join(dir, "test")); |
| 619 | 628 | for (const file of listed) if (!drop.includes(file)) writeFileSync(join(dir, file), ""); |
| @@ -634,10 +643,15 @@ describe("the gate audit before any shard", () => { | ||
| 634 | 643 | stdout: "pipe", |
| 635 | 644 | stderr: "pipe", |
| 636 | 645 | }); |
| 637 | const [out, err] = await Promise.all([ | |
| 638 | new Response(child.stdout).text(), | |
| 639 | new Response(child.stderr).text(), | |
| 640 | ]); | |
| 646 | const watch = async (stream: ReadableStream<Uint8Array>) => { | |
| 647 | let text = ""; | |
| 648 | for await (const chunk of stream) { | |
| 649 | text += new TextDecoder().decode(chunk); | |
| 650 | if (stopAt !== undefined && text.includes(stopAt)) child.kill(); | |
| 651 | } | |
| 652 | return text; | |
| 653 | }; | |
| 654 | const [out, err] = await Promise.all([new Response(child.stdout).text(), watch(child.stderr)]); | |
| 641 | 655 | const code = await child.exited; |
| 642 | 656 | rmSync(dir, { recursive: true, force: true }); |
| 643 | 657 | return { code, out, err, ms: performance.now() - started }; |
| @@ -660,10 +674,10 @@ describe("the gate audit before any shard", () => { | ||
| 660 | 674 | // One slice holds every file, so the count includes the new one; a shard |
| 661 | 675 | // per file would outgrow the three digits a shard spec allows. |
| 662 | 676 | const all = String(gateFiles().length + 1); |
| 663 | const got = await run(["test/zz-new.test.ts"], ["--gate", "--shard", "1/1"]); | |
| 677 | const got = await run(["test/zz-new.test.ts"], ["--gate", "--shard", "1/1"], [], false, "matrix slice"); | |
| 664 | 678 | expect(got.err).not.toContain("EXCLUDED"); |
| 665 | 679 | expect(got.out).toContain(`matrix slice 1/1 (${all} of ${all} files)`); |
| 666 | const explicit = await run(["test/zz-new.test.ts"], ["test/zz-new.test.ts"], [listed[0]!]); | |
| 680 | const explicit = await run(["test/zz-new.test.ts"], ["test/zz-new.test.ts"], [listed[0]!], false, "matrix slice"); | |
| 667 | 681 | expect(explicit.err).not.toContain("EXCLUDED"); |
| 668 | 682 | }, 30_000); |
| 669 | 683 |
new above
offline