Public: anyone can read this; the crew can change it.
test/merge-queue-check-retry.test.ts passes every time in the full suite, not just alone #7438
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/7419-test-merge-queue-check-retry-test-ts-pas → main 2 commits fork 1 thread · 1 unresolved
3 files
changed +18
−0
test/caching-doc.test.ts +5
| @@ -15,6 +15,11 @@ import { | ||
| 15 | 15 | type Fixture, |
| 16 | 16 | type Shape, |
| 17 | 17 | } from "../bench/map-home.ts"; |
| 18 | import { quietLogs } from "./helpers/globals.ts"; | |
| 19 | ||
| 20 | // `seedFixture` raises the log floor and never lowers it: borrowed for | |
| 21 | // this file, and given back to whichever file runs next (#7419). | |
| 22 | quietLogs(); | |
| 18 | 23 | |
| 19 | 24 | const root = join(import.meta.dir, ".."); |
| 20 | 25 | const doc = readFileSync(join(root, "docs/CACHING.md"), "utf8"); |
test/map-cache.test.ts +5
| @@ -18,6 +18,11 @@ import { layout } from "../src/web/pages/map.ts"; | ||
| 18 | 18 | import type { Graph } from "../src/core/dependencies.ts"; |
| 19 | 19 | import { seedFixture, type Fixture, type Shape } from "../bench/map-home.ts"; |
| 20 | 20 | import { countStatements } from "../bench/run.ts"; |
| 21 | import { quietLogs } from "./helpers/globals.ts"; | |
| 22 | ||
| 23 | // `seedFixture` raises the log floor and never lowers it: borrowed for | |
| 24 | // this file, and given back to whichever file runs next (#7419). | |
| 25 | quietLogs(); | |
| 21 | 26 | |
| 22 | 27 | const SMALL: Shape = { |
| 23 | 28 | repos: 6, |
test/merge-queue-check-retry.test.ts +8
| @@ -12,12 +12,14 @@ import { join } from "node:path"; | ||
| 12 | 12 | import { type Candidate, enqueue, type Expect, type Queued } from "../src/checks/queue.ts"; |
| 13 | 13 | import type { LandVerdict } from "../src/checks/tiers.ts"; |
| 14 | 14 | import type { Pull } from "../src/core/pulls.ts"; |
| 15 | import { type LogLevel, logLevel, setLogLevel } from "../src/kernel/log.ts"; | |
| 15 | 16 | |
| 16 | 17 | describe("the merge queue gates a red (check) once more before it searches", () => { |
| 17 | 18 | let dir: string; |
| 18 | 19 | const told: number[] = []; |
| 19 | 20 | let logged: string[] = []; |
| 20 | 21 | const spies: { mockRestore(): void }[] = []; |
| 22 | let floor: LogLevel; | |
| 21 | 23 | |
| 22 | 24 | const git = (...args: string[]) => |
| 23 | 25 | Bun.spawnSync(["git", "-C", dir, "-c", "user.name=t", "-c", "user.email=t@t", ...args]).stdout.toString().trim(); |
| @@ -26,6 +28,11 @@ describe("the merge queue gates a red (check) once more before it searches", () | ||
| 26 | 28 | dir = await mkdtemp(join(tmpdir(), "forge-merge-queue-check-retry-")); |
| 27 | 29 | Bun.spawnSync(["git", "init", "-q", "-b", "main", dir]); |
| 28 | 30 | git("commit", "-q", "--allow-empty", "-m", "start"); |
| 31 | // The log floor is process-wide: a file before this one that raised it | |
| 32 | // and never lowered it (`bench/map-home.ts`'s `seedFixture`, #7419) hid | |
| 33 | // the line read below. This file sets its own and gives it back. | |
| 34 | floor = logLevel(); | |
| 35 | setLogLevel("info"); | |
| 29 | 36 | for (const level of ["info", "warn"] as const) |
| 30 | 37 | spies.push(spyOn(console, level).mockImplementation((...args: unknown[]) => void logged.push(args.join(" ")))); |
| 31 | 38 | }); |
| @@ -37,6 +44,7 @@ describe("the merge queue gates a red (check) once more before it searches", () | ||
| 37 | 44 | |
| 38 | 45 | afterAll(async () => { |
| 39 | 46 | for (const s of spies) s.mockRestore(); |
| 47 | setLogLevel(floor); | |
| 40 | 48 | await rm(dir, { recursive: true, force: true }); |
| 41 | 49 | }); |
| 42 | 50 |
new above
offline
Nit, non-blocking:
quietLogs("info")from test/helpers/globals.ts, called inside this describe, does the same borrow-and-return without thefloorvariable and the extra import. It would also keep the three files in this pull on one helper. Fine as it is.