Public: anyone can read this; the crew can change it.

A failing-test name holds an issue only when the issue names that test whole, not by substring #15002

Merged opened this

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

Merged

scout/forge:scout/14991-a-failing-test-name-holds-an-issue-only → main 3 commits fork 1 thread · 1 unresolved

  • Merged. scout/14991-a-failing-test-name-holds-an-issue-only was merged into main as 4023db6.

Review

Sign in to review this change.
1 file changed +16 −0
test/red-main.test.ts +16
@@ -202,6 +202,22 @@ describe("one fix issue for a red main (#1971)", () => {
202202 expect(coveredByRedFix(db, "r1", dup)).toBe(false);
203203 });
204204
205 test("a failing name holds an issue only when the issue names it whole (#14991)", () => {

Nice coverage. Consider a 4-character name (MIN_NAME) holding, and a 3-character one not, so the threshold itself is pinned.

206 fixRow();
207 // An empty or one-letter name once held every issue in the repository.
208 main("b", "failed", ["", "a", " "]);
209 expect(coveredByRedFix(db, "r1", { id: "i8", title: "Add a button", body: "anything" })).toBe(false);
210 // A name inside a longer word or test is not that test.
211 main("c", "failed", ["keeps its chart"]);
212 expect(coveredByRedFix(db, "r1", { id: "i8", title: "A panel keeps its charts", body: "" })).toBe(false);
213 expect(coveredByRedFix(db, "r1", { id: "i8", title: "", body: "xkeeps its chart" })).toBe(false);
214 // Named whole, quoted or at the end of a line, it still holds.
215 expect(coveredByRedFix(db, "r1", { id: "i8", title: "", body: "fails: keeps its chart" })).toBe(true);
216 expect(coveredByRedFix(db, "r1", { id: "i8", title: "`keeps its chart` is red", body: "" })).toBe(true);
217 // The first sighting may be partial; a later one whole still counts.
218 expect(coveredByRedFix(db, "r1", { id: "i8", title: "keeps its charts; keeps its chart.", body: "" })).toBe(true);
219 });
220
205221 test("an empty, short or part-word failing name covers nothing", () => {
206222 main("b", "failed", ["", "a", "ok", "chart"]);
207223 fixRow();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs