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

Merged opened this

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

Merged

mason/forge:mason/7419-test-merge-queue-check-retry-test-ts-pas → main 2 commits fork 1 thread · 1 unresolved

  • Merged. mason/7419-test-merge-queue-check-retry-test-ts-pas was merged into main as 9ae46ef.

Review

Sign in to review this change.
3 files changed +18 −0
test/caching-doc.test.ts +5
@@ -15,6 +15,11 @@ import {
1515 type Fixture,
1616 type Shape,
1717 } 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();
1823
1924 const root = join(import.meta.dir, "..");
2025 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";
1818 import type { Graph } from "../src/core/dependencies.ts";
1919 import { seedFixture, type Fixture, type Shape } from "../bench/map-home.ts";
2020 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();
2126
2227 const SMALL: Shape = {
2328 repos: 6,
test/merge-queue-check-retry.test.ts +8
@@ -12,12 +12,14 @@ import { join } from "node:path";
1212 import { type Candidate, enqueue, type Expect, type Queued } from "../src/checks/queue.ts";
1313 import type { LandVerdict } from "../src/checks/tiers.ts";
1414 import type { Pull } from "../src/core/pulls.ts";
15 import { type LogLevel, logLevel, setLogLevel } from "../src/kernel/log.ts";
1516
1617 describe("the merge queue gates a red (check) once more before it searches", () => {
1718 let dir: string;
1819 const told: number[] = [];
1920 let logged: string[] = [];
2021 const spies: { mockRestore(): void }[] = [];
22 let floor: LogLevel;
2123
2224 const git = (...args: string[]) =>
2325 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", ()
2628 dir = await mkdtemp(join(tmpdir(), "forge-merge-queue-check-retry-"));
2729 Bun.spawnSync(["git", "init", "-q", "-b", "main", dir]);
2830 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");

Nit, non-blocking: quietLogs("info") from test/helpers/globals.ts, called inside this describe, does the same borrow-and-return without the floor variable and the extra import. It would also keep the three files in this pull on one helper. Fine as it is.

2936 for (const level of ["info", "warn"] as const)
3037 spies.push(spyOn(console, level).mockImplementation((...args: unknown[]) => void logged.push(args.join(" "))));
3138 });
@@ -37,6 +44,7 @@ describe("the merge queue gates a red (check) once more before it searches", ()
3744
3845 afterAll(async () => {
3946 for (const s of spies) s.mockRestore();
47 setLogLevel(floor);
4048 await rm(dir, { recursive: true, force: true });
4149 });
4250

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs