report a source that is quiet rather than broken, instead of a bare 0
The build log prints a count per source, and CI now declines to fail on a page that states its own emptiness — which leaves that source showing an unexplained 0, reading as exactly the fault the gate just decided it was not. The zero we are content with is the one that has to say why. It is also the only line that would ever prompt anyone to ask whether a lane quiet for a month is a game between patches or a wiki that reworded the sentence a statesNoEvents check is still matching. Nothing else in the pipeline can tell those apart. The test count in the layout block was stale at 898 and moves with these two commits, so it is corrected here. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1156c358a7
commit
8f3e851274
+18
-1
@@ -3,6 +3,7 @@ import {
|
||||
brokenSources,
|
||||
freshness,
|
||||
staleSources,
|
||||
quietSources,
|
||||
STALE_AFTER_MS,
|
||||
SourceHealth,
|
||||
} from "../src/shared/feed.ts";
|
||||
@@ -175,10 +176,26 @@ describe("telling a broken source from a stale one", () => {
|
||||
expect(brokenSources([health({})])).toEqual([]);
|
||||
});
|
||||
|
||||
test("a healthy source is neither", () => {
|
||||
test("a healthy source is none of the three", () => {
|
||||
const ok = health({ eventCount: 5, parsedCount: 5 });
|
||||
expect(brokenSources([ok])).toEqual([]);
|
||||
expect(staleSources([ok])).toEqual([]);
|
||||
expect(quietSources([ok])).toEqual([]);
|
||||
});
|
||||
|
||||
test("a source whose page states it lists none is reported as quiet", () => {
|
||||
// Excusing it from the build is not the same as saying nothing about it.
|
||||
// The build log prints a count per source, and an unexplained 0 reads as
|
||||
// the fault this whole distinction exists to deny — so the one empty we
|
||||
// are content with is the one that has to say why.
|
||||
expect(
|
||||
quietSources([health({ parsedCount: 0, statesNoEvents: true })]).map(
|
||||
(s) => s.sourceId,
|
||||
),
|
||||
).toEqual(["nikki-fandom-events"]);
|
||||
expect(staleSources([health({ parsedCount: 0, statesNoEvents: true })])).toEqual(
|
||||
[],
|
||||
);
|
||||
});
|
||||
|
||||
test("a source with nothing current left is reported as stale", () => {
|
||||
|
||||
@@ -1096,6 +1096,17 @@ describe("the workflows that drive the refresh", () => {
|
||||
expect(ci).toContain("brokenSources");
|
||||
expect(ci).not.toContain("eventCount === 0");
|
||||
});
|
||||
|
||||
test("ci.yml says which empty a source's zero was", async () => {
|
||||
// Three sources can read zero and only one is a fault, so the two that are
|
||||
// not have to say so where the count is printed — an unexplained 0 in the
|
||||
// log reads as the failure the check just declined to call it. Whether the
|
||||
// rules are right is exercised in test/feed.test.ts; this only pins that
|
||||
// both are wired up.
|
||||
const ci = await read("ci.yml");
|
||||
expect(ci).toContain("staleSources");
|
||||
expect(ci).toContain("quietSources");
|
||||
});
|
||||
});
|
||||
|
||||
describe("flags", () => {
|
||||
|
||||
Reference in New Issue
Block a user