faf-taf-git 2.4.4 → 2.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [2.4.5] - 2026-11-02
14
+
15
+ node:test receipts count every test: a failing top-level test beside a `describe` is no longer dropped, and nested `describe`s are counted in full.
16
+
17
+ ### Fixed
18
+ - node:test JUnit reports (`--test-reporter=junit`) are counted by their `<testcase>`s. node counts a nested `describe` as one test in its parent, and puts top-level tests beside its suites, so a run with a `describe` was miscounted: a failing top-level test was dropped and the receipt said PASSED. Now counted when suites are nested, or when there are more testcases than the suites count. Other reports are read as before.
19
+
13
20
  ## [2.4.4] - 2026-11-01
14
21
 
15
22
  Receipts tell the truth about skips: a run where every test was skipped is recorded as SKIPPED, the badge counts only real passes, and each receipt says where it ran.
package/README.md CHANGED
@@ -73,7 +73,7 @@ jobs:
73
73
 
74
74
  - name: Print the receipt
75
75
  if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
76
- uses: Wolfe-Jam/faf-taf-git@v2.4.4
76
+ uses: Wolfe-Jam/faf-taf-git@v2.4.5
77
77
  with:
78
78
  test-output-file: test-output.txt
79
79
  target-branch: taf-receipts
@@ -13,7 +13,10 @@ import { TestResults } from './jest';
13
13
  * - a <testsuites> root that carries the totals (gotestsum, Maven)
14
14
  * - a <testsuites> root without totals, around counted <testsuite>s (pytest)
15
15
  * - a single <testsuite> root
16
- * - nested <testsuite>s (only the outermost level is counted, never twice)
16
+ * - nested <testsuite>s, or <testcase>s outside any suite: the <testcase>s are
17
+ * counted. Writers disagree on what an outer suite's `tests` means (node:test
18
+ * counts a nested describe as one test; PHPUnit counts every test inside it),
19
+ * and node:test puts top-level tests beside its suites, under the root
17
20
  * - suites with no counts at all (the <testcase> elements are counted instead)
18
21
  *
19
22
  * failures + errors count as failed; skipped + disabled count as skipped.
@@ -1 +1 @@
1
- {"version":3,"file":"junit.d.ts","sourceRoot":"","sources":["file:///Users/wolfejam/FAF/faf-taf-git/src/parsers/junit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAyCrC;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAuDnE"}
1
+ {"version":3,"file":"junit.d.ts","sourceRoot":"","sources":["file:///Users/wolfejam/FAF/faf-taf-git/src/parsers/junit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAyCrC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CA4DnE"}
@@ -47,7 +47,10 @@ function countsFromTestcases(xml) {
47
47
  * - a <testsuites> root that carries the totals (gotestsum, Maven)
48
48
  * - a <testsuites> root without totals, around counted <testsuite>s (pytest)
49
49
  * - a single <testsuite> root
50
- * - nested <testsuite>s (only the outermost level is counted, never twice)
50
+ * - nested <testsuite>s, or <testcase>s outside any suite: the <testcase>s are
51
+ * counted. Writers disagree on what an outer suite's `tests` means (node:test
52
+ * counts a nested describe as one test; PHPUnit counts every test inside it),
53
+ * and node:test puts top-level tests beside its suites, under the root
51
54
  * - suites with no counts at all (the <testcase> elements are counted instead)
52
55
  *
53
56
  * failures + errors count as failed; skipped + disabled count as skipped.
@@ -65,6 +68,7 @@ function parseJunitOutput(output) {
65
68
  let depth = 0;
66
69
  let summed = { tests: 0, failed: 0, skipped: 0 };
67
70
  let seen = 0;
71
+ let nested = false;
68
72
  let match;
69
73
  SUITE_TAG.lastIndex = 0;
70
74
  while ((match = SUITE_TAG.exec(xml)) !== null) {
@@ -73,6 +77,8 @@ function parseJunitOutput(output) {
73
77
  depth--;
74
78
  continue;
75
79
  }
80
+ if (depth > 0)
81
+ nested = true;
76
82
  if (depth === 0 && summed) {
77
83
  seen++;
78
84
  const suite = countsFromAttrs(attrs);
@@ -88,7 +94,10 @@ function parseJunitOutput(output) {
88
94
  if (!selfClosing)
89
95
  depth++;
90
96
  }
91
- counts = seen > 0 && summed ? summed : countsFromTestcases(xml);
97
+ const testcases = countsFromTestcases(xml);
98
+ // More testcases than the suites count means tests sit outside them.
99
+ const useSuites = seen > 0 && summed && (testcases.tests === 0 || (!nested && testcases.tests <= summed.tests));
100
+ counts = useSuites && summed ? summed : testcases;
92
101
  }
93
102
  if (counts.tests === 0)
94
103
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"junit.js","sourceRoot":"","sources":["../../src/parsers/junit.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAuDH,4CAuDC;AA1GD,MAAM,SAAS,GAAG,kCAAkC,CAAC;AAErD,0EAA0E;AAC1E,SAAS,IAAI,CAAC,KAAa,EAAE,IAAY;IACvC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,yBAAyB,CAAC,CAAC,CAAC;IAC3E,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAQD,iGAAiG;AACjG,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO;QACL,KAAK;QACL,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrE,OAAO,EA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AAC,CAAC,CAAC,QAAQ;KAChD,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "faf-taf-git",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "A Test Receipt Printer for git. Every CI run prints a receipt to .taf — append-only, timestamped, kept in git. Proof over time.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
package/project.faf CHANGED
@@ -29,8 +29,8 @@ human_context:
29
29
  what: "A Test Receipt Printer for git. Every CI run prints a receipt to .taf: append-only, timestamped, kept in git. Proof over time."
30
30
  why: Test results vanish when CI logs expire. Receipts stay in git, so anyone can look back and check whether main was green before a release.
31
31
  where: https://github.com/Wolfe-Jam/faf-taf-git
32
- when: v2.4.4 (2026-11-01), SKIPPED result + honest badge count + true trigger; v2.4.3 (2026-10-31) push-race retry + JUnit skipped count; v2.4.2 undici security fix + CLI-only npm package; v2.4.1 --version fix; v2.4.0 (2026-10-29) JUnit XML parser; live since v1.0.0 (2025-10-27)
33
- how: "Run tests, save the output (or a JUnit XML report), then `uses: Wolfe-Jam/faf-taf-git@v2.4.4` with `target-branch: taf-receipts`. Anywhere else: `npx faf-taf-git --file test-output.txt --commit`. The taf-receipts branch only grows: never rewrite it."
32
+ when: v2.4.5 (2026-11-02), node:test JUnit counted by testcase; v2.4.4 (2026-11-01) SKIPPED result + honest badge count + true trigger; v2.4.3 (2026-10-31) push-race retry + JUnit skipped count; v2.4.2 undici security fix + CLI-only npm package; v2.4.1 --version fix; v2.4.0 (2026-10-29) JUnit XML parser; live since v1.0.0 (2025-10-27)
33
+ how: "Run tests, save the output (or a JUnit XML report), then `uses: Wolfe-Jam/faf-taf-git@v2.4.5` with `target-branch: taf-receipts`. Anywhere else: `npx faf-taf-git --file test-output.txt --commit`. The taf-receipts branch only grows: never rewrite it."
34
34
  monorepo:
35
35
  packages_count: slotignored
36
36
  build_orchestrator: slotignored