From a9ff0802bb338bd17bf075f09bc2cf2e865a409e Mon Sep 17 00:00:00 2001 From: Matthew Meszaros Date: Fri, 30 Oct 2026 14:18:47 +0100 Subject: [PATCH] feat: report skipped PostgreSQL subtests even when their parent test passes --- .github/scripts/live-tests-summary.mjs | 11 +++++++---- .github/scripts/live-tests-summary.test.mjs | 11 +++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/scripts/live-tests-summary.mjs b/.github/scripts/live-tests-summary.mjs index 91b7cb4ce..62d8ed5fb 100644 --- a/.github/scripts/live-tests-summary.mjs +++ b/.github/scripts/live-tests-summary.mjs @@ -3,6 +3,7 @@ import { pathToFileURL } from "node:url"; export function summarizeLiveTests(input, outcome) { const tests = new Map(); + const subtests = new Map(); const failedPackages = new Set(); for (const line of input.split("\n")) { let event; @@ -15,14 +16,16 @@ export function summarizeLiveTests(input, outcome) { if (event.Action === "fail" && typeof event.Package === "string" && !event.Test) { failedPackages.add(event.Package); } - if (typeof event.Test !== "string" || !event.Test.startsWith("TestLive") || event.Test.includes("/")) continue; + if (typeof event.Test !== "string" || !event.Test.startsWith("TestLive")) continue; if (!["pass", "fail", "skip"].includes(event.Action)) continue; - tests.set(`${event.Package}/${event.Test}`, event.Action); + const results = event.Test.includes("/") ? subtests : tests; + results.set(`${event.Package}/${event.Test}`, event.Action); } const names = (action) => [...tests].filter(([, result]) => result === action).map(([name]) => name).sort(); const passed = names("pass"); const failed = names("fail"); const skipped = names("skip"); + const skippedSubtests = [...subtests].filter(([, result]) => result === "skip").map(([name]) => name).sort(); const list = (heading, entries) => [ `### ${heading}`, "", @@ -31,7 +34,7 @@ export function summarizeLiveTests(input, outcome) { "", ]; return { - needsAttention: outcome !== "success" || tests.size === 0 || failed.length > 0 || skipped.length > 0 || failedPackages.size > 0, + needsAttention: outcome !== "success" || tests.size === 0 || failed.length > 0 || skipped.length > 0 || skippedSubtests.length > 0 || failedPackages.size > 0, markdown: [ "## PostgreSQL catch-all (advisory)", "", @@ -46,7 +49,7 @@ export function summarizeLiveTests(input, outcome) { ...(tests.size === 0 ? ["No completed TestLive results were recorded. Check setup, compilation and timeouts.", ""] : []), ...list("Failed packages (including setup or build failures)", [...failedPackages].sort()), ...list("Failed tests", failed), - ...list("Skipped tests", skipped), + ...list("Skipped tests and subtests", [...skipped, ...skippedSubtests]), "Full JSON events and compiler output are retained in the postgres-live-advisory artifact. Subtests are included there; counts above include each top-level test once.", "", ].join("\n"), diff --git a/.github/scripts/live-tests-summary.test.mjs b/.github/scripts/live-tests-summary.test.mjs index e9cea53d9..cd6d6a5a4 100644 --- a/.github/scripts/live-tests-summary.test.mjs +++ b/.github/scripts/live-tests-summary.test.mjs @@ -36,3 +36,14 @@ test("successful coverage is clean only when completed tests contain no skips", assert.equal(summarizeLiveTests(events({ Action: "pass", Package: "app", Test: "TestLiveOK" }), "success").needsAttention, false); assert.equal(summarizeLiveTests(events({ Action: "skip", Package: "app", Test: "TestLiveSkipped" }), "success").needsAttention, true); }); + +test("a skipped subtest is actionable even when its parent passes", () => { + const report = summarizeLiveTests(events( + { Action: "skip", Package: "app", Test: "TestLiveExample/needs-fixture" }, + { Action: "pass", Package: "app", Test: "TestLiveExample" }, + ), "success"); + assert.equal(report.needsAttention, true); + assert.match(report.markdown, /\| Passed \| 1 \|/); + assert.match(report.markdown, /\| Skipped \| 0 \|/); + assert.match(report.markdown, /`app\/TestLiveExample\/needs-fixture`/); +});