Public: anyone can read this; the crew can change it.
Five tests outside the check list are red on main in a crew sandbox #253
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/238-five-tests-outside-the-check-list-are-re → main 1 commit fork
2 files
changed +32
−2
test/tui-local.test.ts +22
| @@ -67,13 +67,31 @@ async function type( | ||
| 67 | 67 | await settle(app); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | const IDENTITY = { | |
| 71 | GIT_AUTHOR_NAME: "Ada", | |
| 72 | GIT_AUTHOR_EMAIL: "[email protected]", | |
| 73 | GIT_COMMITTER_NAME: "Ada", | |
| 74 | GIT_COMMITTER_EMAIL: "[email protected]", | |
| 75 | }; | |
| 76 | ||
| 70 | 77 | describe("the local terminal UI", () => { |
| 71 | 78 | let root = ""; |
| 72 | 79 | let dir = ""; |
| 73 | 80 | let term: HeadlessTerminal; |
| 74 | 81 | let app: App; |
| 82 | const ambient: Record<string, string | undefined> = {}; | |
| 75 | 83 | |
| 76 | 84 | beforeAll(async () => { |
| 85 | // `git/local.ts` (driven here through the app, not through `sh` above) | |
| 86 | // inherits this process's environment on purpose — it is the person at | |
| 87 | // the keyboard's own identity. A crew sandbox's shell already names an | |
| 88 | // author (its agent), so a commit the app writes must not pick that up | |
| 89 | // instead of Ada. | |
| 90 | for (const [key, value] of Object.entries(IDENTITY)) { | |
| 91 | ambient[key] = process.env[key]; | |
| 92 | process.env[key] = value; | |
| 93 | } | |
| 94 | ||
| 77 | 95 | root = await mkdtemp(join(tmpdir(), "forge-tui-local-")); |
| 78 | 96 | dir = join(root, "forge.test", "ada", "workshop"); |
| 79 | 97 | await mkdir(dir, { recursive: true }); |
| @@ -107,6 +125,10 @@ describe("the local terminal UI", () => { | ||
| 107 | 125 | |
| 108 | 126 | afterAll(async () => { |
| 109 | 127 | app.stop(); |
| 128 | for (const [key, value] of Object.entries(ambient)) { | |
| 129 | if (value === undefined) delete process.env[key]; | |
| 130 | else process.env[key] = value; | |
| 131 | } | |
| 110 | 132 | await rm(root, { recursive: true, force: true }); |
| 111 | 133 | }); |
| 112 | 134 |
test/web-ui.test.ts +10 −2
| @@ -322,8 +322,11 @@ describe("web ui", () => { | ||
| 322 | 322 | body: form({ name: "sc-ript", visibility: "public" }), |
| 323 | 323 | redirect: "manual", |
| 324 | 324 | }); |
| 325 | // `mode=dev` because the by-name rows in the studio's own palette are | |
| 326 | // apps, not every repository (`paletteIndex`, `src/web/layout.ts`) — a | |
| 327 | // plain repository like this one is dev's box to find. | |
| 325 | 328 | const html = await ( |
| 326 | await fetch(base, { headers: { cookie: owner } }) | |
| 329 | await fetch(`${base}/?mode=dev`, { headers: { cookie: owner } }) | |
| 327 | 330 | ).text(); |
| 328 | 331 | const start = html.indexOf( |
| 329 | 332 | '<script type="application/json" id="palette-index">', |
| @@ -537,8 +540,13 @@ describe("web ui", () => { | ||
| 537 | 540 | ).text(); |
| 538 | 541 | expect(wildcard).not.toContain("needs a label"); |
| 539 | 542 | |
| 543 | // `mode=dev`: the studio's own `/search` is over apps, changes and | |
| 544 | // tells (see `studioSearchPage`), never a plain repository — `proj` is | |
| 545 | // dev's box to find, the same escape hatch `searchPage` documents. | |
| 540 | 546 | const whole = await ( |
| 541 | await fetch(`${base}/search?q=proj`, { headers: { cookie: owner } }) | |
| 547 | await fetch(`${base}/search?q=proj&mode=dev`, { | |
| 548 | headers: { cookie: owner }, | |
| 549 | }) | |
| 542 | 550 | ).text(); |
| 543 | 551 | // Just the results, not the shell: the palette index legitimately carries |
| 544 | 552 | // every repo the viewer may see, and mel is the site admin here. |
new above
offline