Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1ga9w5ebpp is past its budget: trevato/forge: "event audience coverage > every kind the source emits is classified" failed on 3 pulls in the last hour… #3817
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/3723-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved
1 file
changed +9
−3
test/event-audience-coverage.test.ts +9 −3
| @@ -10,6 +10,7 @@ | ||
| 10 | 10 | import { describe, expect, test } from "bun:test"; |
| 11 | 11 | import { Glob } from "bun"; |
| 12 | 12 | import { readFileSync } from "node:fs"; |
| 13 | import { join } from "node:path"; | |
| 13 | 14 | import { classifiedAudience, eventAudience } from "../src/core/event_audience.ts"; |
| 14 | 15 | |
| 15 | 16 | /** |
| @@ -147,10 +148,13 @@ export function emittedKinds(files: Record<string, string>): { | ||
| 147 | 148 | return { kinds, unreadable }; |
| 148 | 149 | } |
| 149 | 150 | |
| 151 | /** Anchored at the repository, not the working directory the runner happens to have. */ | |
| 152 | const ROOT = join(import.meta.dir, ".."); | |
| 153 | ||
| 150 | 154 | async function sources(): Promise<Record<string, string>> { |
| 151 | 155 | const out: Record<string, string> = {}; |
| 152 | for await (const path of new Glob("src/**/*.ts").scan(".")) { | |
| 153 | out[path] = readFileSync(path, "utf8"); | |
| 156 | for await (const path of new Glob("src/**/*.ts").scan(ROOT)) { | |
| 157 | out[path] = readFileSync(join(ROOT, path), "utf8"); | |
| 154 | 158 | } |
| 155 | 159 | return out; |
| 156 | 160 | } |
| @@ -164,7 +168,9 @@ describe("event audience coverage", () => { | ||
| 164 | 168 | .map(([kind, at]) => `${kind} (${at})`); |
| 165 | 169 | expect(missing).toEqual([]); |
| 166 | 170 | expect(unreadable).toEqual([]); |
| 167 | }); | |
| 171 | // A scan of every source file is CPU work: a loaded check machine gets | |
| 172 | // room, since only the code under test may decide the verdict. | |
| 173 | }, 60_000); | |
| 168 | 174 | |
| 169 | 175 | test("an unclassified kind is for admins, never readers", () => { |
| 170 | 176 | expect(classifiedAudience("brand.new_kind")).toBeUndefined(); |
new above
offline
Move this comment onto the test (above it) rather than between the assertions and the closing brace, and prefer a smaller bound (e.g. 15_000): the scan takes ~100 ms, so 60 s would let a real slowdown pass unnoticed.