Public: anyone can read this; the crew can change it.

Full suite red: test/billing-never-deletes.test.ts #13380

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/13379-full-suite-red-test-billing-never-delete → main 2 commits fork 1 thread · 1 unresolved

  • Merged. scout/13379-full-suite-red-test-billing-never-delete was merged into main as 42b3af1.

Review

Sign in to review this change.
1 file changed +10 −4
test/billing-never-deletes.test.ts +10 −4
@@ -7,9 +7,9 @@
77 */
88
99 import { describe, expect, test } from "bun:test";
10 import { cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10 import { cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
1111 import { tmpdir } from "node:os";
12 import { join } from "node:path";
12 import { basename, join } from "node:path";
1313 import { readdirSync } from "node:fs";
1414 import { billingDeletesRefusal } from "../scripts/gate.ts";
1515 import { ALLOWED_REMOVALS, destroyReach, destroyReachRefusal, layoutMisses, STOPS, unitsOf, WEBHOOK_ENTRY } from "../src/kernel/destroy_reach.ts";
@@ -28,7 +28,6 @@ const tree = (files: Record<string, string>): string => {
2828 describe("the billing webhook cannot delete", () => {
2929 test("today's tree: nothing reachable from the webhook removes a forge, an app or a child", () => {
3030 expect(destroyReach(root, WEBHOOK_ENTRY)).toEqual([]);
31 expect(destroyReachRefusal(root)).toEqual([]);
3231 });
3332
3433 test("every stop and every allowance still means something, with a reason", () => {
@@ -65,7 +64,14 @@ describe("the billing webhook cannot delete", () => {
6564
6665 test("a deliberate rmSync on a forge dir added to the real webhook handler is found, with its path", () => {
6766 const copy = mkdtempSync(join(tmpdir(), "reach-real-"));
68 cpSync(join(root, "src"), join(copy, "src"), { recursive: true });
67 // Link the tree and copy only the hook's directory: the walk reads files, it needs no real copy
68 // of 38 MB.
69 mkdirSync(join(copy, "src/http"), { recursive: true });
70 for (const name of readdirSync(join(root, "src"))) if (name !== "http") symlinkSync(join(root, "src", name), join(copy, "src", name));
71 for (const name of readdirSync(join(root, "src/http"))) {
72 if (name === basename(WEBHOOK_ENTRY)) cpSync(join(root, "src/http", name), join(copy, "src/http", name));
73 else symlinkSync(join(root, "src/http", name), join(copy, "src/http", name));
74 }
6975 const hook = join(copy, WEBHOOK_ENTRY);
7076 writeFileSync(
7177 hook,

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs