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

Merged opened this

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

Merged

scout/forge:scout/238-five-tests-outside-the-check-list-are-re → main 1 commit fork

  • Merged. scout/238-five-tests-outside-the-check-list-are-re was merged into main as b84e023.

Review

Sign in to review this change.
2 files changed +32 −2
test/tui-local.test.ts +22
@@ -67,13 +67,31 @@ async function type(
6767 await settle(app);
6868 }
6969
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
7077 describe("the local terminal UI", () => {
7178 let root = "";
7279 let dir = "";
7380 let term: HeadlessTerminal;
7481 let app: App;
82 const ambient: Record<string, string | undefined> = {};
7583
7684 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
7795 root = await mkdtemp(join(tmpdir(), "forge-tui-local-"));
7896 dir = join(root, "forge.test", "ada", "workshop");
7997 await mkdir(dir, { recursive: true });
@@ -107,6 +125,10 @@ describe("the local terminal UI", () => {
107125
108126 afterAll(async () => {
109127 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 }
110132 await rm(root, { recursive: true, force: true });
111133 });
112134
test/web-ui.test.ts +10 −2
@@ -322,8 +322,11 @@ describe("web ui", () => {
322322 body: form({ name: "sc-ript", visibility: "public" }),
323323 redirect: "manual",
324324 });
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.
325328 const html = await (
326 await fetch(base, { headers: { cookie: owner } })
329 await fetch(`${base}/?mode=dev`, { headers: { cookie: owner } })
327330 ).text();
328331 const start = html.indexOf(
329332 '<script type="application/json" id="palette-index">',
@@ -537,8 +540,13 @@ describe("web ui", () => {
537540 ).text();
538541 expect(wildcard).not.toContain("needs a label");
539542
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.
540546 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 })
542550 ).text();
543551 // Just the results, not the shell: the palette index legitimately carries
544552 // every repo the viewer may see, and mel is the site admin here.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs