Compare commits

...

106 commits

Author SHA1 Message Date
Jozef Izso
29672c52a8
Merge pull request #772 from dorny/codex/summary-output 2026-04-25 14:21:30 +02:00
Jozef Izso
373689ed6b
chore: rebuild dist folder 2026-04-25 14:20:38 +02:00
Jozef Izso
bd45c7a559
Refactor summary output to use a temporary file 2026-04-25 14:20:21 +02:00
Jozef Izso
49ad12d837
Add changelog for summary output 2026-04-25 14:03:52 +02:00
Jozef Izso
f610967bd1
Add generated summary action output 2026-04-25 14:03:52 +02:00
Jozef Izso
1ab1766274
Merge pull request #773 from dorny/codex/list-files-input 2026-04-25 13:34:59 +02:00
Jozef Izso
528bb1a4e4
Add changelog for list-files input 2026-04-25 13:31:01 +02:00
Jozef Izso
e05b863b43
Suppress empty list-files summary table 2026-04-25 13:17:09 +02:00
Jozef Izso
d7f15447e6
Tighten list-files report tests 2026-04-25 13:04:58 +02:00
Jozef Izso
0af87079d7
Merge pull request #771 from dorny/dependabot/npm_and_yarn/jest-junit-17.0.0 2026-04-25 12:13:48 +02:00
Jozef Izso
45c8d46681
Resolve list-files conflicts on current main 2026-04-25 12:13:19 +02:00
Felix Chapman
ba6f1d11e2
Correct README to indicate list-files is not automatically adjusted 2026-04-25 12:12:06 +02:00
Felix Chapman
a48134be3e
Add new parameter list-files for when there are multiple files in a report 2026-04-25 12:12:06 +02:00
dependabot[bot]
97ba6567fc
Bump jest-junit from 16.0.0 to 17.0.0
Bumps [jest-junit](https://github.com/jest-community/jest-junit) from 16.0.0 to 17.0.0.
- [Release notes](https://github.com/jest-community/jest-junit/releases)
- [Commits](https://github.com/jest-community/jest-junit/compare/v16.0.0...v17.0.0)

---
updated-dependencies:
- dependency-name: jest-junit
  dependency-version: 17.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-24 23:52:36 +00:00
Jozef Izso
093d99bd59
Merge pull request #770 from dorny/feature/update_packages 2026-04-24 14:18:31 +02:00
Jozef Izso
23735d3781
chore: rebuild dist for updated packages 2026-04-24 12:33:58 +02:00
Jozef Izso
67804e5bc2
Update development packages 2026-04-24 12:32:48 +02:00
Jozef Izso
a5b9b5c6e7
Update production packages 2026-04-24 11:58:19 +02:00
Jozef Izso
c36971571b
Merge pull request #763 from dorny/dependabot/npm_and_yarn/actions/github-9.1.0 2026-04-24 11:50:52 +02:00
Jozef Izso
724024e7cf
Merge pull request #769 from mfloryan-marshall/mfloryan-doc-patch-1 2026-04-22 00:34:39 +02:00
Marcin Floryan
0caa66d75c
doc: Updated GitHub actions to latest versions in example
The example of how to include the reporter in the CI/CD workflow used older versions of GitHub actions. This bumps the versions to the latest supported as of April 2026 so that people who copy these into their own pipelines use more up-to-date versions.
2026-04-21 12:14:35 +02:00
github-actions[bot]
fdce2624c0 chore: rebuild dist for Dependabot update 2026-04-08 23:53:15 +00:00
dependabot[bot]
ecf6e5c4c6
Bump @actions/github from 9.0.0 to 9.1.0
Bumps [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) from 9.0.0 to 9.1.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

---
updated-dependencies:
- dependency-name: "@actions/github"
  dependency-version: 9.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-08 23:52:49 +00:00
Jozef Izso
9c68bf6253
Merge pull request #761 from dorny/update_typescript 2026-04-05 20:14:50 +02:00
Jozef Izso
8ebd1f2035
Update Typescript to v6 2026-04-05 20:13:36 +02:00
Jozef Izso
195e976be5
Merge pull request #760 from dorny/update_packages 2026-04-05 20:04:33 +02:00
Jozef Izso
a88cf9b158
Update to latest packages 2026-04-05 18:52:35 +02:00
Jozef Izso
4a3df5aacc
Merge pull request #758 from dorny/dependabot/npm_and_yarn/types/picomatch-4.0.3 2026-04-04 11:31:04 +02:00
dependabot[bot]
db37d6d935
Bump @types/picomatch from 4.0.2 to 4.0.3
Bumps [@types/picomatch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/picomatch) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/picomatch)

---
updated-dependencies:
- dependency-name: "@types/picomatch"
  dependency-version: 4.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-03 23:52:40 +00:00
Jozef Izso
ab50174d2c
Merge pull request #752 from dorny/dependabot/npm_and_yarn/reports/jest/picomatch-2.3.2 2026-03-27 15:05:05 +01:00
Jozef Izso
ef55eb29a9
Merge pull request #751 from dorny/dependabot/npm_and_yarn/handlebars-4.7.9 2026-03-27 13:14:27 +01:00
dependabot[bot]
2d29da79de
Bump picomatch from 2.2.2 to 2.3.2 in /reports/jest
Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.2.2 to 2.3.2.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.2.2...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-27 12:14:17 +00:00
Jozef Izso
ce1640be7e
Merge pull request #749 from dorny/dependabot/npm_and_yarn/eslint-plugin-jest-29.15.1 2026-03-27 13:14:15 +01:00
Jozef Izso
08ceae2b23
Merge pull request #747 from dorny/dependabot/npm_and_yarn/picomatch-4.0.4 2026-03-27 13:14:06 +01:00
Jozef Izso
fcff37b0cc
Merge pull request #748 from dorny/dependabot/npm_and_yarn/typescript-eslint/parser-8.57.2 2026-03-27 13:13:22 +01:00
dependabot[bot]
63a06a304e
Bump handlebars from 4.7.8 to 4.7.9
Bumps [handlebars](https://github.com/handlebars-lang/handlebars.js) from 4.7.8 to 4.7.9.
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.9/release-notes.md)
- [Commits](https://github.com/handlebars-lang/handlebars.js/compare/v4.7.8...v4.7.9)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-version: 4.7.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-27 00:10:45 +00:00
dependabot[bot]
1e586914f0
Bump eslint-plugin-jest from 29.15.0 to 29.15.1
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 29.15.0 to 29.15.1.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v29.15.0...v29.15.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-version: 29.15.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-24 23:52:41 +00:00
github-actions[bot]
7b052bb685 chore: rebuild dist for Dependabot update 2026-03-24 00:09:31 +00:00
dependabot[bot]
18e03ad9cc
Bump @typescript-eslint/parser from 8.57.1 to 8.57.2
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.57.1 to 8.57.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.57.2/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.57.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-24 00:09:22 +00:00
dependabot[bot]
bae76033c4
Bump picomatch from 4.0.3 to 4.0.4
Bumps [picomatch](https://github.com/micromatch/picomatch) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/4.0.3...4.0.4)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-24 00:09:09 +00:00
Jozef Izso
2dcf091ad5
Merge pull request #746 from dorny/release/v3.0.0
`test-reporter` release v3.0.0
2026-03-21 14:46:12 +01:00
Jozef Izso
a43b3a5f73
test-reporter release v3.0.0 2026-03-21 14:22:41 +01:00
Jozef Izso
79216dc71a
Merge pull request #744 from dorny/dependabot/npm_and_yarn/flatted-3.4.2
Bump flatted from 3.4.1 to 3.4.2
2026-03-21 14:22:31 +01:00
Jozef Izso
62c3873e1e
Merge pull request #745 from dorny/feature/workflow_permissions
Explicitly use lowest permissions required to run workflow
2026-03-21 14:19:52 +01:00
Jozef Izso
bd74ca6c12
Explicitly use lowest permissions required to run workflow 2026-03-21 14:14:22 +01:00
Jozef Izso
0c2b2aa1e0
Merge pull request #738 from dav-tb/feature/node24-runtime
Upgrade action runtime to Node.js 24
2026-03-21 13:22:42 +01:00
Jozef Izso
f7eee307f2
Use the @types/node definitions for NodeJS 24 runtime 2026-03-21 13:09:20 +01:00
David Lemieux
ad0a96f767
Upgrade action runtime to Node.js 24
GitHub Actions is deprecating the Node 20 runtime, with Node 24
becoming the default in June 2026. This updates the action to run
on the node24 runtime.

- action.yml: change `using` from node20 to node24
- .nvmrc: update development version to v24
- package.json: update engines to >=24

Closes #680
2026-03-21 13:09:20 +01:00
Jozef Izso
543415ce39
Merge pull request #741 from dorny/release/v2.7.0
`test-reporter` release v2.7.0
2026-03-21 13:00:09 +01:00
dependabot[bot]
f1284d056a
Bump flatted from 3.4.1 to 3.4.2
Bumps [flatted](https://github.com/WebReflection/flatted) from 3.4.1 to 3.4.2.
- [Commits](https://github.com/WebReflection/flatted/compare/v3.4.1...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-21 12:00:02 +00:00
Jozef Izso
3c1b53fe19
Merge pull request #743 from dorny/dependabot/npm_and_yarn/types/adm-zip-0.5.8
Bump @types/adm-zip from 0.5.7 to 0.5.8
2026-03-21 12:59:30 +01:00
Jozef Izso
dc9521099d
Merge pull request #742 from dorny/dependabot/npm_and_yarn/typescript-eslint/parser-8.57.1
Bump @typescript-eslint/parser from 8.57.0 to 8.57.1
2026-03-21 12:58:59 +01:00
dependabot[bot]
38e11d6bf5
Bump @types/adm-zip from 0.5.7 to 0.5.8
Bumps [@types/adm-zip](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/adm-zip) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/adm-zip)

---
updated-dependencies:
- dependency-name: "@types/adm-zip"
  dependency-version: 0.5.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-16 23:52:58 +00:00
dependabot[bot]
9489e055fc
Bump @typescript-eslint/parser from 8.57.0 to 8.57.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.57.0 to 8.57.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.57.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.57.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-16 23:52:51 +00:00
Jozef Izso
df62474295
test-reporter release v2.7.0 2026-03-16 14:36:58 +01:00
Jozef Izso
24ade537c8
Add the missing collapsed input parameter documentation to README 2026-03-16 14:36:58 +01:00
Jozef Izso
574d6b100c
Merge pull request #739 from dorny/bugfix/update_flatted_package 2026-03-16 14:29:45 +01:00
Jozef Izso
ce9f9c4738
Update flatted package to v3.4.1 to fix a vulnerability
flatted  <3.4.0
Severity: high
flatted vulnerable to unbounded recursion DoS in parse() revive phase - https://github.com/advisories/GHSA-25h7-pfq9-p65f
2026-03-16 14:23:22 +01:00
Jozef Izso
0d9f24e0e1
Merge pull request #155 from johnbartholomew/feat-report-test-suite-errors 2026-03-15 13:32:26 +01:00
Jozef Izso
5e233102fe
Rebuild the dist/index.js file 2026-03-15 13:24:40 +01:00
Jozef Izso
f8ae4deee6
Report jest-junit testsuite errors as failures
Test errors are different (represented differently in the JUnit XML
output from jest-junit) to test _failures_. Failures are tests
which ran and failed, errors are for tests/test suites which
did not even run because the test code itself didn't build
or didn't execute correctly.

jest-junit has an option to enable reporting of test suite errors,
but test-reporter then interprets these as successful tests.
2026-03-15 13:24:18 +01:00
Jozef Izso
540c28072b
Merge pull request #731 from dt-thomas-durand/feat/slug-prefix 2026-03-15 12:49:16 +01:00
Jozef Izso
a03559fc1d
Merge pull request #736 from dorny/dependabot/npm_and_yarn/undici-6.24.1 2026-03-15 12:09:03 +01:00
Jozef Izso
eff5ed2ea7
Merge pull request #734 from dorny/dependabot/npm_and_yarn/jest-30.3.0 2026-03-15 12:08:34 +01:00
github-actions[bot]
a0ec52b6d3 chore: rebuild dist for Dependabot update 2026-03-14 08:44:26 +00:00
dependabot[bot]
d36ac2431e
Bump undici from 6.23.0 to 6.24.1
Bumps [undici](https://github.com/nodejs/undici) from 6.23.0 to 6.24.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.23.0...v6.24.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.24.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 08:44:03 +00:00
dependabot[bot]
ff5a70913c
Bump jest from 30.2.0 to 30.3.0
Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 30.2.0 to 30.3.0.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.3.0/packages/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-version: 30.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 23:52:57 +00:00
Jozef Izso
3b635e8e7b
Merge pull request #733 from dorny/dependabot/npm_and_yarn/typescript-eslint/parser-8.57.0
Bump @typescript-eslint/parser from 8.56.1 to 8.57.0
2026-03-10 17:20:05 +01:00
dependabot[bot]
a1dabb90f7
Bump @typescript-eslint/parser from 8.56.1 to 8.57.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.56.1 to 8.57.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.57.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.57.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 16:18:14 +00:00
Jozef Izso
e8df218184
Merge pull request #732 from dorny/dependabot/npm_and_yarn/eslint-9.39.4
Bump eslint from 9.39.3 to 9.39.4
2026-03-10 17:16:15 +01:00
dependabot[bot]
1908acedff
Bump eslint from 9.39.3 to 9.39.4
Bumps [eslint](https://github.com/eslint/eslint) from 9.39.3 to 9.39.4.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v9.39.3...v9.39.4)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 9.39.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-06 23:52:39 +00:00
Thomas Durand
08dfe2715b
feat: removing parameter, generating slug prefix and providing it as an output 2026-03-05 15:20:31 +01:00
Thomas Durand
7f0723a953
feat: added a slug-prefix parameter for link anchors
Motivation: when using a matrix job, or more than one kind of tests in a same workflow, we can end up with multiple summaries at the same time. This will lead to multiple anchors and html id that will no longer be unique.
This prefix option allow to disambiguate those anchors ; and keep them functional.
2026-03-05 01:52:45 +01:00
Jozef Izso
3d76b34a45
Merge pull request #730 from dorny/feature/166-list-all-artifacts 2026-03-03 11:52:29 +01:00
Jozef Izso
a71adbe2c2
Update changelog 2026-03-03 11:51:28 +01:00
Jozef Izso
34ed02cb57
Merge pull request #728 from dorny/dependabot/npm_and_yarn/ts-jest-29.4.6 2026-03-03 11:47:50 +01:00
dependabot[bot]
5204d859d8
Bump ts-jest from 29.4.5 to 29.4.6
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.4.5 to 29.4.6.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.5...v29.4.6)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-version: 29.4.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 00:54:12 +00:00
Jozef Izso
6658c27b23
Merge pull request #727 from dorny/feature/fix_vulnerabilities 2026-03-02 17:37:40 +01:00
Jozef Izso
9b467721fc
Use npm audit fix to update sub dependencies
brace-expansion  1.0.0 - 1.1.11 || 2.0.0 - 2.0.1
brace-expansion Regular Expression Denial of Service vulnerability - https://github.com/advisories/GHSA-v6h2-p8h4-qcjw
brace-expansion Regular Expression Denial of Service vulnerability - https://github.com/advisories/GHSA-v6h2-p8h4-qcjw
fix available via `npm audit fix`
node_modules/brace-expansion
node_modules/eol-converter-cli/node_modules/brace-expansion

glob  10.2.0 - 10.4.5
Severity: high
glob CLI: Command injection via -c/--cmd executes matches with shell:true - https://github.com/advisories/GHSA-5j98-mcp5-4vw2
fix available via `npm audit fix`
node_modules/@jest/reporters/node_modules/glob
node_modules/jest-config/node_modules/glob
node_modules/jest-runtime/node_modules/glob

js-yaml  <3.14.2
Severity: moderate
js-yaml has prototype pollution in merge (<<) - https://github.com/advisories/GHSA-mh29-5h37-fv8m
fix available via `npm audit fix`
node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml

3 vulnerabilities (1 low, 1 moderate, 1 high)
2026-03-02 17:35:55 +01:00
Jozef Izso
b3a9df8841
Merge pull request #629 from dorny/feature/601_eslint_v9 2026-03-02 17:18:04 +01:00
Jozef Izso
deb1d0223f
Rebuild the dist/index.js file 2026-03-02 17:16:36 +01:00
Jozef Izso
69312b98d1
Update changelog 2026-03-02 17:16:36 +01:00
Jozef Izso
eed2d2d031
Modernize ESLint configuration 2026-03-02 17:15:02 +01:00
Jozef Izso
393efa337c
Use correct Jest config filename 2026-03-02 16:54:09 +01:00
Jozef Izso
d788b88f54
Use jest with eslint 2026-03-02 16:54:09 +01:00
Jozef Izso
ba26a20f41
Migrate eslint config to eslint.config.js format 2026-03-02 16:54:09 +01:00
Jozef Izso
a02df32035
Upgrade to eslint v9 2026-03-02 16:54:09 +01:00
Jozef Izso
66787f5fcb
Merge pull request #718 from dorny/dependabot/npm_and_yarn/actions/github-9.0.0 2026-03-02 15:53:48 +01:00
Jozef Izso
7449990f9a
chore: rebuild dist for Dependabot update 2026-03-02 15:44:51 +01:00
Jozef Izso
66bccdca48
Refactor code for changes in @actions/github v9 2026-03-02 15:44:41 +01:00
dependabot[bot]
419ef42f63
Bump @actions/github from 6.0.1 to 9.0.0
Bumps [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) from 6.0.1 to 9.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

---
updated-dependencies:
- dependency-name: "@actions/github"
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 14:24:21 +00:00
Jozef Izso
5f43297c5b
Merge pull request #720 from dorny/dependabot/npm_and_yarn/actions/exec-3.0.0 2026-03-02 15:23:27 +01:00
github-actions[bot]
9ef00442fe chore: rebuild dist for Dependabot update 2026-03-02 14:22:54 +00:00
dependabot[bot]
39ba11e220
Bump @actions/exec from 1.1.1 to 3.0.0
Bumps [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) from 1.1.1 to 3.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/exec)

---
updated-dependencies:
- dependency-name: "@actions/exec"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 14:22:26 +00:00
Jozef Izso
3f45bf48ef
Merge pull request #719 from dorny/dependabot/npm_and_yarn/actions/core-3.0.0 2026-03-02 15:21:32 +01:00
github-actions[bot]
7ea9b8d50e chore: rebuild dist for Dependabot update 2026-03-02 14:14:20 +00:00
dependabot[bot]
b5fe11b925
Bump @actions/core from 1.11.1 to 3.0.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.11.1 to 3.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 14:13:39 +00:00
Jozef Izso
4892461a65
Merge pull request #726 from dorny/feature/dependabot_workflow 2026-03-02 15:12:24 +01:00
Jozef Izso
ccbe2002c5
Create workflow to rebuild the dist/index.js when Dependabot updates dependencies 2026-03-02 14:54:18 +01:00
Jozef Izso
0a09b8be91
Merge pull request #725 from dorny/feature/603-migration-to-esm-modules 2026-03-02 14:36:34 +01:00
Jozef Izso
5066e4a662
Rebuild the dist/index.js file 2026-03-02 14:30:38 +01:00
Jozef Izso
4d6f6ca5f4
Refactor tests to modedules based package 2026-03-02 14:29:31 +01:00
Jozef Izso
ef1f9a4e60
Refactor test-reporter to module based package 2026-03-02 14:28:52 +01:00
Jozef Izso
02510bde1f
Use TypeScript config for NodeJS 20 2026-03-02 14:25:51 +01:00
Jozef Izso
c541b3cc38
Merge pull request #724 from dorny/tests/improveWorkflowRun
Add test for new resolution of associated check run commits
2026-03-02 13:44:02 +01:00
Jozef Izso
7ede0263a4
Merge pull request #673 from azchohfi/improveWorkflowRun 2026-03-02 13:28:11 +01:00
64 changed files with 52903 additions and 47078 deletions

View file

@ -1,4 +0,0 @@
dist/
lib/
node_modules/
jest.config.js

View file

@ -1,68 +0,0 @@
{
"plugins": ["import", "jest", "@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"import/no-named-as-default": "off",
"no-shadow": "off",
"no-unused-vars": "off",
"prefer-template": "off",
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
}
}
}
}

View file

@ -16,6 +16,9 @@ on:
- '**.md' - '**.md'
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
check-dist: check-dist:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -8,6 +8,9 @@ on:
- main - main
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
build-test: build-test:
name: Build & Test name: Build & Test

View file

@ -0,0 +1,50 @@
name: Rebuild dist for Dependabot
on:
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- '**.md'
permissions:
contents: write
jobs:
rebuild-dist:
if: ${{ github.actor == 'dependabot[bot]' && github.event.pull_request.user.login == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Dependabot PR branch
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Rebuild dist artifacts
run: |
npm run build
npm run package
- name: Commit updated dist artifacts
run: |
if git diff --quiet -- dist/; then
echo "No dist changes to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add dist/
git commit -m "chore: rebuild dist for Dependabot update"
git push

View file

@ -3,6 +3,9 @@ name: Manual run
on: on:
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
check-dist: check-dist:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -6,6 +6,10 @@ on:
types: types:
- completed - completed
permissions:
contents: read
actions: read
jobs: jobs:
report: report:
name: Workflow test name: Workflow test

2
.nvmrc
View file

@ -1 +1 @@
v20 v24

View file

@ -1,7 +1,21 @@
# Changelog # Changelog
## 3.1.0
* Feature: Add `list-files` input to control test report file listing https://github.com/dorny/test-reporter/pull/773
* Feature: Add `summary_file` output with the path to the generated summary in Markdown format https://github.com/dorny/test-reporter/pull/772
## 3.0.0
* Feature: Use NodeJS 24 LTS as default runtime https://github.com/dorny/test-reporter/pull/738
## 2.7.0
* Feature: Add `slug-prefix` output for link anchors https://github.com/dorny/test-reporter/pull/731
* Feature: Report `jest-junit` testsuite errors as failures https://github.com/dorny/test-reporter/pull/155
* Security: Update dependencies to fix reported security vulnerabilities
## 2.6.0 ## 2.6.0
* Fix: For `workflow_run` events, resolve the commit of the check run from related pull request head commits first (matching `workflow_run.head_branch`, then first PR), and fall back to `workflow_run.head_sha` for non-PR runs https://github.com/dorny/test-reporter/pull/673 * Fix: For `workflow_run` events, resolve the commit of the check run from related pull request head commits first (matching `workflow_run.head_branch`, then first PR), and fall back to `workflow_run.head_sha` for non-PR runs https://github.com/dorny/test-reporter/pull/673
* Change: The `test-reporter` action will listed all artifacts associated with the build run https://github.com/dorny/test-reporter/pull/693
* Maintenance: Upgrade to ESLint v9 https://github.com/dorny/test-reporter/pull/629
## 2.5.0 ## 2.5.0
* Feature: Add Nette Tester support with `tester-junit` reporter https://github.com/dorny/test-reporter/pull/707 * Feature: Add Nette Tester support with `tester-junit` reporter https://github.com/dorny/test-reporter/pull/707

View file

@ -47,12 +47,12 @@ jobs:
name: Build & Test name: Build & Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 # checkout the repo - uses: actions/checkout@v6 # checkout the repo
- run: npm ci # install packages - run: npm ci # install packages
- run: npm test # run tests (configured to use jest-junit reporter) - run: npm test # run tests (configured to use jest-junit reporter)
- name: Test Report - name: Test Report
uses: dorny/test-reporter@v2 uses: dorny/test-reporter@v3
if: ${{ !cancelled() }} # run this step even if previous step failed if: ${{ !cancelled() }} # run this step even if previous step failed
with: with:
name: JEST Tests # Name of the check run which will be created name: JEST Tests # Name of the check run which will be created
@ -78,10 +78,10 @@ jobs:
build-test: build-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 # checkout the repo - uses: actions/checkout@v6 # checkout the repo
- run: npm ci # install packages - run: npm ci # install packages
- run: npm test # run tests (configured to use jest-junit reporter) - run: npm test # run tests (configured to use jest-junit reporter)
- uses: actions/upload-artifact@v4 # upload test results - uses: actions/upload-artifact@v7 # upload test results
if: ${{ !cancelled() }} # run this step even if previous step failed if: ${{ !cancelled() }} # run this step even if previous step failed
with: with:
name: test-results name: test-results
@ -103,7 +103,7 @@ jobs:
report: report:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: dorny/test-reporter@v2 - uses: dorny/test-reporter@v3
with: with:
artifact: test-results # artifact name artifact: test-results # artifact name
name: JEST Tests # Name of the check run which will be created name: JEST Tests # Name of the check run which will be created
@ -114,7 +114,7 @@ jobs:
## Usage ## Usage
```yaml ```yaml
- uses: dorny/test-reporter@v2 - uses: dorny/test-reporter@v3
with: with:
# Name or regex of artifact containing test results # Name or regex of artifact containing test results
@ -184,6 +184,12 @@ jobs:
# none # none
list-tests: 'all' list-tests: 'all'
# Limits which test result files are listed:
# all
# failed
# none
list-files: 'all'
# Limits number of created annotations with error message and stack trace captured during test execution. # Limits number of created annotations with error message and stack trace captured during test execution.
# Must be less or equal to 50. # Must be less or equal to 50.
max-annotations: '10' max-annotations: '10'
@ -194,6 +200,13 @@ jobs:
# Set this action as failed if no test results were found # Set this action as failed if no test results were found
fail-on-empty: 'true' fail-on-empty: 'true'
# Controls whether test report details are collapsed or expanded.
# Supported options:
# auto: Collapse only if all tests pass (default behavior)
# always: Always collapse the report details
# never: Always expand the report details
collapsed: 'auto'
# Relative path under $GITHUB_WORKSPACE where the repository was checked out. # Relative path under $GITHUB_WORKSPACE where the repository was checked out.
working-directory: '' working-directory: ''
@ -212,6 +225,8 @@ jobs:
| time | Test execution time [ms] | | time | Test execution time [ms] |
| url | Check run URL | | url | Check run URL |
| url_html | Check run URL HTML | | url_html | Check run URL HTML |
| summary_file | Path to a file containing the generated test report summary in Markdown format |
| slug_prefix| Random anchor links slug prefix generated for the summary headers |
## Supported formats ## Supported formats

View file

@ -0,0 +1,22 @@
![Tests failed](https://img.shields.io/badge/tests-2%20failed-critical)
|Report|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[fixtures/test-errors/jest/jest-test-results.xml](#user-content-r0)||2 ❌||646ms|
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/test-errors/jest/jest-test-results.xml</a>
**2** tests were completed in **646ms** with **0** passed, **2** failed and **0** skipped.
|Test suite|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[libs/bar.spec.ts](#user-content-r0s0)||1 ❌||0ms|
|[libs/foo.spec.ts](#user-content-r0s1)||1 ❌||0ms|
### ❌ <a id="user-content-r0s0" href="#user-content-r0s0">libs/bar.spec.ts</a>
```
Test suite failed to run
❌ libs/bar.spec.ts
● Test suite failed to run
```
### ❌ <a id="user-content-r0s1" href="#user-content-r0s1">libs/foo.spec.ts</a>
```
Test suite failed to run
❌ libs/foo.spec.ts
● Test suite failed to run
```

View file

@ -1,5 +1,68 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`jest-junit tests jest testsuite errors example test results matches snapshot 1`] = `
TestRunResult {
"path": "fixtures/test-errors/jest/jest-test-results.xml",
"suites": [
TestSuiteResult {
"groups": [
TestGroupResult {
"name": "Test suite failed to run",
"tests": [
TestCaseResult {
"error": {
"details": " ● Test suite failed to run
tsconfig.json:13:3 - error TS6258: 'typeRoots' should be set inside the 'compilerOptions' object of the config json file
13 "typeRoots": ["./src/lib/types", "./node_modules/@types"],
~~~~~~~~~~~
",
"line": undefined,
"path": undefined,
},
"name": "libs/foo.spec.ts",
"result": "failed",
"time": 0,
},
],
},
],
"name": "libs/foo.spec.ts",
"totalTime": 0,
},
TestSuiteResult {
"groups": [
TestGroupResult {
"name": "Test suite failed to run",
"tests": [
TestCaseResult {
"error": {
"details": " ● Test suite failed to run
tsconfig.json:13:3 - error TS6258: 'typeRoots' should be set inside the 'compilerOptions' object of the config json file
13 "typeRoots": ["./src/lib/types", "./node_modules/@types"],
~~~~~~~~~~~
",
"line": undefined,
"path": undefined,
},
"name": "libs/bar.spec.ts",
"result": "failed",
"time": 0,
},
],
},
],
"name": "libs/bar.spec.ts",
"totalTime": 0,
},
],
"totalTime": 646,
}
`;
exports[`jest-junit tests parsing ESLint report without timing information works - PR #134 1`] = ` exports[`jest-junit tests parsing ESLint report without timing information works - PR #134 1`] = `
TestRunResult { TestRunResult {
"path": "fixtures/jest-junit-eslint.xml", "path": "fixtures/jest-junit-eslint.xml",

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {DartJsonParser} from '../src/parsers/dart-json/dart-json-parser' import {DartJsonParser} from '../src/parsers/dart-json/dart-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('dart-json tests', () => { describe('dart-json tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {DotnetNunitParser} from '../src/parsers/dotnet-nunit/dotnet-nunit-parser' import {DotnetNunitParser} from '../src/parsers/dotnet-nunit/dotnet-nunit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('dotnet-nunit tests', () => { describe('dotnet-nunit tests', () => {
it('report from ./reports/dotnet test results matches snapshot', async () => { it('report from ./reports/dotnet test results matches snapshot', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {DotnetTrxParser} from '../src/parsers/dotnet-trx/dotnet-trx-parser' import {DotnetTrxParser} from '../src/parsers/dotnet-trx/dotnet-trx-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport, ReportOptions} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport, ReportOptions} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('dotnet-trx tests', () => { describe('dotnet-trx tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -0,0 +1,3 @@
libs/bar.spec.ts
libs/foo.spec.ts
tsconfig.json

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="jest tests" tests="0" failures="0" errors="2" time="0.646">
<testsuite name="libs/foo.spec.ts" errors="1" failures="0" skipped="0" timestamp="1970-01-01T00:00:00" time="0" tests="0">
<testcase classname="Test suite failed to run" name="libs/foo.spec.ts" time="0">
<error> ● Test suite failed to run
tsconfig.json:13:3 - error TS6258: &apos;typeRoots&apos; should be set inside the &apos;compilerOptions&apos; object of the config json file
13 &quot;typeRoots&quot;: [&quot;./src/lib/types&quot;, &quot;./node_modules/@types&quot;],
~~~~~~~~~~~
</error>
</testcase>
</testsuite>
<testsuite name="libs/bar.spec.ts" errors="1" failures="0" skipped="0" timestamp="1970-01-01T00:00:00" time="0" tests="0">
<testcase classname="Test suite failed to run" name="libs/bar.spec.ts" time="0">
<error> ● Test suite failed to run
tsconfig.json:13:3 - error TS6258: &apos;typeRoots&apos; should be set inside the &apos;compilerOptions&apos; object of the config json file
13 &quot;typeRoots&quot;: [&quot;./src/lib/types&quot;, &quot;./node_modules/@types&quot;],
~~~~~~~~~~~
</error>
</testcase>
</testsuite>
</testsuites>

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {GolangJsonParser} from '../src/parsers/golang-json/golang-json-parser' import {GolangJsonParser} from '../src/parsers/golang-json/golang-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {getReport} from '../src/report/get-report' import {getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('golang-json tests', () => { describe('golang-json tests', () => {
it('report from ./reports/dotnet test results matches snapshot', async () => { it('report from ./reports/dotnet test results matches snapshot', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {JavaJunitParser} from '../src/parsers/java-junit/java-junit-parser' import {JavaJunitParser} from '../src/parsers/java-junit/java-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('java-junit tests', () => { describe('java-junit tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,4 +1,4 @@
import {parseStackTraceElement} from '../src/parsers/java-junit/java-stack-trace-element-parser' import {parseStackTraceElement} from '../src/parsers/java-junit/java-stack-trace-element-parser.js'
describe('parseStackTraceLine tests', () => { describe('parseStackTraceLine tests', () => {
it('empty line is not parsed', async () => { it('empty line is not parsed', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {JestJunitParser} from '../src/parsers/jest-junit/jest-junit-parser' import {JestJunitParser} from '../src/parsers/jest-junit/jest-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('jest-junit tests', () => { describe('jest-junit tests', () => {
it('produces empty test run result when there are no test cases in the testsuites element', async () => { it('produces empty test run result when there are no test cases in the testsuites element', async () => {
@ -346,4 +351,27 @@ describe('jest-junit tests', () => {
// Report should have the title as the first line // Report should have the title as the first line
expect(report).toMatch(/^# My Custom Title\n## 1 passed, 4 failed and 1 skipped\n/) expect(report).toMatch(/^# My Custom Title\n## 1 passed, 4 failed and 1 skipped\n/)
}) })
it('jest testsuite errors example test results matches snapshot', async () => {
const fixturePath = path.join(__dirname, 'fixtures', 'test-errors', 'jest', 'jest-test-results.xml')
const trackedFilesPath = path.join(__dirname, 'fixtures', 'test-errors', 'jest', 'files.txt')
const outputPath = path.join(__dirname, '__outputs__', 'jest-test-errors-results.md')
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
const trackedFiles = fs.readFileSync(trackedFilesPath, {encoding: 'utf8'}).split(/\n\r?/g)
const opts: ParseOptions = {
parseErrors: true,
trackedFiles
//workDir: '/home/dorny/dorny/jest/'
}
const parser = new JestJunitParser(opts)
const result = await parser.parse(filePath, fileContent)
expect(result).toMatchSnapshot()
const report = getReport([result])
fs.mkdirSync(path.dirname(outputPath), {recursive: true})
fs.writeFileSync(outputPath, report)
})
}) })

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {MochaJsonParser} from '../src/parsers/mocha-json/mocha-json-parser' import {MochaJsonParser} from '../src/parsers/mocha-json/mocha-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('mocha-json tests', () => { describe('mocha-json tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {PhpunitJunitParser} from '../src/parsers/phpunit-junit/phpunit-junit-parser' import {PhpunitJunitParser} from '../src/parsers/phpunit-junit/phpunit-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {getReport} from '../src/report/get-report' import {getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('phpunit-junit tests', () => { describe('phpunit-junit tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {PythonXunitParser} from '../src/parsers/python-xunit/python-xunit-parser' import {PythonXunitParser} from '../src/parsers/python-xunit/python-xunit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const defaultOpts: ParseOptions = { const defaultOpts: ParseOptions = {
parseErrors: true, parseErrors: true,

View file

@ -1,4 +1,5 @@
import {getBadge, DEFAULT_OPTIONS, ReportOptions} from '../../src/report/get-report' import {DEFAULT_OPTIONS, getBadge, getReport, ReportOptions} from '../../src/report/get-report.js'
import {TestCaseResult, TestGroupResult, TestRunResult, TestSuiteResult} from '../../src/test-results.js'
describe('getBadge', () => { describe('getBadge', () => {
describe('URI encoding with special characters', () => { describe('URI encoding with special characters', () => {
@ -8,7 +9,9 @@ describe('getBadge', () => {
badgeTitle: 'tests' badgeTitle: 'tests'
} }
const badge = getBadge(5, 0, 1, options) const badge = getBadge(5, 0, 1, options)
expect(badge).toBe('![Tests passed successfully](https://img.shields.io/badge/tests-5%20passed%2C%201%20skipped-success)') expect(badge).toBe(
'![Tests passed successfully](https://img.shields.io/badge/tests-5%20passed%2C%201%20skipped-success)'
)
}) })
it('handles badge title with single hyphen', () => { it('handles badge title with single hyphen', () => {
@ -28,7 +31,9 @@ describe('getBadge', () => {
} }
const badge = getBadge(10, 0, 0, options) const badge = getBadge(10, 0, 0, options)
// All hyphens in the title should be encoded as -- // All hyphens in the title should be encoded as --
expect(badge).toBe('![Tests passed successfully](https://img.shields.io/badge/integration--api--tests-10%20passed-success)') expect(badge).toBe(
'![Tests passed successfully](https://img.shields.io/badge/integration--api--tests-10%20passed-success)'
)
}) })
it('handles badge title with multiple underscores', () => { it('handles badge title with multiple underscores', () => {
@ -38,7 +43,9 @@ describe('getBadge', () => {
} }
const badge = getBadge(10, 0, 0, options) const badge = getBadge(10, 0, 0, options)
// All underscores in the title should be encoded as __ // All underscores in the title should be encoded as __
expect(badge).toBe('![Tests passed successfully](https://img.shields.io/badge/my__integration__test-10%20passed-success)') expect(badge).toBe(
'![Tests passed successfully](https://img.shields.io/badge/my__integration__test-10%20passed-success)'
)
}) })
it('handles badge title with version format containing hyphen', () => { it('handles badge title with version format containing hyphen', () => {
@ -48,7 +55,9 @@ describe('getBadge', () => {
} }
const badge = getBadge(1, 0, 0, options) const badge = getBadge(1, 0, 0, options)
// The hyphen in "12.0-ubi" should be encoded as -- // The hyphen in "12.0-ubi" should be encoded as --
expect(badge).toBe('![Tests passed successfully](https://img.shields.io/badge/MariaDb%2012.0--ubi%20database%20tests-1%20passed-success)') expect(badge).toBe(
'![Tests passed successfully](https://img.shields.io/badge/MariaDb%2012.0--ubi%20database%20tests-1%20passed-success)'
)
}) })
it('handles badge title with dots and hyphens', () => { it('handles badge title with dots and hyphens', () => {
@ -57,7 +66,9 @@ describe('getBadge', () => {
badgeTitle: 'v1.2.3-beta-test' badgeTitle: 'v1.2.3-beta-test'
} }
const badge = getBadge(4, 1, 0, options) const badge = getBadge(4, 1, 0, options)
expect(badge).toBe('![Tests failed](https://img.shields.io/badge/v1.2.3--beta--test-4%20passed%2C%201%20failed-critical)') expect(badge).toBe(
'![Tests failed](https://img.shields.io/badge/v1.2.3--beta--test-4%20passed%2C%201%20failed-critical)'
)
}) })
it('preserves structural hyphens between label and message', () => { it('preserves structural hyphens between label and message', () => {
@ -67,7 +78,9 @@ describe('getBadge', () => {
} }
const badge = getBadge(2, 3, 1, options) const badge = getBadge(2, 3, 1, options)
// The URI should have literal hyphens separating title-message-color // The URI should have literal hyphens separating title-message-color
expect(badge).toBe('![Tests failed](https://img.shields.io/badge/test--suite-2%20passed%2C%203%20failed%2C%201%20skipped-critical)') expect(badge).toBe(
'![Tests failed](https://img.shields.io/badge/test--suite-2%20passed%2C%203%20failed%2C%201%20skipped-critical)'
)
}) })
}) })
@ -107,7 +120,9 @@ describe('getBadge', () => {
it('includes passed, failed and skipped counts', () => { it('includes passed, failed and skipped counts', () => {
const options: ReportOptions = {...DEFAULT_OPTIONS} const options: ReportOptions = {...DEFAULT_OPTIONS}
const badge = getBadge(5, 2, 1, options) const badge = getBadge(5, 2, 1, options)
expect(badge).toBe('![Tests failed](https://img.shields.io/badge/tests-5%20passed%2C%202%20failed%2C%201%20skipped-critical)') expect(badge).toBe(
'![Tests failed](https://img.shields.io/badge/tests-5%20passed%2C%202%20failed%2C%201%20skipped-critical)'
)
}) })
it('uses "none" message when no tests', () => { it('uses "none" message when no tests', () => {
@ -118,3 +133,146 @@ describe('getBadge', () => {
}) })
}) })
describe('getReport', () => {
// Helper function to create test results
function createTestResult(path: string, passed: number, failed: number, skipped: number): TestRunResult {
const tests: TestCaseResult[] = []
for (let i = 0; i < passed; i++) {
tests.push(new TestCaseResult(`passed-test-${i}`, 'success', 100))
}
for (let i = 0; i < failed; i++) {
tests.push(
new TestCaseResult(`failed-test-${i}`, 'failed', 100, {
details: 'Test failed',
message: 'Assertion error'
})
)
}
for (let i = 0; i < skipped; i++) {
tests.push(new TestCaseResult(`skipped-test-${i}`, 'skipped', 0))
}
const group = new TestGroupResult('test-group', tests)
const suite = new TestSuiteResult('test-suite', [group])
return new TestRunResult(path, [suite])
}
describe('list-files parameter', () => {
const results = [
createTestResult('passing-file.spec.ts', 5, 0, 0),
createTestResult('failing-file.spec.ts', 3, 2, 1),
createTestResult('passing-with-skipped-file.spec.ts', 8, 0, 2)
]
it('shows all files when list-files is "all"', () => {
const report = getReport(results, {
...DEFAULT_OPTIONS,
listFiles: 'all',
listSuites: 'none',
listTests: 'none'
})
expect(report).toContain('|Report|Passed|Failed|Skipped|Time|')
expect(report).toContain('passing-file.spec.ts')
expect(report).toContain('failing-file.spec.ts')
expect(report).toContain('passing-with-skipped-file.spec.ts')
})
it('shows only failed files when list-files is "failed"', () => {
const report = getReport(results, {
...DEFAULT_OPTIONS,
listFiles: 'failed',
listSuites: 'none',
listTests: 'none'
})
expect(report).toContain('|Report|Passed|Failed|Skipped|Time|')
expect(report).not.toContain('passing-file.spec.ts')
expect(report).toContain('failing-file.spec.ts')
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
})
it('shows no file details when list-files is "none"', () => {
const report = getReport(results, {
...DEFAULT_OPTIONS,
listFiles: 'none',
listSuites: 'none',
listTests: 'none'
})
expect(report).toContain('![')
expect(report).not.toContain('|Report|Passed|Failed|Skipped|Time|')
expect(report).not.toContain('passing-file.spec.ts')
expect(report).not.toContain('failing-file.spec.ts')
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
})
it('does not show an empty summary table when list-files is "none" and only-summary is enabled', () => {
const report = getReport(results, {
...DEFAULT_OPTIONS,
listFiles: 'none',
listSuites: 'all',
onlySummary: true,
listTests: 'none'
})
expect(report).toContain('![')
expect(report).not.toContain('|Report|Passed|Failed|Skipped|Time|')
expect(report).not.toContain('passing-file.spec.ts')
expect(report).not.toContain('failing-file.spec.ts')
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
})
it('works correctly with list-suites and list-tests when list-files is "failed"', () => {
const report = getReport(results, {
...DEFAULT_OPTIONS,
listFiles: 'failed',
listSuites: 'all',
listTests: 'all'
})
expect(report).toContain('|Report|Passed|Failed|Skipped|Time|')
expect(report).not.toContain('passing-file.spec.ts')
expect(report).toContain('failing-file.spec.ts')
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
// Should show suite details for the failed file
expect(report).toContain('test-suite')
})
it('filters correctly when all files pass and list-files is "failed"', () => {
const allPassingResults = [
createTestResult('passing-file-1.spec.ts', 5, 0, 0),
createTestResult('passing-file-2.spec.ts', 8, 0, 2)
]
const report = getReport(allPassingResults, {
...DEFAULT_OPTIONS,
listFiles: 'failed',
listSuites: 'all',
listTests: 'none'
})
expect(report).not.toContain('passing-file-1.spec.ts')
expect(report).not.toContain('passing-file-2.spec.ts')
expect(report).toContain('![')
expect(report).not.toContain('|Report|Passed|Failed|Skipped|Time|')
})
it('filters correctly when all files fail and list-files is "failed"', () => {
const allFailingResults = [
createTestResult('failing-file-1.spec.ts', 0, 5, 0),
createTestResult('failing-file-2.spec.ts', 1, 2, 1)
]
const report = getReport(allFailingResults, {
...DEFAULT_OPTIONS,
listFiles: 'failed',
listSuites: 'all',
listTests: 'none'
})
expect(report).toContain('failing-file-1.spec.ts')
expect(report).toContain('failing-file-2.spec.ts')
})
})
})

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {RspecJsonParser} from '../src/parsers/rspec-json/rspec-json-parser' import {RspecJsonParser} from '../src/parsers/rspec-json/rspec-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('rspec-json tests', () => { describe('rspec-json tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {SwiftXunitParser} from '../src/parsers/swift-xunit/swift-xunit-parser' import {SwiftXunitParser} from '../src/parsers/swift-xunit/swift-xunit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('swift-xunit tests', () => { describe('swift-xunit tests', () => {
it('report from swift test results matches snapshot', async () => { it('report from swift test results matches snapshot', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {NetteTesterJunitParser} from '../src/parsers/tester-junit/tester-junit-parser' import {NetteTesterJunitParser} from '../src/parsers/tester-junit/tester-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {getReport} from '../src/report/get-report' import {getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('tester-junit tests', () => { describe('tester-junit tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,4 +1,4 @@
import {parseNetDuration} from '../../src/utils/parse-utils' import {parseNetDuration} from '../../src/utils/parse-utils.js'
describe('parseNetDuration', () => { describe('parseNetDuration', () => {
it('returns 0 for 00:00:00', () => { it('returns 0 for 00:00:00', () => {

View file

@ -0,0 +1,28 @@
import {DEFAULT_OPTIONS} from '../../src/report/get-report.js'
import {slug} from '../../src/utils/slugger.js'
describe('slugger', () => {
it('adds prefix from report options to generated slug', () => {
const result = slug('r0s1', {
...DEFAULT_OPTIONS,
slugPrefix: 'prefix-'
})
expect(result).toEqual({
id: 'user-content-prefix-r0s1',
link: '#user-content-prefix-r0s1'
})
})
it('sanitizes custom prefix using existing slug normalization', () => {
const result = slug('r0', {
...DEFAULT_OPTIONS,
slugPrefix: ' my /custom_prefix?.'
})
expect(result).toEqual({
id: 'user-content-my-customprefix-r0',
link: '#user-content-my-customprefix-r0'
})
})
})

View file

@ -54,6 +54,14 @@ inputs:
- none - none
required: false required: false
default: 'all' default: 'all'
list-files:
description: |
Limits which test result files are listed. Supported options:
- all
- failed
- none
required: false
default: 'all'
max-annotations: max-annotations:
description: | description: |
Limits number of created annotations with error message and stack trace captured during test execution. Limits number of created annotations with error message and stack trace captured during test execution.
@ -122,8 +130,12 @@ outputs:
description: Check run URL description: Check run URL
url_html: url_html:
description: Check run URL HTML description: Check run URL HTML
summary_file:
description: Path to a file containing the generated test report summary in Markdown format
slug_prefix:
description: Random prefix added to generated report anchor slugs for this action run
runs: runs:
using: 'node20' using: 'node24'
main: 'dist/index.js' main: 'dist/index.js'
branding: branding:
color: blue color: blue

48304
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

125
dist/licenses.txt generated vendored
View file

@ -71,28 +71,6 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
@nodelib/fs.scandir @nodelib/fs.scandir
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -595,24 +573,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
deprecation fast-content-type-parse
ISC MIT
The ISC License MIT License
Copyright (c) Gregor Martynus and contributors Copyright (c) 2023 The Fastify Team
Permission to use, copy, modify, and/or distribute this software for any The Fastify team members are listed at https://github.com/fastify/fastify#team
purpose with or without fee is hereby granted, provided that the above and in the README file.
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES Permission is hereby granted, free of charge, to any person obtaining a copy
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF of this software and associated documentation files (the "Software"), to deal
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR in the Software without restriction, including without limitation the rights
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN copies of the Software, and to permit persons to whom the Software is
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR furnished to do so, subject to the following conditions:
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
fast-glob fast-glob
MIT MIT
@ -775,6 +761,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
json-with-bigint
MIT
MIT License
Copyright (c) 2023 Ivan Korolenko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
merge2 merge2
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -825,25 +836,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
once
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
picomatch picomatch
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -897,7 +889,7 @@ reusify
MIT MIT
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2015 Matteo Collina Copyright (c) 2015-2024 Matteo Collina
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -1081,32 +1073,13 @@ universal-user-agent
ISC ISC
# [ISC License](https://spdx.org/licenses/ISC) # [ISC License](https://spdx.org/licenses/ISC)
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m) Copyright (c) 2018-2021, Gregor Martynus (https://github.com/gr2m)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
wrappy
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
xml2js xml2js
MIT MIT
Copyright 2010, 2011, 2012, 2013. All rights reserved. Copyright 2010, 2011, 2012, 2013. All rights reserved.

3
dist/package.json generated vendored Normal file
View file

@ -0,0 +1,3 @@
{
"type": "module"
}

73
eslint.config.mjs Normal file
View file

@ -0,0 +1,73 @@
import github from 'eslint-plugin-github'
import jest from 'eslint-plugin-jest'
export default [
github.getFlatConfigs().recommended,
...github.getFlatConfigs().typescript,
{
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
typescript: {
project: './tsconfig.json',
alwaysTryTypes: true
},
node: {
extensions: ['.js', '.mjs', '.ts', '.tsx']
}
}
}
},
{
files: ['src/**/*.ts'],
rules: {
'i18n-text/no-en': 'off',
'eslint-comments/no-use': 'off',
'import/no-namespace': 'off',
'import/no-named-as-default': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'prefer-template': 'off',
camelcase: 'off',
semi: 'off',
'@typescript-eslint/array-type': ['error', {default: 'array'}],
'@typescript-eslint/no-unused-vars': ['error', {varsIgnorePattern: '^_'}],
'@typescript-eslint/no-shadow': ['error'],
// Modern replacements for deprecated rules from the legacy config.
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-require-imports': 'error'
}
},
{
files: ['__tests__/**/*.test.ts'],
...jest.configs['flat/recommended'],
plugins: {
jest
},
languageOptions: {
globals: jest.environments.globals.globals
},
rules: {
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'@typescript-eslint/array-type': ['error', {default: 'array'}],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off'
}
},
{
ignores: [
'dist/**',
'lib/**',
'node_modules/**',
'__tests__/__snapshots__/**',
'__tests__/__results__/**',
'assets/**',
'reports/**',
'eslint.config.mjs',
'jest.config.cjs'
]
}
]

View file

@ -3,9 +3,12 @@ module.exports = {
moduleFileExtensions: ['js', 'ts'], moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node', testEnvironment: 'node',
testMatch: ['**/*.test.ts'], testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: { transform: {
'^.+\\.ts$': 'ts-jest' '^.+\\.ts$': ['ts-jest', {useESM: true}]
}, },
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
extensionsToTreatAsEsm: ['.ts'],
verbose: true verbose: true
} }

3718
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,17 +1,18 @@
{ {
"name": "test-reporter", "name": "test-reporter",
"version": "2.5.0", "version": "3.0.0",
"private": true, "private": true,
"description": "Presents test results from popular testing frameworks as Github check run", "description": "Presents test results from popular testing frameworks as Github check run",
"type": "module",
"main": "lib/main.js", "main": "lib/main.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"format": "prettier --write **/*.ts", "format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts", "format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts", "lint": "eslint",
"package": "ncc build --license licenses.txt && eolConverter lf 'dist/*'", "package": "ncc build --license licenses.txt && eolConverter lf 'dist/*'",
"version": "npm run build && npm run package && git add dist/*", "version": "npm run build && npm run package && git add dist/*",
"test": "jest --ci --reporters=default --reporters=jest-junit", "test": "NODE_OPTIONS='--experimental-vm-modules' jest --ci --reporters=default --reporters=jest-junit",
"jest:updatesnapshot": "jest --updateSnapshot", "jest:updatesnapshot": "jest --updateSnapshot",
"all": "npm run build && npm run format && npm run lint && npm run package && npm test", "all": "npm run build && npm run format && npm run lint && npm run package && npm test",
"dart-fixture": "cd \"reports/dart\" && dart test --file-reporter=\"json:../../__tests__/fixtures/dart-json.json\"", "dart-fixture": "cd \"reports/dart\" && dart test --file-reporter=\"json:../../__tests__/fixtures/dart-json.json\"",
@ -36,37 +37,37 @@
"author": "Michal Dorner <dorner.michal@gmail.com>", "author": "Michal Dorner <dorner.michal@gmail.com>",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^3.0.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^3.0.0",
"@actions/github": "^6.0.1", "@actions/github": "^9.1.1",
"adm-zip": "^0.5.16", "adm-zip": "^0.5.17",
"fast-glob": "^3.3.3", "fast-glob": "^3.3.3",
"picomatch": "^4.0.3", "picomatch": "^4.0.4",
"xml2js": "^0.6.2" "xml2js": "^0.6.2"
}, },
"devDependencies": { "devDependencies": {
"@octokit/webhooks-types": "^7.6.1", "@octokit/webhooks-types": "^7.6.1",
"@types/adm-zip": "^0.5.7", "@types/adm-zip": "^0.5.8",
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
"@types/node": "^20.19.23", "@types/node": "^24.12.2",
"@types/picomatch": "^4.0.2", "@types/picomatch": "^4.0.3",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/eslint-plugin": "^8.59.0",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^8.59.0",
"@vercel/ncc": "^0.38.4", "@vercel/ncc": "^0.38.4",
"eol-converter-cli": "^1.1.0", "eol-converter-cli": "^1.1.0",
"eslint": "^8.57.1", "eslint": "^9.39.4",
"eslint-import-resolver-typescript": "^3.10.1", "eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-github": "^4.10.2", "eslint-plugin-github": "^6.0.0",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^28.14.0", "eslint-plugin-jest": "^29.15.2",
"eslint-plugin-prettier": "^5.5.4", "eslint-plugin-prettier": "^5.5.5",
"jest": "^30.2.0", "jest": "^30.3.0",
"jest-junit": "^16.0.0", "jest-junit": "^17.0.0",
"js-yaml": "^4.1.1", "js-yaml": "^4.1.1",
"prettier": "^3.8.1", "prettier": "^3.8.3",
"ts-jest": "^29.4.5", "ts-jest": "^29.4.9",
"typescript": "^5.9.3" "typescript": "^6.0.3"
}, },
"overrides": { "overrides": {
"sax": "^1.4.3" "sax": "^1.4.3"
@ -82,7 +83,7 @@
"titleTemplate": "{title}" "titleTemplate": "{title}"
}, },
"engines": { "engines": {
"node": ">=20" "node": ">=24"
}, },
"markdownlint-cli2": { "markdownlint-cli2": {
"ignores": [ "ignores": [

View file

@ -4548,10 +4548,11 @@
"dev": true "dev": true
}, },
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.2.2", "version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": ">=8.6" "node": ">=8.6"
}, },

View file

@ -5,8 +5,13 @@ import {GitHub} from '@actions/github/lib/utils'
import Zip from 'adm-zip' import Zip from 'adm-zip'
import picomatch from 'picomatch' import picomatch from 'picomatch'
import {FileContent, InputProvider, ReportInput} from './input-provider' import {FileContent, InputProvider, ReportInput} from './input-provider.js'
import {downloadArtifact, listFiles} from '../utils/github-utils' import {downloadArtifact, listFiles} from '../utils/github-utils.js'
type WorkflowRunArtifact = {
id: number
name: string
}
export class ArtifactProvider implements InputProvider { export class ArtifactProvider implements InputProvider {
private readonly artifactNameMatch: (name: string) => boolean private readonly artifactNameMatch: (name: string) => boolean
@ -50,10 +55,10 @@ export class ArtifactProvider implements InputProvider {
async load(): Promise<ReportInput> { async load(): Promise<ReportInput> {
const result: ReportInput = {} const result: ReportInput = {}
const allArtifacts = await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, { const allArtifacts = (await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, {
...github.context.repo, ...github.context.repo,
run_id: this.runId run_id: this.runId
}) })) as WorkflowRunArtifact[]
if (allArtifacts.length === 0) { if (allArtifacts.length === 0) {
core.warning(`No artifacts found in run ${this.runId}`) core.warning(`No artifacts found in run ${this.runId}`)

View file

@ -1,7 +1,7 @@
import * as fs from 'fs' import * as fs from 'fs'
import glob from 'fast-glob' import glob from 'fast-glob'
import {FileContent, InputProvider, ReportInput} from './input-provider' import {FileContent, InputProvider, ReportInput} from './input-provider.js'
import {listFiles} from '../utils/git' import {listFiles} from '../utils/git.js'
export class LocalFileProvider implements InputProvider { export class LocalFileProvider implements InputProvider {
constructor( constructor(

View file

@ -1,29 +1,33 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import * as github from '@actions/github' import * as github from '@actions/github'
import {GitHub} from '@actions/github/lib/utils' import {GitHub} from '@actions/github/lib/utils'
import {randomBytes} from 'node:crypto'
import {writeFileSync} from 'node:fs'
import {tmpdir} from 'node:os'
import {join} from 'node:path'
import {ArtifactProvider} from './input-providers/artifact-provider' import {ArtifactProvider} from './input-providers/artifact-provider.js'
import {LocalFileProvider} from './input-providers/local-file-provider' import {LocalFileProvider} from './input-providers/local-file-provider.js'
import {FileContent} from './input-providers/input-provider' import {FileContent} from './input-providers/input-provider.js'
import {ParseOptions, TestParser} from './test-parser' import {ParseOptions, TestParser} from './test-parser.js'
import {TestRunResult} from './test-results' import {TestRunResult} from './test-results.js'
import {getAnnotations} from './report/get-annotations' import {getAnnotations} from './report/get-annotations.js'
import {getReport} from './report/get-report' import {getReport} from './report/get-report.js'
import {DartJsonParser} from './parsers/dart-json/dart-json-parser' import {DartJsonParser} from './parsers/dart-json/dart-json-parser.js'
import {DotnetNunitParser} from './parsers/dotnet-nunit/dotnet-nunit-parser' import {DotnetNunitParser} from './parsers/dotnet-nunit/dotnet-nunit-parser.js'
import {DotnetTrxParser} from './parsers/dotnet-trx/dotnet-trx-parser' import {DotnetTrxParser} from './parsers/dotnet-trx/dotnet-trx-parser.js'
import {GolangJsonParser} from './parsers/golang-json/golang-json-parser' import {GolangJsonParser} from './parsers/golang-json/golang-json-parser.js'
import {JavaJunitParser} from './parsers/java-junit/java-junit-parser' import {JavaJunitParser} from './parsers/java-junit/java-junit-parser.js'
import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser' import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser.js'
import {MochaJsonParser} from './parsers/mocha-json/mocha-json-parser' import {MochaJsonParser} from './parsers/mocha-json/mocha-json-parser.js'
import {PhpunitJunitParser} from './parsers/phpunit-junit/phpunit-junit-parser' import {PhpunitJunitParser} from './parsers/phpunit-junit/phpunit-junit-parser.js'
import {PythonXunitParser} from './parsers/python-xunit/python-xunit-parser' import {PythonXunitParser} from './parsers/python-xunit/python-xunit-parser.js'
import {RspecJsonParser} from './parsers/rspec-json/rspec-json-parser' import {RspecJsonParser} from './parsers/rspec-json/rspec-json-parser.js'
import {SwiftXunitParser} from './parsers/swift-xunit/swift-xunit-parser' import {SwiftXunitParser} from './parsers/swift-xunit/swift-xunit-parser.js'
import {NetteTesterJunitParser} from './parsers/tester-junit/tester-junit-parser' import {NetteTesterJunitParser} from './parsers/tester-junit/tester-junit-parser.js'
import {normalizeDirPath, normalizeFilePath} from './utils/path-utils' import {normalizeDirPath, normalizeFilePath} from './utils/path-utils.js'
import {getCheckRunContext} from './utils/github-utils' import {getCheckRunContext} from './utils/github-utils.js'
async function main(): Promise<void> { async function main(): Promise<void> {
try { try {
@ -43,12 +47,14 @@ class TestReporter {
readonly reporter = core.getInput('reporter', {required: true}) readonly reporter = core.getInput('reporter', {required: true})
readonly listSuites = core.getInput('list-suites', {required: true}) as 'all' | 'failed' | 'none' readonly listSuites = core.getInput('list-suites', {required: true}) as 'all' | 'failed' | 'none'
readonly listTests = core.getInput('list-tests', {required: true}) as 'all' | 'failed' | 'none' readonly listTests = core.getInput('list-tests', {required: true}) as 'all' | 'failed' | 'none'
readonly listFiles = core.getInput('list-files', {required: true}) as 'all' | 'failed' | 'none'
readonly maxAnnotations = parseInt(core.getInput('max-annotations', {required: true})) readonly maxAnnotations = parseInt(core.getInput('max-annotations', {required: true}))
readonly failOnError = core.getInput('fail-on-error', {required: true}) === 'true' readonly failOnError = core.getInput('fail-on-error', {required: true}) === 'true'
readonly failOnEmpty = core.getInput('fail-on-empty', {required: true}) === 'true' readonly failOnEmpty = core.getInput('fail-on-empty', {required: true}) === 'true'
readonly workDirInput = core.getInput('working-directory', {required: false}) readonly workDirInput = core.getInput('working-directory', {required: false})
readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true' readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true'
readonly useActionsSummary = core.getInput('use-actions-summary', {required: false}) === 'true' readonly useActionsSummary = core.getInput('use-actions-summary', {required: false}) === 'true'
readonly slugPrefix = `tr-${randomBytes(4).toString('base64url')}-`
readonly badgeTitle = core.getInput('badge-title', {required: false}) readonly badgeTitle = core.getInput('badge-title', {required: false})
readonly reportTitle = core.getInput('report-title', {required: false}) readonly reportTitle = core.getInput('report-title', {required: false})
readonly collapsed = core.getInput('collapsed', {required: false}) as 'auto' | 'always' | 'never' readonly collapsed = core.getInput('collapsed', {required: false}) as 'auto' | 'always' | 'never'
@ -69,6 +75,11 @@ class TestReporter {
return return
} }
if (this.listFiles !== 'all' && this.listFiles !== 'failed' && this.listFiles !== 'none') {
core.setFailed(`Input parameter 'list-files' has invalid value`)
return
}
if (this.collapsed !== 'auto' && this.collapsed !== 'always' && this.collapsed !== 'never') { if (this.collapsed !== 'auto' && this.collapsed !== 'always' && this.collapsed !== 'never') {
core.setFailed(`Input parameter 'collapsed' has invalid value`) core.setFailed(`Input parameter 'collapsed' has invalid value`)
return return
@ -144,6 +155,7 @@ class TestReporter {
core.setOutput('failed', failed) core.setOutput('failed', failed)
core.setOutput('skipped', skipped) core.setOutput('skipped', skipped)
core.setOutput('time', time) core.setOutput('time', time)
core.setOutput('slug_prefix', this.slugPrefix)
if (this.failOnError && isFailed) { if (this.failOnError && isFailed) {
core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`) core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`)
@ -174,7 +186,17 @@ class TestReporter {
} }
} }
const {listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle, collapsed} = this const {
listSuites,
listTests,
slugPrefix,
listFiles,
onlySummary,
useActionsSummary,
badgeTitle,
reportTitle,
collapsed
} = this
const passed = results.reduce((sum, tr) => sum + tr.passed, 0) const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
const failed = results.reduce((sum, tr) => sum + tr.failed, 0) const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
@ -188,6 +210,8 @@ class TestReporter {
{ {
listSuites, listSuites,
listTests, listTests,
slugPrefix,
listFiles,
baseUrl, baseUrl,
onlySummary, onlySummary,
useActionsSummary, useActionsSummary,
@ -200,6 +224,7 @@ class TestReporter {
core.info('Summary content:') core.info('Summary content:')
core.info(summary) core.info(summary)
this.writeSummaryFile(summary)
await core.summary.addRaw(summary).write() await core.summary.addRaw(summary).write()
} else { } else {
core.info(`Creating check run ${name}`) core.info(`Creating check run ${name}`)
@ -219,6 +244,8 @@ class TestReporter {
const summary = getReport(results, { const summary = getReport(results, {
listSuites, listSuites,
listTests, listTests,
slugPrefix,
listFiles,
baseUrl, baseUrl,
onlySummary, onlySummary,
useActionsSummary, useActionsSummary,
@ -229,6 +256,7 @@ class TestReporter {
core.info('Creating annotations') core.info('Creating annotations')
const annotations = getAnnotations(results, this.maxAnnotations) const annotations = getAnnotations(results, this.maxAnnotations)
this.writeSummaryFile(summary)
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed') const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
const conclusion = isFailed ? 'failure' : 'success' const conclusion = isFailed ? 'failure' : 'success'
@ -255,6 +283,14 @@ class TestReporter {
return results return results
} }
writeSummaryFile(summary: string): void {
const dir = process.env.RUNNER_TEMP || tmpdir()
const file = join(dir, `test-reporter-summary-${randomBytes(8).toString('hex')}.md`)
writeFileSync(file, summary)
core.info(`Summary written to ${file}`)
core.setOutput('summary_file', file)
}
getParser(reporter: string, options: ParseOptions): TestParser { getParser(reporter: string, options: ParseOptions): TestParser {
switch (reporter) { switch (reporter) {
case 'dart-json': case 'dart-json':

View file

@ -1,6 +1,6 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
ReportEvent, ReportEvent,
@ -17,7 +17,7 @@ import {
isDoneEvent, isDoneEvent,
isMessageEvent, isMessageEvent,
MessageEvent MessageEvent
} from './dart-json-types' } from './dart-json-types.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -26,7 +26,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
class TestRun { class TestRun {
constructor( constructor(

View file

@ -1,9 +1,9 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {NunitReport, TestCase, TestSuite} from './dotnet-nunit-types' import {NunitReport, TestCase, TestSuite} from './dotnet-nunit-types.js'
import {getExceptionSource} from '../../utils/node-utils' import {getExceptionSource} from '../../utils/node-utils.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -12,7 +12,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class DotnetNunitParser implements TestParser { export class DotnetNunitParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,10 +1,10 @@
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {ErrorInfo, Outcome, TrxReport, UnitTest, UnitTestResult} from './dotnet-trx-types' import {ErrorInfo, Outcome, TrxReport, UnitTest, UnitTestResult} from './dotnet-trx-types.js'
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import {parseIsoDate, parseNetDuration} from '../../utils/parse-utils' import {parseIsoDate, parseNetDuration} from '../../utils/parse-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -13,7 +13,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
class TestClass { class TestClass {
constructor(readonly name: string) {} constructor(readonly name: string) {}
@ -62,8 +62,11 @@ export class DotnetTrxParser implements TestParser {
} }
private getTestClasses(trx: TrxReport): TestClass[] { private getTestClasses(trx: TrxReport): TestClass[] {
if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined || if (
!trx.TestRun.TestDefinitions.some(td => td.UnitTest && Array.isArray(td.UnitTest))) { trx.TestRun.TestDefinitions === undefined ||
trx.TestRun.Results === undefined ||
!trx.TestRun.TestDefinitions.some(td => td.UnitTest && Array.isArray(td.UnitTest))
) {
return [] return []
} }
@ -81,7 +84,7 @@ export class DotnetTrxParser implements TestParser {
const testClasses: {[name: string]: TestClass} = {} const testClasses: {[name: string]: TestClass} = {}
for (const r of unitTestsResults) { for (const r of unitTestsResults) {
const className = r.test.TestMethod[0].$.className ?? "Unclassified" const className = r.test.TestMethod[0].$.className ?? 'Unclassified'
let tc = testClasses[className] let tc = testClasses[className]
if (tc === undefined) { if (tc === undefined) {
tc = new TestClass(className) tc = new TestClass(className)

View file

@ -1,8 +1,6 @@
import { ParseOptions, TestParser } from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import { GoTestEvent } from './golang-json-types' import {GoTestEvent} from './golang-json-types.js'
import { getExceptionSource } from '../../utils/node-utils'
import { getBasePath, normalizeFilePath } from '../../utils/path-utils'
import { import {
TestExecutionResult, TestExecutionResult,
@ -11,12 +9,12 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class GolangJsonParser implements TestParser { export class GolangJsonParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined
constructor(readonly options: ParseOptions) { } constructor(readonly options: ParseOptions) {}
async parse(path: string, content: string): Promise<TestRunResult> { async parse(path: string, content: string): Promise<TestRunResult> {
const events = await this.getGolangTestEvents(path, content) const events = await this.getGolangTestEvents(path, content)
@ -24,13 +22,16 @@ export class GolangJsonParser implements TestParser {
} }
private async getGolangTestEvents(path: string, content: string): Promise<GoTestEvent[]> { private async getGolangTestEvents(path: string, content: string): Promise<GoTestEvent[]> {
return content.trim().split('\n').map((line, index) => { return content
try { .trim()
return JSON.parse(line) as GoTestEvent .split('\n')
} catch (e) { .map((line, index) => {
throw new Error(`Invalid JSON at ${path} line ${index + 1}\n\n${e}`) try {
} return JSON.parse(line) as GoTestEvent
}) } catch (e) {
throw new Error(`Invalid JSON at ${path} line ${index + 1}\n\n${e}`)
}
})
} }
private getTestRunResult(path: string, events: GoTestEvent[]): TestRunResult { private getTestRunResult(path: string, events: GoTestEvent[]): TestRunResult {
@ -63,9 +64,8 @@ export class GolangJsonParser implements TestParser {
continue continue
} }
let groupName: string | null const [first, ...rest] = event.Test.split('/')
let rest: string[] let groupName: string | null = first
[groupName, ...rest] = event.Test.split('/')
let testName = rest.join('/') let testName = rest.join('/')
if (!testName) { if (!testName) {
testName = groupName testName = groupName
@ -80,9 +80,8 @@ export class GolangJsonParser implements TestParser {
const lastEvent = eventGroup.at(-1)! const lastEvent = eventGroup.at(-1)!
const result: TestExecutionResult = lastEvent.Action === 'pass' ? 'success' const result: TestExecutionResult =
: lastEvent.Action === 'skip' ? 'skipped' lastEvent.Action === 'pass' ? 'success' : lastEvent.Action === 'skip' ? 'skipped' : 'failed'
: 'failed'
if (lastEvent.Elapsed === undefined) { if (lastEvent.Elapsed === undefined) {
throw new Error('missing elapsed on final test event') throw new Error('missing elapsed on final test event')
} }
@ -94,7 +93,7 @@ export class GolangJsonParser implements TestParser {
.filter(e => e.Action === 'output') .filter(e => e.Action === 'output')
.map(e => e.Output ?? '') .map(e => e.Output ?? '')
// Go output prepends indentation to help group tests - remove it // Go output prepends indentation to help group tests - remove it
.map(o => o.replace(/^ /, '')) .map(o => o.replace(/^ {4}/, ''))
// First and last lines will be generic "test started" and "test finished" lines - remove them // First and last lines will be generic "test started" and "test finished" lines - remove them
outputEvents.splice(0, 1) outputEvents.splice(0, 1)
@ -103,7 +102,7 @@ export class GolangJsonParser implements TestParser {
const details = outputEvents.join('') const details = outputEvents.join('')
error = { error = {
message: details, message: details,
details: details details
} }
} }

View file

@ -1,12 +1,4 @@
export type GoTestAction = 'start' export type GoTestAction = 'start' | 'run' | 'pause' | 'cont' | 'pass' | 'bench' | 'fail' | 'output' | 'skip'
| 'run'
| 'pause'
| 'cont'
| 'pass'
| 'bench'
| 'fail'
| 'output'
| 'skip'
export type GoTestEvent = { export type GoTestEvent = {
Time: string Time: string

View file

@ -1,10 +1,10 @@
import * as path from 'path' import * as path from 'path'
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {JunitReport, SingleSuiteReport, TestCase, TestSuite} from './java-junit-types' import {JunitReport, SingleSuiteReport, TestCase, TestSuite} from './java-junit-types.js'
import {parseStackTraceElement} from './java-stack-trace-element-parser' import {parseStackTraceElement} from './java-stack-trace-element-parser.js'
import {normalizeFilePath} from '../../utils/path-utils' import {normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -13,7 +13,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class JavaJunitParser implements TestParser { export class JavaJunitParser implements TestParser {
readonly trackedFiles: {[fileName: string]: string[]} readonly trackedFiles: {[fileName: string]: string[]}

View file

@ -1,9 +1,9 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {JunitReport, TestCase, TestSuite} from './jest-junit-types' import {JunitReport, TestCase, TestSuite} from './jest-junit-types.js'
import {getExceptionSource} from '../../utils/node-utils' import {getExceptionSource} from '../../utils/node-utils.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -12,7 +12,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class JestJunitParser implements TestParser { export class JestJunitParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined
@ -75,17 +75,18 @@ export class JestJunitParser implements TestParser {
} }
private getTestCaseResult(test: TestCase): TestExecutionResult { private getTestCaseResult(test: TestCase): TestExecutionResult {
if (test.failure) return 'failed' if (test.failure || test.error) return 'failed'
if (test.skipped) return 'skipped' if (test.skipped) return 'skipped'
return 'success' return 'success'
} }
private getTestCaseError(tc: TestCase): TestCaseError | undefined { private getTestCaseError(tc: TestCase): TestCaseError | undefined {
if (!this.options.parseErrors || !tc.failure) { if (!this.options.parseErrors || !(tc.failure || tc.error)) {
return undefined return undefined
} }
const details = typeof tc.failure[0] === 'string' ? tc.failure[0] : tc.failure[0]['_'] const message = tc.failure ? tc.failure[0] : tc.error ? tc.error[0] : 'unknown failure'
const details = typeof message === 'string' ? message : message['_']
let path let path
let line let line

View file

@ -31,4 +31,5 @@ export interface TestCase {
} }
failure?: string[] failure?: string[]
skipped?: string[] skipped?: string[]
error?: string[]
} }

View file

@ -1,4 +1,4 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import { import {
TestCaseError, TestCaseError,
TestCaseResult, TestCaseResult,
@ -6,10 +6,10 @@ import {
TestGroupResult, TestGroupResult,
TestRunResult, TestRunResult,
TestSuiteResult TestSuiteResult
} from '../../test-results' } from '../../test-results.js'
import {getExceptionSource} from '../../utils/node-utils' import {getExceptionSource} from '../../utils/node-utils.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import {MochaJson, MochaJsonTest} from './mocha-json-types' import {MochaJson, MochaJsonTest} from './mocha-json-types.js'
export class MochaJsonParser implements TestParser { export class MochaJsonParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,8 +1,8 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {PhpunitReport, SingleSuiteReport, TestCase, TestSuite} from './phpunit-junit-types' import {PhpunitReport, SingleSuiteReport, TestCase, TestSuite} from './phpunit-junit-types.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -11,7 +11,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class PhpunitJunitParser implements TestParser { export class PhpunitJunitParser implements TestParser {
readonly trackedFiles: Set<string> readonly trackedFiles: Set<string>
@ -130,7 +130,7 @@ export class PhpunitJunitParser implements TestParser {
} }
const failure = failures[0] const failure = failures[0]
const details = typeof failure === 'string' ? failure : failure._ ?? '' const details = typeof failure === 'string' ? failure : (failure._ ?? '')
// PHPUnit provides file path directly in testcase attributes // PHPUnit provides file path directly in testcase attributes
let filePath: string | undefined let filePath: string | undefined

View file

@ -1,5 +1,5 @@
import {ParseOptions} from '../../test-parser' import {ParseOptions} from '../../test-parser.js'
import {JavaJunitParser} from '../java-junit/java-junit-parser' import {JavaJunitParser} from '../java-junit/java-junit-parser.js'
export class PythonXunitParser extends JavaJunitParser { export class PythonXunitParser extends JavaJunitParser {
constructor(readonly options: ParseOptions) { constructor(readonly options: ParseOptions) {

View file

@ -1,4 +1,4 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import { import {
TestCaseError, TestCaseError,
TestCaseResult, TestCaseResult,
@ -6,8 +6,8 @@ import {
TestGroupResult, TestGroupResult,
TestRunResult, TestRunResult,
TestSuiteResult TestSuiteResult
} from '../../test-results' } from '../../test-results.js'
import {RspecJson, RspecExample} from './rspec-json-types' import {RspecJson, RspecExample} from './rspec-json-types.js'
export class RspecJsonParser implements TestParser { export class RspecJsonParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,5 +1,5 @@
import {ParseOptions} from '../../test-parser' import {ParseOptions} from '../../test-parser.js'
import {JavaJunitParser} from '../java-junit/java-junit-parser' import {JavaJunitParser} from '../java-junit/java-junit-parser.js'
export class SwiftXunitParser extends JavaJunitParser { export class SwiftXunitParser extends JavaJunitParser {
constructor(readonly options: ParseOptions) { constructor(readonly options: ParseOptions) {

View file

@ -1,9 +1,9 @@
import * as path from 'path' import * as path from 'path'
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {NetteTesterReport, SingleSuiteReport, TestCase, TestSuite} from './tester-junit-types' import {NetteTesterReport, SingleSuiteReport, TestCase, TestSuite} from './tester-junit-types.js'
import {normalizeFilePath} from '../../utils/path-utils' import {normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -12,7 +12,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
interface ParsedTestName { interface ParsedTestName {
filePath: string filePath: string
@ -199,7 +199,7 @@ export class NetteTesterJunitParser implements TestParser {
const failure = failures[0] const failure = failures[0]
// For Nette Tester, details are in the message attribute, not as inner text // For Nette Tester, details are in the message attribute, not as inner text
const details = typeof failure === 'string' ? failure : failure._ ?? failure.$?.message ?? '' const details = typeof failure === 'string' ? failure : (failure._ ?? failure.$?.message ?? '')
// Try to extract file path and line from error details // Try to extract file path and line from error details
let errorFilePath: string | undefined let errorFilePath: string | undefined

View file

@ -1,6 +1,6 @@
import {ellipsis, fixEol} from '../utils/markdown-utils' import {ellipsis, fixEol} from '../utils/markdown-utils.js'
import {TestRunResult} from '../test-results' import {TestRunResult} from '../test-results.js'
import {getFirstNonEmptyLine} from '../utils/parse-utils' import {getFirstNonEmptyLine} from '../utils/parse-utils.js'
type Annotation = { type Annotation = {
path: string path: string

View file

@ -1,9 +1,9 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import {TestExecutionResult, TestRunResult, TestSuiteResult} from '../test-results' import {TestExecutionResult, TestRunResult, TestSuiteResult} from '../test-results.js'
import {Align, formatTime, Icon, link, table} from '../utils/markdown-utils' import {Align, formatTime, Icon, link, table} from '../utils/markdown-utils.js'
import {DEFAULT_LOCALE} from '../utils/node-utils' import {DEFAULT_LOCALE} from '../utils/node-utils.js'
import {getFirstNonEmptyLine} from '../utils/parse-utils' import {getFirstNonEmptyLine} from '../utils/parse-utils.js'
import {slug} from '../utils/slugger' import {slug} from '../utils/slugger.js'
const MAX_REPORT_LENGTH = 65535 const MAX_REPORT_LENGTH = 65535
const MAX_ACTIONS_SUMMARY_LENGTH = 1048576 const MAX_ACTIONS_SUMMARY_LENGTH = 1048576
@ -11,6 +11,8 @@ const MAX_ACTIONS_SUMMARY_LENGTH = 1048576
export interface ReportOptions { export interface ReportOptions {
listSuites: 'all' | 'failed' | 'none' listSuites: 'all' | 'failed' | 'none'
listTests: 'all' | 'failed' | 'none' listTests: 'all' | 'failed' | 'none'
slugPrefix: string
listFiles: 'all' | 'failed' | 'none'
baseUrl: string baseUrl: string
onlySummary: boolean onlySummary: boolean
useActionsSummary: boolean useActionsSummary: boolean
@ -22,6 +24,8 @@ export interface ReportOptions {
export const DEFAULT_OPTIONS: ReportOptions = { export const DEFAULT_OPTIONS: ReportOptions = {
listSuites: 'all', listSuites: 'all',
listTests: 'all', listTests: 'all',
slugPrefix: '',
listFiles: 'all',
baseUrl: '', baseUrl: '',
onlySummary: false, onlySummary: false,
useActionsSummary: true, useActionsSummary: true,
@ -171,21 +175,29 @@ function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): s
sections.push(` `) sections.push(` `)
} }
if (testRuns.length > 0 || options.onlySummary) { // Filter test runs based on list-files option
const tableData = testRuns const filteredTestRuns =
.map((tr, originalIndex) => ({tr, originalIndex})) options.listFiles === 'failed'
.filter(({tr}) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0) ? testRuns.filter(tr => tr.result === 'failed')
.map(({tr, originalIndex}) => { : options.listFiles === 'none'
const time = formatTime(tr.time) ? []
const name = tr.path : testRuns
const addr = options.baseUrl + makeRunSlug(originalIndex, options).link
const nameLink = link(name, addr)
const passed = tr.passed > 0 ? `${tr.passed} ${Icon.success}` : ''
const failed = tr.failed > 0 ? `${tr.failed} ${Icon.fail}` : ''
const skipped = tr.skipped > 0 ? `${tr.skipped} ${Icon.skip}` : ''
return [nameLink, passed, failed, skipped, time]
})
const tableData = filteredTestRuns
.map((tr, originalIndex) => ({tr, originalIndex}))
.filter(({tr}) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
.map(({tr, originalIndex}) => {
const time = formatTime(tr.time)
const name = tr.path
const addr = options.baseUrl + makeRunSlug(originalIndex, options).link
const nameLink = link(name, addr)
const passed = tr.passed > 0 ? `${tr.passed} ${Icon.success}` : ''
const failed = tr.failed > 0 ? `${tr.failed} ${Icon.fail}` : ''
const skipped = tr.skipped > 0 ? `${tr.skipped} ${Icon.skip}` : ''
return [nameLink, passed, failed, skipped, time]
})
if (tableData.length > 0) {
const resultsTable = table( const resultsTable = table(
['Report', 'Passed', 'Failed', 'Skipped', 'Time'], ['Report', 'Passed', 'Failed', 'Skipped', 'Time'],
[Align.Left, Align.Right, Align.Right, Align.Right, Align.Right], [Align.Left, Align.Right, Align.Right, Align.Right, Align.Right],
@ -195,7 +207,7 @@ function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): s
} }
if (options.onlySummary === false) { if (options.onlySummary === false) {
const suitesReports = testRuns.map((tr, i) => getSuitesReport(tr, i, options)).flat() const suitesReports = filteredTestRuns.map((tr, i) => getSuitesReport(tr, i, options)).flat()
sections.push(...suitesReports) sections.push(...suitesReports)
} }

View file

@ -1,4 +1,4 @@
import {TestRunResult} from './test-results' import {TestRunResult} from './test-results.js'
export interface ParseOptions { export interface ParseOptions {
parseErrors: boolean parseErrors: boolean

View file

@ -1,4 +1,4 @@
import {DEFAULT_LOCALE} from './utils/node-utils' import {DEFAULT_LOCALE} from './utils/node-utils.js'
export class TestRunResult { export class TestRunResult {
constructor( constructor(

View file

@ -125,7 +125,11 @@ async function listGitTree(octokit: InstanceType<typeof GitHub>, sha: string, pa
if (tr.type === 'blob') { if (tr.type === 'blob') {
result.push(file) result.push(file)
} else if (tr.type === 'tree' && truncated) { } else if (tr.type === 'tree' && truncated) {
const files = await listGitTree(octokit, tr.sha as string, `${file}/`) if (!tr.sha) {
core.warning(`Skipping tree ${file}: missing SHA`)
continue
}
const files = await listGitTree(octokit, tr.sha, `${file}/`)
result.push(...files) result.push(...files)
} }
} }

View file

@ -1,4 +1,4 @@
import {normalizeFilePath} from './path-utils' import {normalizeFilePath} from './path-utils.js'
export const DEFAULT_LOCALE = 'en-US' export const DEFAULT_LOCALE = 'en-US'

View file

@ -1,10 +1,10 @@
// Returns HTML element id and href link usable as manual anchor links // Returns HTML element id and href link usable as manual anchor links
// This is needed because Github in check run summary doesn't automatically // This is needed because Github in check run summary doesn't automatically
// create links out of headings as it normally does for other markdown content // create links out of headings as it normally does for other markdown content
import {ReportOptions} from '../report/get-report' import {ReportOptions} from '../report/get-report.js'
export function slug(name: string, options: ReportOptions): {id: string; link: string} { export function slug(name: string, options: ReportOptions): {id: string; link: string} {
const slugId = name const slugId = `${options.slugPrefix}${name}`
.trim() .trim()
.replace(/_/g, '') .replace(/_/g, '')
.replace(/[./\\]/g, '-') .replace(/[./\\]/g, '-')

View file

@ -1,13 +1,13 @@
{ {
"compilerOptions": { "compilerOptions": {
"lib": ["es2023"], "lib": ["es2023"],
"module": "node16", "module": "nodenext",
"target": "es2022", "target": "es2022",
"strict": true, "strict": true,
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
"moduleResolution": "node16", "moduleResolution": "nodenext",
"isolatedModules": true, "isolatedModules": true,
"outDir": "./lib", "outDir": "./lib",