Compare commits

...

82 Commits

Author SHA1 Message Date
Vittorio Rigamonti 5609ce4db7
Escape RegExp (#265) (#266)
* Escape RegExp (#265)

* run `npm package` with latest node20 version

---------

Co-authored-by: rigazilla <vittorio@infinispan.org>
Co-authored-by: Ghais Zaher <ghaiszaher@gmail.com>
2025-09-24 14:37:54 +02:00
dependabot[bot] 2f39fde5c9
Bump brace-expansion from 1.1.11 to 1.1.12 (#263)
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.11 to 1.1.12.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 08:24:33 -03:00
dependabot[bot] f93e996901
Bump @octokit/plugin-paginate-rest from 9.0.0 to 9.2.2 (#264)
Bumps [@octokit/plugin-paginate-rest](https://github.com/octokit/plugin-paginate-rest.js) from 9.0.0 to 9.2.2.
- [Release notes](https://github.com/octokit/plugin-paginate-rest.js/releases)
- [Commits](https://github.com/octokit/plugin-paginate-rest.js/compare/v9.0.0...v9.2.2)

---
updated-dependencies:
- dependency-name: "@octokit/plugin-paginate-rest"
  dependency-version: 9.2.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 08:24:10 -03:00
dependabot[bot] d3a4a98751
Bump @vercel/ncc from 0.38.1 to 0.38.3 (#237)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.1 to 0.38.3.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.1...0.38.3)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 11:35:38 +02:00
dependabot[bot] e3dc3b8070
Bump @actions/glob from 0.4.0 to 0.5.0 (#234)
Bumps [@actions/glob](https://github.com/actions/toolkit/tree/HEAD/packages/glob) from 0.4.0 to 0.5.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/glob/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/glob)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 11:35:14 +02:00
dependabot[bot] 32ab8c7c18
Bump org.apache.commons:commons-lang3 in /integration-tests/maven (#258)
Bumps org.apache.commons:commons-lang3 from 3.7 to 3.18.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-version: 3.18.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 11:31:07 +02:00
dependabot[bot] 67f18696e2
Bump @octokit/request from 8.1.4 to 8.4.1 (#245)
Bumps [@octokit/request](https://github.com/octokit/request.js) from 8.1.4 to 8.4.1.
- [Release notes](https://github.com/octokit/request.js/releases)
- [Commits](https://github.com/octokit/request.js/compare/v8.1.4...v8.4.1)

---
updated-dependencies:
- dependency-name: "@octokit/request"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 11:29:23 +02:00
dependabot[bot] 3265345995
Bump undici from 5.28.4 to 5.29.0 (#254)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.29.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.29.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 11:15:40 +02:00
dependabot[bot] bd9ece3d5b
Bump actions/setup-java from 4 to 5 (#260)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 06:14:52 -03:00
dependabot[bot] 2cdc4b541f
Bump actions/checkout from 4 to 5 (#261)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 11:08:02 +02:00
dependabot[bot] 2fc8e72d6d
Bump eslint from 9.13.0 to 9.34.0 (#262)
Bumps [eslint](https://github.com/eslint/eslint) from 9.13.0 to 9.34.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.13.0...v9.34.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 9.34.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 11:06:06 +02:00
Pierre-Hugues Laune 1a128e49c0
feat: ignore flaky tests (#238)
Added a new optional parameter ignore_flaky_tests which is "false" by default (current behavior)
When set to "true" : flaky tests are considered as success and will generate a successful report

---------

Co-authored-by: Ghais Zaher <ghaiszaher@gmail.com>
2025-01-08 09:30:01 +01:00
dependabot[bot] 6966497014
Bump eslint from 9.11.1 to 9.13.0 (#232)
Bumps [eslint](https://github.com/eslint/eslint) from 9.11.1 to 9.13.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.11.1...v9.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-03 20:38:25 +01:00
dependabot[bot] 6e69e96316
Bump @octokit/fixtures from 23.0.0 to 23.1.1 (#210)
Bumps [@octokit/fixtures](https://github.com/octokit/fixtures) from 23.0.0 to 23.1.1.
- [Release notes](https://github.com/octokit/fixtures/releases)
- [Commits](https://github.com/octokit/fixtures/compare/v23.0.0...v23.1.1)

---
updated-dependencies:
- dependency-name: "@octokit/fixtures"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 08:57:09 +01:00
dependabot[bot] f7d3eb51ad
Bump eslint from 9.6.0 to 9.11.1 (#229)
Bumps [eslint](https://github.com/eslint/eslint) from 9.6.0 to 9.11.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.6.0...v9.11.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 08:56:37 +01:00
dependabot[bot] 7b2af11512
Bump nock from 14.0.0-beta.5 to 14.0.0-beta.14 (#228)
Bumps [nock](https://github.com/nock/nock) from 14.0.0-beta.5 to 14.0.0-beta.14.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v14.0.0-beta.5...v14.0.0-beta.14)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 08:56:21 +01:00
tinyboxvk b8621febee
Update actions/checkout to v4 in README.md (#231) 2024-10-28 08:55:41 +01:00
dependabot[bot] 87fddf2d4c
Bump commons-io:commons-io in /integration-tests/maven (#230)
Bumps commons-io:commons-io from 2.7 to 2.14.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 09:37:10 +02:00
dependabot[bot] 199051a14a
Bump braces from 3.0.2 to 3.0.3 (#217)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 10:51:10 +02:00
dependabot[bot] 571e1c7564
Bump eslint from 8.57.0 to 9.6.0 (#219)
* Bump eslint from 8.57.0 to 9.6.0

Bumps [eslint](https://github.com/eslint/eslint) from 8.57.0 to 9.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.57.0...v9.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Migrate eslint

* adjust `eslint.config.js`

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carlos Ferreyra <carlos.ferreyra.external@scalable.capital>
Co-authored-by: Ghais Zaher <ghaiszaher@gmail.com>
2024-07-02 14:24:34 -03:00
dependabot[bot] 1779a538c8
Bump undici from 5.28.3 to 5.28.4 (#208)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.3...v5.28.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 16:02:01 -03:00
dependabot[bot] 6f22747ddf
Bump eslint from 8.56.0 to 8.57.0 (#204)
Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 12:39:06 +02:00
dependabot[bot] a16fc5026c
Bump nock from 14.0.0-beta.3 to 14.0.0-beta.5 (#206)
Bumps [nock](https://github.com/nock/nock) from 14.0.0-beta.3 to 14.0.0-beta.5.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v14.0.0-beta.3...v14.0.0-beta.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 12:38:29 +02:00
dependabot[bot] 1a4864283d
Bump @octokit/fixtures from 22.0.7 to 23.0.0 (#207)
Bumps [@octokit/fixtures](https://github.com/octokit/fixtures) from 22.0.7 to 23.0.0.
- [Release notes](https://github.com/octokit/fixtures/releases)
- [Commits](https://github.com/octokit/fixtures/compare/v22.0.7...v23.0.0)

---
updated-dependencies:
- dependency-name: "@octokit/fixtures"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 07:35:47 -03:00
dependabot[bot] ce87cc29c8
Bump undici from 5.26.4 to 5.28.3 (#203)
Bumps [undici](https://github.com/nodejs/undici) from 5.26.4 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.26.4...v5.28.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-21 19:08:19 +01:00
Ghais Zaher a2911bd1a4
chore: upgrade to node 20 (#185)
Upgrade all dependencies to latest versions
Upgrade to Node 20
2024-02-21 11:22:35 +01:00
scalable-atlantis[bot] c9aa8e4c61 GHA: Copilot contributor check
See https://github.com/ScaCap/terraform/pull/13918/ for more details.
2024-02-06 07:55:29 +00:00
dependabot[bot] 4960c6f72d
Bump actions/setup-java from 3 to 4 (#194)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-03 22:56:09 +01:00
Ghais Zaher 687f107f48
GH-184: ignore incompatible XML reports (#198)
Fixes #184

Ignore files that don't have testsuites
Reorganize the folders
2024-01-15 14:59:51 +01:00
dependabot[bot] a27556b71f
Bump eslint from 8.54.0 to 8.56.0 (#196)
Bumps [eslint](https://github.com/eslint/eslint) from 8.54.0 to 8.56.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.54.0...v8.56.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 13:34:41 +01:00
dependabot[bot] 9e99e42245
Bump actions/setup-go from 4 to 5 (#195)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 13:34:23 +01:00
PlatformEngineering b51833dace GHA: Copilot contributor check
See https://github.com/ScaCap/terraform/pull/13918/ for more details.
2023-12-19 16:35:00 +00:00
dependabot[bot] 21d3eaf2ba
Bump eslint from 8.52.0 to 8.54.0 (#193)
Bumps [eslint](https://github.com/eslint/eslint) from 8.52.0 to 8.54.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.52.0...v8.54.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 12:23:47 +01:00
dependabot[bot] 7f7a8752e7
Bump @actions/core from 1.10.0 to 1.10.1 (#192)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.0 to 1.10.1.
- [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-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 12:23:21 +01:00
dependabot[bot] b733e5fa06
Bump actions/setup-node from 3 to 4 (#191)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-02 15:30:20 +01:00
dependabot[bot] d949797a56
Bump eslint from 8.45.0 to 8.52.0 (#190)
Bumps [eslint](https://github.com/eslint/eslint) from 8.45.0 to 8.52.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.52.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-02 12:21:01 +01:00
dependabot[bot] 2b73eae2a1
Bump nock from 13.3.3 to 13.3.7 (#189)
Bumps [nock](https://github.com/nock/nock) from 13.3.3 to 13.3.7.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.3.3...v13.3.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-02 12:13:34 +01:00
dependabot[bot] 9c98777b5e
Bump @babel/traverse from 7.22.8 to 7.23.2 (#187)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.8 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-20 09:47:32 +02:00
Ghais Zaher cd2404de99
Revert "Bump @octokit/rest from 19.0.11 to 20.0.2 (#179)" (#186)
This reverts commit 09ce9cb18e.
2023-10-06 14:27:50 +02:00
dependabot[bot] e882a15498
Bump actions/checkout from 3 to 4 (#183)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-06 09:37:42 +02:00
dependabot[bot] 09ce9cb18e
Bump @octokit/rest from 19.0.11 to 20.0.2 (#179)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 19.0.11 to 20.0.2.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v19.0.11...v20.0.2)

---
updated-dependencies:
- dependency-name: "@octokit/rest"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-06 09:37:08 +02:00
dependabot[bot] 8b7ece62e6
Bump nock from 13.3.2 to 13.3.3 (#177)
Bumps [nock](https://github.com/nock/nock) from 13.3.2 to 13.3.3.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.3.2...v13.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-06 09:36:48 +02:00
dependabot[bot] 6efd3d10b5
Bump nock from 13.3.1 to 13.3.2 (#173)
Bumps [nock](https://github.com/nock/nock) from 13.3.1 to 13.3.2.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.3.1...v13.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 13:06:08 +02:00
dependabot[bot] cb8fa567f8
Bump jest from 29.5.0 to 29.6.1 (#172)
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.5.0 to 29.6.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.6.1/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 09:56:25 +02:00
dependabot[bot] aa43217b5c
Bump @octokit/plugin-retry from 4.1.6 to 6.0.0 (#168)
* Bump @octokit/plugin-retry from 4.1.6 to 6.0.0

Bumps [@octokit/plugin-retry](https://github.com/octokit/plugin-retry.js) from 4.1.6 to 6.0.0.
- [Release notes](https://github.com/octokit/plugin-retry.js/releases)
- [Commits](https://github.com/octokit/plugin-retry.js/compare/v4.1.6...v6.0.0)

---
updated-dependencies:
- dependency-name: "@octokit/plugin-retry"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* `npm run package`

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ghais Zaher <ghaiszaher@gmail.com>
2023-07-19 09:55:28 +02:00
dependabot[bot] 372a0a3ce6
Bump eslint from 8.41.0 to 8.45.0 (#169)
Bumps [eslint](https://github.com/eslint/eslint) from 8.41.0 to 8.45.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.41.0...v8.45.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 09:52:27 +02:00
dependabot[bot] e7304b1507
Bump word-wrap from 1.2.3 to 1.2.4 (#171)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 09:44:25 +02:00
Ghais Zaher 901f7f3fb7
fix: fall back to test case name if message is empty (#164)
* Related to https://github.com/ScaCap/action-surefire-report/issues/161
* Fixes failure when `message` is empty (which is required https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#update-a-check-run)
* Updates dependencies
2023-07-18 17:30:14 +02:00
dependabot[bot] 78edec6077
Bump eslint from 8.33.0 to 8.40.0 (#160)
Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.40.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.33.0...v8.40.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-10 16:07:35 +02:00
dependabot[bot] 6408e20d8a
Bump jest-junit from 15.0.0 to 16.0.0 (#157)
Bumps [jest-junit](https://github.com/jest-community/jest-junit) from 15.0.0 to 16.0.0.
- [Release notes](https://github.com/jest-community/jest-junit/releases)
- [Commits](https://github.com/jest-community/jest-junit/compare/v15.0.0...v16.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-09 08:24:35 +02:00
Ghais Zaher 3163ccef2b
fix: mention required permissions in documentation (#155) 2023-04-17 17:24:35 +02:00
dependabot[bot] 2c1664c634
Bump actions/setup-go from 3 to 4 (#152)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-04 09:23:15 +02:00
Jan Waś 48452168d9
Revert libxml (#147)
* Revert "Run the action in a container (#141)"

This reverts commit 01b27826d2.

* Revert "Avoid huge input lookup errors (#144)"

This reverts commit 7263a78ba0.

* Revert "Use a more efficient xml parser library (#138)"

This reverts commit 5b7a533e50.
2023-03-13 12:59:42 +01:00
Jan Waś 7263a78ba0
Avoid huge input lookup errors (#144) 2023-03-10 13:02:27 +01:00
Jan Waś 01b27826d2
Run the action in a container (#141) 2023-03-09 15:58:13 +01:00
Jan Waś 5b7a533e50
Use a more efficient xml parser library (#138) 2023-03-09 12:40:18 +01:00
QuietBird a2d14baac0
Use package to determine path (#61)
Problem: If you have two classes with the same name, but in different packages, results of tests are shown for the first one found
2023-02-27 14:42:10 +01:00
Yeikel 4cbb611f23
feat: Add support for Github Enterprise (#126)
* feat: Add support for Github Enterprise

* Test

* Update action.yml

Co-authored-by: Ghais Zaher <ghaiszaher@gmail.com>

* Update README.md

Co-authored-by: Ghais Zaher <ghaiszaher@gmail.com>

---------

Co-authored-by: Ghais Zaher <ghaiszaher@gmail.com>
2023-02-16 18:51:04 +01:00
Yeikel 885c9c7983
ci: use built in dependency caching and use temurin (#129) 2023-02-16 18:50:23 +01:00
Ghais Zaher 86765bf9ff
chore: update all dependencies (#124)
* chore: update all dependencies

* `npm run package`
2023-02-10 16:18:00 +01:00
Yeikel 3c98463190
docs: update expression (#122)
if a job is aborted or suffers a critical failure, `always()` is not appropriate 

> always
> Causes the step to always execute, and returns true, even when canceled. The always expression is best used at the step level or on tasks that you expect to run even when a job is canceled. For example, you can use always to send logs even when a job is canceled.



> Note: Avoid using always for any task that could suffer from a critical failure, for example: getting sources, otherwise the workflow may hang until it times out. If you want to run a job or step regardless of its success or failure, use the recommended alternative:if: success() || failure()

Source: https://docs.github.com/en/actions/learn-github-actions/expressions#always
2023-02-10 09:50:37 +01:00
dependabot[bot] fa84819064
Bump eslint from 8.30.0 to 8.31.0 (#114)
Bumps [eslint](https://github.com/eslint/eslint) from 8.30.0 to 8.31.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.30.0...v8.31.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-04 14:11:52 +01:00
Jan Waś be8172cc30
Add automatic retries when talking to Github API (#82) 2023-01-03 16:35:12 +01:00
Ghais Zaher 522da11899
chore: support go-junit-report (#111) 2022-12-28 07:58:33 +01:00
Jan Waś 25872e3ced
Allow updating existing checks (#81) 2022-12-26 19:37:04 +01:00
dependabot[bot] ad2418953f
Bump eslint from 8.3.0 to 8.30.0 (#108)
Bumps [eslint](https://github.com/eslint/eslint) from 8.3.0 to 8.30.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.3.0...v8.30.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-23 17:35:29 +01:00
Ghais Zaher 73f631504e
fix: dependabot & fixes to build workflow (#100)
Add dependabot.yml
Upgrade actions in build.yml
Use correct permissions
2022-12-23 17:26:57 +01:00
Renato Abreu 4a5ec3cb2a
chore: Upgrade jest dependencies & fix all vulnerabilities (#102)
* Trigger run

* Bump @actions/core

* Bump @actions/glob

* Add PR template

* Replace @zeit/ncc

* Update eslint

* Bump jest

* Merge

* Bump @actions/github
2022-12-23 15:38:57 +01:00
Ghais Zaher 81b1db734f
chore: add code owners (#99)
* chore: add code owners

* Trigger actions

Co-authored-by: Renato Abreu <renatoabreu1196@gmail.com>
2022-12-23 14:28:36 +01:00
Renato Abreu 7de9f0c20e
chore: Trigger run with node 16 & bump @actions/core to latest version (#101)
* Trigger run

* Bump @actions/core

* Bump @actions/glob

* Add PR template

* Replace @zeit/ncc

* Update eslint
2022-12-23 13:04:11 +01:00
dependabot[bot] 695d78b965
Bump decode-uri-component from 0.2.0 to 0.2.2 (#96)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-23 12:21:02 +01:00
dependabot[bot] 8646b76a75
Bump qs from 6.5.2 to 6.5.3 (#97)
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-23 12:15:35 +01:00
dependabot[bot] f01db0d1e6
Bump tmpl from 1.0.4 to 1.0.5 (#76)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-22 14:02:39 +02:00
dependabot[bot] 09bb5e16ab
Bump nth-check from 2.0.0 to 2.0.1 (#77)
Bumps [nth-check](https://github.com/fb55/nth-check) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/fb55/nth-check/releases)
- [Commits](https://github.com/fb55/nth-check/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: nth-check
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-22 14:02:22 +02:00
dependabot[bot] 482f012643
Bump path-parse from 1.0.6 to 1.0.7 (#74)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-17 14:59:55 +02:00
Juraj Misur 931cea1ce1
Revert build branch 2021-06-14 12:12:36 +02:00
Juraj Misur 6874623c31
revert build branch (#69) 2021-06-14 12:10:23 +02:00
Juraj Misur f1428434ae
npm audit fix (#68) 2021-06-14 12:08:43 +02:00
Ghais Zaher 9fb92762fe
fix: exclude .class files when resolving path (#65)
Co-authored-by: Juraj Misur <juraj@scalable.capital>
2021-06-07 14:21:05 +02:00
Juraj Misur f0a1b40820
skip_publishing (#62)
Co-authored-by: ginxo <emingora@redhat.com>
2021-05-26 13:25:22 +02:00
dependabot[bot] f049c0b8a0
Bump commons-io from 2.5 to 2.7 in /tests (#55)
Bumps commons-io from 2.5 to 2.7.

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 10:17:03 +02:00
dependabot[bot] bfe48bdadd
Bump lodash from 4.17.20 to 4.17.21 (#58)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Juraj Misur <juraj@scalable.capital>
2021-05-25 09:49:12 +02:00
45 changed files with 40300 additions and 32354 deletions

View File

@ -1 +0,0 @@
dist/*

View File

@ -1,19 +0,0 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"indent": 2
}
}

1
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1 @@
* @ScaCap/action-surefire-report-maintainers

5
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,5 @@
### What
// Describe what this PR should do
### How
// Describe how you implemented it

11
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

View File

@ -5,42 +5,55 @@ on:
branches:
- master
concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
group: ${{ github.ref }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-main-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-main-maven-
- uses: actions/setup-java@v1
- uses: actions/checkout@v5
- uses: actions/setup-java@v5
with:
java-version: 8
- run: cd tests && mvn clean test --batch-mode -Dmaven.test.failure.ignore=true
- uses: scacap/action-surefire-report@master
if: endsWith(github.ref, 'master') == false
distribution: 'temurin'
cache: 'maven'
- run: cd integration-tests/maven && mvn clean verify --batch-mode -Dmaven.test.failure.ignore=true
- uses: ./
if: github.ref != 'refs/heads/master'
with:
check_name: Example Surefire Test Report
report_paths: '**/surefire-reports/*.xml, **/failsafe-reports/*.xml'
- uses: cclauss/GitHub-Action-for-pytest@0.5.0
with:
args: pytest --junit-xml=python/report.xml python/ || exit 0
- uses: scacap/action-surefire-report@master
if: endsWith(github.ref, 'master') == false
args: pytest integration-tests/python/ --junit-xml=integration-tests/python/report.xml || exit 0
- uses: ./
if: github.ref != 'refs/heads/master'
with:
check_name: Example Pytest Report
report_paths: python/report.xml
- uses: actions/setup-node@v1
report_paths: integration-tests/python/report.xml
- uses: actions/setup-go@v5
with:
node-version: 12
- uses: actions/cache@v1
go-version: 1.21.x
- run: |
cd integration-tests/go &&
go install github.com/jstemmer/go-junit-report/v2@latest &&
go test -v 2>&1 ./... |
go-junit-report -out report.xml
- uses: ./
if: github.ref != 'refs/heads/master'
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-cache-
check_name: Example Go Report
report_paths: integration-tests/go/report.xml
file_name_in_stack_trace: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm install
- run: npm run eslint
- run: npm run test

1
.npmrc Normal file
View File

@ -0,0 +1 @@
save-exact = true

View File

@ -13,6 +13,10 @@ This action processes maven surefire or failsafe XML reports on pull requests an
Optional. [Glob](https://github.com/actions/toolkit/tree/master/packages/glob) expression to surefire or failsafe report paths. The default is `**/surefire-reports/TEST-*.xml`.
### `create_check`
Optional. Set to `false` to add annotations to the current job where this action is being executed. The default is `true`.
### `check_name`
Optional. Check name to use when creating a check run. The default is `Test Report`.
@ -29,10 +33,27 @@ Optional. Check will fail if there are test failures. The default is `false`.
Optional. Check will fail if no tests were found. The default is `true`.
### `ignore_flaky_tests`
Optional. Set to `true` to consider flaky tests as success. The default is `false`.
### `skip_publishing`
Optional. Skip the test report publishing (check run creation). The default is `false`.
### `github_token`
Optional. Usually in form of `github_token: ${{ secrets.GITHUB_TOKEN }}`. The default is `${{ github.token }}`.
### `file_name_in_stack_trace`
Optional. Set to `true` to get the file name from the stack trace. The default is `false`.
### `github_base_url`
Optional: If you use GitHub Enterprise, you can set this to the URL of your server (e.g. https://github.myorg.com/api/v3).
## Example usage
```yml
@ -44,13 +65,17 @@ jobs:
build:
name: Build and Run Tests
runs-on: ubuntu-latest
# Permissions block is optional, useful for dependabot checks
permissions:
checks: write
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Build and Run Tests
run: mvn test --batch-mode --fail-at-end
- name: Publish Test Report
if: ${{ always() }}
if: success() || failure()
uses: scacap/action-surefire-report@v1
```

111
action.js
View File

@ -1,56 +1,111 @@
const core = require('@actions/core');
const github = require('@actions/github');
const { Octokit } = require("@octokit/rest");
const { retry } = require("@octokit/plugin-retry");
const RetryingOctokit = Octokit.plugin(retry);
const { parseTestReports } = require('./utils.js');
const action = async () => {
const reportPaths = core.getInput('report_paths').split(',').join('\n');
core.info(`Going to parse results form ${reportPaths}`);
const githubToken = core.getInput('github_token');
const createCheck = (core.getInput('create_check') || 'true') === 'true';
const name = core.getInput('check_name');
const commit = core.getInput('commit');
const failOnFailedTests = core.getInput('fail_on_test_failures') === 'true';
const failIfNoTests = core.getInput('fail_if_no_tests') === 'true';
const ignoreFlakyTests = core.getInput('ignore_flaky_tests') === 'true';
const skipPublishing = core.getInput('skip_publishing') === 'true';
const isFilenameInStackTrace = core.getInput('file_name_in_stack_trace') === 'true';
const githubBaseUrl = core.getInput('github_base_url');
let { count, skipped, annotations } = await parseTestReports(reportPaths);
let { count, skipped, annotations } = await parseTestReports(reportPaths, isFilenameInStackTrace, ignoreFlakyTests);
const foundResults = count > 0 || skipped > 0;
const title = foundResults
? `${count} tests run, ${skipped} skipped, ${annotations.length} failed.`
: 'No test results found!';
core.info(`Result: ${title}`);
const pullRequest = github.context.payload.pull_request;
const link = (pullRequest && pullRequest.html_url) || github.context.ref;
const conclusion =
(foundResults && annotations.length === 0) || (!foundResults && !failIfNoTests)
? 'success'
: 'failure';
const status = 'completed';
const head_sha = commit || (pullRequest && pullRequest.head.sha) || github.context.sha;
core.info(
`Posting status '${status}' with conclusion '${conclusion}' to ${link} (sha: ${head_sha})`
);
const createCheckRequest = {
...github.context.repo,
name,
head_sha,
status,
conclusion,
output: {
title,
summary: '',
annotations: annotations.slice(0, 50)
function buildRetryingOctokitClient() {
const baseRequest = { auth: githubToken, request: { retries: 3 } };
if (githubBaseUrl){
baseRequest.baseUrl = githubBaseUrl;
}
};
core.debug(JSON.stringify(createCheckRequest, null, 2));
return new RetryingOctokit(baseRequest)
}
if (!skipPublishing) {
const title = foundResults
? `${count} tests run, ${skipped} skipped, ${annotations.length} failed.`
: 'No test results found!';
core.info(`Result: ${title}`);
const pullRequest = github.context.payload.pull_request;
const link = (pullRequest && pullRequest.html_url) || github.context.ref;
const status = 'completed';
const head_sha = commit || (pullRequest && pullRequest.head.sha) || github.context.sha;
const octokit = buildRetryingOctokitClient();
if (createCheck) {
core.info(`Posting status '${status}' with conclusion '${conclusion}' to ${link} (sha: ${head_sha})`);
const createCheckRequest = {
...github.context.repo,
name,
head_sha,
status,
conclusion,
output: {
title,
summary: '',
annotations: annotations.slice(0, 50)
}
};
core.debug(JSON.stringify(createCheckRequest, null, 2));
await octokit.rest.checks.create(createCheckRequest);
} else {
const { data: {check_runs: check_runs} } = await octokit.rest.checks.listForRef({
...github.context.repo,
check_name: name,
ref: head_sha,
status: 'in_progress'
})
core.debug(JSON.stringify(check_runs, null, 2));
if (check_runs.length === 0) {
core.setFailed(`Did not find any in progress '${name}' check for sha ${head_sha}`);
return;
}
if (check_runs.length !== 1) {
core.setFailed(`Found multiple in progress '${name}' checks for sha ${head_sha}`);
return;
}
const check_run = check_runs[0];
core.info(`Patching '${name}' check for ${link} (sha: ${head_sha})`);
const updateCheckRequest = {
...github.context.repo,
check_run_id: check_run.id,
output: {
title: check_run.output.title || title,
summary: check_run.output.summary || '',
annotations: annotations.slice(0, 50)
}
};
core.debug(JSON.stringify(updateCheckRequest, null, 2));
await octokit.rest.checks.update(updateCheckRequest);
}
} else {
core.info('Not publishing test result due to skip_publishing=true');
}
// make conclusion consumable by downstream actions
core.setOutput('conclusion', conclusion);
const octokit = new github.GitHub(githubToken);
await octokit.checks.create(createCheckRequest);
// optionally fail the action if tests fail
if (failOnFailedTests && conclusion !== 'success') {
core.setFailed(`There were ${annotations.length} failed tests`);

View File

@ -4,12 +4,12 @@ const finishedWithFailures = {
status: 'completed',
conclusion: 'failure',
output: {
title: '17 tests run, 1 skipped, 11 failed.',
title: '20 tests run, 1 skipped, 13 failed.',
summary: '',
annotations: [
{
path:
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
start_line: 39,
end_line: 39,
start_column: 0,
@ -22,7 +22,7 @@ const finishedWithFailures = {
},
{
path:
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
start_line: 49,
end_line: 49,
start_column: 0,
@ -35,7 +35,7 @@ const finishedWithFailures = {
},
{
path:
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
start_line: 57,
end_line: 57,
start_column: 0,
@ -48,7 +48,7 @@ const finishedWithFailures = {
},
{
path:
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
start_line: 18,
end_line: 18,
start_column: 0,
@ -61,7 +61,7 @@ const finishedWithFailures = {
},
{
path:
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
start_line: 32,
end_line: 32,
start_column: 0,
@ -74,7 +74,7 @@ const finishedWithFailures = {
},
{
path:
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
start_line: 25,
end_line: 25,
start_column: 0,
@ -88,7 +88,7 @@ const finishedWithFailures = {
},
{
path:
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java',
start_line: 66,
end_line: 66,
start_column: 0,
@ -100,7 +100,31 @@ const finishedWithFailures = {
"action.surefire.report.email.InvalidEmailAddressException: Invalid email address '.user@host.com'\n\tat action.surefire.report.email.EmailAddressTest.expectException(EmailAddressTest.java:74)\n\tat action.surefire.report.email.EmailAddressTest.shouldNotAllowDotsInWeirdPlaces(EmailAddressTest.java:66)"
},
{
path: 'tests/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
path:
'integration-tests/maven/evil_twins/src/test/java/action/surefire/report/twin/second/TwinTest.java',
start_line: 13,
end_line: 13,
start_column: 0,
end_column: 0,
annotation_level: 'failure',
title: 'TwinTest.should_always_fail',
message: "Expected: \"Good Twin\"\n but: was \"Evil Twin\"",
raw_details:
"java.lang.AssertionError: \n\nExpected: \"Good Twin\"\n but: was \"Evil Twin\"\n\tat action.surefire.report.twin.second.TwinTest.should_always_fail(TwinTest.java:13)"
},
{
path: 'integration-tests/maven/flakes/src/test/java/action/surefire/report/calc/AllOkWithFlakesTest.java',
start_line: 1,
end_line: 1,
start_column: 0,
end_column: 0,
annotation_level: 'failure',
title: 'AllOkWithFlakesTest.firstTryFailSecondTrySuccess',
message: 'firstTryFailSecondTrySuccess',
raw_details: ""
},
{
path: 'integration-tests/maven/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
start_line: 27,
end_line: 27,
start_column: 0,
@ -113,7 +137,7 @@ const finishedWithFailures = {
'java.lang.AssertionError: unexpected exception type thrown; expected:<java.lang.IllegalStateException> but was:<java.lang.IllegalArgumentException>\n\tat action.surefire.report.calc.CalcUtilsTest.test error handling(CalcUtilsTest.kt:27)\nCaused by: java.lang.IllegalArgumentException: Amount must have max 2 non-zero decimal places\n\tat action.surefire.report.calc.CalcUtilsTest.scale(CalcUtilsTest.kt:31)\n\tat action.surefire.report.calc.CalcUtilsTest.access$scale(CalcUtilsTest.kt:9)\n\tat action.surefire.report.calc.CalcUtilsTest.test error handling(CalcUtilsTest.kt:27)'
},
{
path: 'tests/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
path: 'integration-tests/maven/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
start_line: 15,
end_line: 15,
start_column: 0,
@ -125,7 +149,7 @@ const finishedWithFailures = {
'java.lang.AssertionError: \n\nExpected: <100.10>\n but: was <100.11>\n\tat action.surefire.report.calc.CalcUtilsTest.test scale(CalcUtilsTest.kt:15)'
},
{
path: 'tests/utils/src/test/java/action/surefire/report/calc/StringUtilsTest.java',
path: 'integration-tests/maven/utils/src/test/java/action/surefire/report/calc/StringUtilsTest.java',
start_line: 27,
end_line: 27,
start_column: 0,
@ -138,7 +162,7 @@ const finishedWithFailures = {
'java.lang.AssertionError: \n\nExpected: (an instance of java.lang.IllegalArgumentException and exception with message a string containing "This is unexpected")\n but: exception with message a string containing "This is unexpected" message was "Input=\'\' didn\'t match condition."\nStacktrace was: java.lang.IllegalArgumentException: Input=\'\' didn\'t match condition.\n\tat action.surefire.report.calc.StringUtils.requireNotBlank(StringUtils.java:25)\n\tat action.surefire.report.calc.StringUtils.requireNotBlank(StringUtils.java:18)\n\tat action.surefire.report.calc.StringUtilsTest.require_fail(StringUtilsTest.java:27)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n\tat org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:258)\n\tat org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)\n\tat org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)\n\tat org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)\n\tat org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)\n\tat org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:413)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)\n\tat org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)'
},
{
path: 'tests/utils/src/test/java/action/surefire/report/calc/StringUtilsTest.java',
path: 'integration-tests/maven/utils/src/test/java/action/surefire/report/calc/StringUtilsTest.java',
start_line: 20,
end_line: 20,
start_column: 0,

View File

@ -12,9 +12,15 @@ const {
jest.setTimeout(20000);
let inputs = {};
let outputs = {};
let failed = null;
let inputs;
let outputs;
let failed;
beforeEach(() => {
inputs = {};
outputs = {};
failed = null;
});
describe('action should work', () => {
beforeAll(() => {
@ -37,6 +43,7 @@ describe('action should work', () => {
jest.spyOn(core, 'debug').mockImplementation(jest.fn());
github.context.payload.pull_request = {
id: 1,
html_url: 'https://github.com/scacap/action-surefire-report',
head: { sha: 'sha123' }
};
@ -55,7 +62,8 @@ describe('action should work', () => {
report_paths: '**/surefire-reports/TEST-*.xml, **/failsafe-reports/TEST-*.xml',
github_token: 'GITHUB_TOKEN',
check_name: 'Test Report',
fail_if_no_tests: 'true'
fail_if_no_tests: 'true',
skip_publishing: 'false'
};
// Reset outputs
@ -99,6 +107,24 @@ describe('action should work', () => {
expect(failed).toBeNull();
});
it('should send all ok if tests were flaky and ignore_flaky_test is true', async () => {
inputs.report_paths = '**/surefire-reports/TEST-*AllOkWithFlakesTest.xml';
inputs.ignore_flaky_tests = 'true';
let request = null;
const scope = nock('https://api.github.com')
.post('/repos/scacap/action-surefire-report/check-runs', body => {
request = body;
return body;
})
.reply(200, {});
await action();
scope.done();
expect(request).toStrictEqual(finishedSuccess);
expect(outputs).toHaveProperty('conclusion', 'success');
expect(failed).toBeNull();
});
it('should send failure if no test results were found', async () => {
inputs.report_paths = '**/xxx/*.xml';
let request = null;
@ -149,6 +175,14 @@ describe('action should work', () => {
scope.done();
expect(request).toStrictEqual(masterSuccess);
});
it('should not send report on skip_publishing', async () => {
inputs.skip_publishing = 'true';
// nock error if the request is sent
await action();
});
describe('with option fail_on_test_failures', () => {
@ -175,7 +209,49 @@ describe('action should work', () => {
await action();
scope.done();
expect(failed).toBe('There were 11 failed tests');
expect(failed).toBe('There were 13 failed tests');
});
});
describe('with option create_check=false', () => {
it('should parse surefire reports and update a check run', async () => {
inputs.create_check = 'false';
inputs.check_name = 'build';
github.context.sha = 'sha123';
github.context.job = 'build'
let request = null;
const getRuns = nock('https://api.github.com')
.get('/repos/scacap/action-surefire-report/commits/sha123/check-runs?check_name=build&status=in_progress')
.reply(200, {
check_runs: [
{
id: 123,
output: {
title: finishedWithFailures.output.title,
summary: finishedWithFailures.output.summary
},
pull_requests: [
{
id: 1
}
]
}
]
});
const patchRun = nock('https://api.github.com')
.patch('/repos/scacap/action-surefire-report/check-runs/123', body => {
request = body;
return body;
})
.reply(200, {});
await action();
getRuns.done();
patchRun.done();
expect(request).toStrictEqual({output: finishedWithFailures.output});
expect(outputs).toHaveProperty('conclusion', 'failure');
expect(failed).toBeNull();
});
});
});

View File

@ -12,6 +12,10 @@ inputs:
description: 'surefire/failsafe/junit compatible xml report paths in glob format'
required: false
default: '**/surefire-reports/TEST-*.xml, **/failsafe-reports/TEST-*.xml'
create_check:
description: 'create a new check with annotations'
required: false
default: 'true'
check_name:
description: 'check name for test reports'
required: false
@ -27,10 +31,27 @@ inputs:
description: 'fail run if there were no test results found'
required: false
default: 'true'
ignore_flaky_tests:
description: 'consider flaky tests as success'
required: false
default: 'false'
skip_publishing:
description: 'skip test report publishing'
required: false
default: 'false'
file_name_in_stack_trace:
description: 'get filename from stack trace'
required: false
default: 'false'
github_base_url:
description: 'if you use Github Enterprise, you can set this to the URL of your server (e.g. https://github.myorg.com/api/v3)'
required: false
default: ""
outputs:
outcome:
description: 'the test outcome, either `success` or `failure`'
runs:
using: 'node12'
using: 'node20'
main: 'dist/index.js'

60755
dist/index.js vendored

File diff suppressed because one or more lines are too long

30
eslint.config.js Normal file
View File

@ -0,0 +1,30 @@
const globals = require('globals');
const js = require('@eslint/js');
const {FlatCompat} = require('@eslint/eslintrc');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
module.exports = [{
ignores: ['dist/*'],
}, ...compat.extends('eslint:recommended'), {
languageOptions: {
globals: {
...globals.commonjs,
...globals.node,
...globals.jest,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
ecmaVersion: 2018,
sourceType: 'commonjs',
},
rules: {
indent: 2,
},
}];

View File

@ -0,0 +1,11 @@
module github.com/ScaCap/action-surefire-report
go 1.18
require github.com/stretchr/testify v1.8.1
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@ -0,0 +1,17 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -0,0 +1,13 @@
package main
import (
"testing"
)
func TestPassing(t *testing.T) {
t.Log("passing test")
}
func TestFailing(t *testing.T) {
t.Error("failing test")
}

View File

@ -0,0 +1,8 @@
package utils
import "testing"
import "github.com/stretchr/testify/assert"
func TestFailing(t *testing.T) {
assert.Equal(t, "1", "2")
}

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>tests</artifactId>
<groupId>action.surefire.report</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>evil_twins</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,8 @@
package action.surefire.report.twin.first;
public class Twin {
public String getName() {
return "Good Twin";
}
}

View File

@ -0,0 +1,8 @@
package action.surefire.report.twin.second;
public class Twin {
public String getName() {
return "Evil Twin";
}
}

View File

@ -0,0 +1,16 @@
package action.surefire.report.twin.first;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import org.junit.Test;
public class TwinTest {
@Test
public void should_always_pass() {
Twin goodTwin = new Twin();
assertThat(goodTwin.getName(), equalTo("Good Twin"));
}
}

View File

@ -0,0 +1,16 @@
package action.surefire.report.twin.second;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import org.junit.Test;
public class TwinTest {
@Test
public void should_always_fail() {
Twin evilTwin = new Twin();
assertThat(evilTwin.getName(), equalTo("Good Twin"));
}
}

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>tests</artifactId>
<groupId>action.surefire.report</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>flakes</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Duser.language=en</argLine>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<testFailureIgnore>true</testFailureIgnore>
<rerunFailingTestsCount>1</rerunFailingTestsCount>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,20 @@
package action.surefire.report.calc;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class AllOkWithFlakesTest {
private static boolean failTest = true;
@Test
public void firstTryFailSecondTrySuccess() {
if(failTest) {
failTest = false;
assertTrue(false);
} else {
assertTrue(true);
}
}
}

View File

@ -12,6 +12,8 @@
<modules>
<module>utils</module>
<module>email</module>
<module>evil_twins</module>
<module>flakes</module>
</modules>
<properties>
@ -19,6 +21,7 @@
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<kotlin.version>1.3.72</kotlin.version>
</properties>
<dependencyManagement>
@ -48,7 +51,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
@ -59,7 +62,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
<version>3.18.0</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -73,8 +76,22 @@
<configuration>
<argLine>-Duser.language=en</argLine>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -8,10 +8,6 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>utils</artifactId>
<properties>
<kotlin.version>1.3.72</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
@ -34,15 +30,10 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<artifactId>kotlin-test-junit</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
<build>

View File

@ -48,4 +48,4 @@ public class StringUtilsTest {
thrown.expectMessage("Input='' didn't match condition.");
StringUtils.requireNotBlank("");
}
}
}

11026
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -31,18 +31,20 @@
"titleTemplate": "{title}"
},
"dependencies": {
"@actions/core": "1.2.6",
"@actions/github": "2.2.0",
"@actions/glob": "0.1.1",
"@actions/core": "1.10.1",
"@actions/github": "6.0.0",
"@actions/glob": "0.5.0",
"@octokit/plugin-retry": "6.0.1",
"@octokit/rest": "20.0.2",
"xml-js": "1.6.11"
},
"devDependencies": {
"@octokit/fixtures": "21.3.1",
"@zeit/ncc": "0.22.3",
"@octokit/fixtures": "23.1.1",
"@vercel/ncc": "0.38.3",
"enzyme": "3.11.0",
"eslint": "7.17.0",
"jest": "26.6.3",
"jest-junit": "12.0.0",
"nock": "13.0.5"
"eslint": "9.34.0",
"jest": "29.7.0",
"jest-junit": "16.0.0",
"nock": "14.0.0-beta.14"
}
}

View File

@ -3,22 +3,31 @@ const core = require('@actions/core');
const fs = require('fs');
const parser = require('xml-js');
const resolveFileAndLine = (file, classname, output) => {
const resolveFileAndLine = (file, classname, output, isFilenameInOutput) => {
// extract filename from classname and remove suffix
const filename = file ? file : classname.split('.').slice(-1)[0].split('(')[0];
const matches = output.match(new RegExp(`${filename}.*?:\\d+`, 'g'));
if (!matches) return { filename: filename, line: 1 };
let filename;
let filenameWithPackage;
if (isFilenameInOutput) {
filename = output.split(':')[0].trim();
filenameWithPackage = filename;
} else {
filename = file ? file : classname.split('.').slice(-1)[0].split('(')[0];
filenameWithPackage = classname.replace(/\./g, '/');
}
const escapedFilename = filename.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const matches = output.match(new RegExp(`${escapedFilename}.*?:\\d+`, 'g'));
if (!matches) return {filename: filename, filenameWithPackage: filenameWithPackage, line: 1};
const [lastItem] = matches.slice(-1);
const [, line] = lastItem.split(':');
core.debug(`Resolved file ${filename} and line ${line}`);
core.debug(`Resolved file ${filenameWithPackage} with name ${filename} and line ${line}`);
return { filename, line: parseInt(line) };
return {filename, filenameWithPackage, line: parseInt(line)};
};
const resolvePath = async filename => {
core.debug(`Resolving path for ${filename}`);
const globber = await glob.create(`**/${filename}.*`, { followSymbolicLinks: false });
const resolvePath = async filenameWithPackage => {
core.debug(`Resolving path for ${filenameWithPackage}`);
const globber = await glob.create([`**/${filenameWithPackage}.*`, `**/${filenameWithPackage}`].join('\n'), {followSymbolicLinks: false});
const results = await globber.glob();
core.debug(`Matched files: ${results}`);
const searchPath = globber.getSearchPaths()[0];
@ -26,11 +35,11 @@ const resolvePath = async filename => {
let path = '';
if (results.length) {
// skip various temp folders
const found = results.find(r => !r.includes('__pycache__'));
const found = results.find(r => !r.includes('__pycache__') && !r.endsWith('.class'));
if (found) path = found.slice(searchPath.length + 1);
else path = filename;
else path = filenameWithPackage;
} else {
path = filename;
path = filenameWithPackage;
}
core.debug(`Resolved path: ${path}`);
@ -41,7 +50,20 @@ const resolvePath = async filename => {
return canonicalPath;
};
async function parseFile(file) {
function getTestsuites(report) {
if (report.testsuite) {
return [report.testsuite];
}
if (!report.testsuites || !report.testsuites.testsuite) {
return [];
}
if (Array.isArray(report.testsuites.testsuite)) {
return report.testsuites.testsuite;
}
return [report.testsuites.testsuite];
}
async function parseFile(file, isFilenameInStackTrace, ignoreFlakyTests) {
core.debug(`Parsing file ${file}`);
let count = 0;
let skipped = 0;
@ -49,12 +71,11 @@ async function parseFile(file) {
const data = await fs.promises.readFile(file);
const report = JSON.parse(parser.xml2json(data, { compact: true }));
const testsuites = report.testsuite
? [report.testsuite]
: Array.isArray(report.testsuites.testsuite)
? report.testsuites.testsuite
: [report.testsuites.testsuite];
const report = JSON.parse(parser.xml2json(data, {compact: true}));
core.debug(`parsed report: ${JSON.stringify(report)}`);
const testsuites = getTestsuites(report);
core.debug(`test suites: ${JSON.stringify(testsuites)}`);
for (const testsuite of testsuites) {
const testcases = Array.isArray(testsuite.testcase)
@ -65,7 +86,7 @@ async function parseFile(file) {
for (const testcase of testcases) {
count++;
if (testcase.skipped) skipped++;
if (testcase.failure || testcase.flakyFailure || testcase.error) {
if (testcase.failure || (testcase.flakyFailure && !ignoreFlakyTests) || testcase.error) {
let testcaseData =
(testcase.failure && testcase.failure._cdata) ||
(testcase.failure && testcase.failure._text) ||
@ -87,16 +108,18 @@ async function parseFile(file) {
(testcase.error &&
testcase.error._attributes &&
testcase.error._attributes.message) ||
stackTrace.split('\n').slice(0, 2).join('\n')
stackTrace.split('\n').slice(0, 2).join('\n') ||
testcase._attributes.name
).trim();
const { filename, line } = resolveFileAndLine(
const {filename, filenameWithPackage, line} = resolveFileAndLine(
testcase._attributes.file,
testcase._attributes.classname,
stackTrace
stackTrace,
isFilenameInStackTrace
);
const path = await resolvePath(filename);
const path = await resolvePath(filenameWithPackage);
const title = `${filename}.${testcase._attributes.name}`;
core.info(`${path}:${line} | ${message.replace(/\n/g, ' ')}`);
@ -114,22 +137,22 @@ async function parseFile(file) {
}
}
}
return { count, skipped, annotations };
return {count, skipped, annotations};
}
const parseTestReports = async reportPaths => {
const globber = await glob.create(reportPaths, { followSymbolicLinks: false });
const parseTestReports = async (reportPaths, isFilenameInStackTrace, ignoreFlakyTests) => {
const globber = await glob.create(reportPaths, {followSymbolicLinks: false});
let annotations = [];
let count = 0;
let skipped = 0;
for await (const file of globber.globGenerator()) {
const { count: c, skipped: s, annotations: a } = await parseFile(file);
if (c == 0) continue;
const {count: c, skipped: s, annotations: a} = await parseFile(file, isFilenameInStackTrace, ignoreFlakyTests);
if (c === 0) continue;
count += c;
skipped += s;
annotations = annotations.concat(a);
}
return { count, skipped, annotations };
return {count, skipped, annotations};
};
module.exports = { resolveFileAndLine, resolvePath, parseFile, parseTestReports };

View File

@ -15,7 +15,8 @@ describe('resolveFileAndLine', () => {
action.surefire.report.email.InvalidEmailAddressException: Invalid email address 'user@ñandú.com.ar'
at action.surefire.report.email.EmailAddressTest.expectException(EmailAddressTest.java:74)
at action.surefire.report.email.EmailAddressTest.shouldNotContainInternationalizedHostNames(EmailAddressTest.java:39)
`
`,
false,
);
expect(filename).toBe('EmailAddressTest');
expect(line).toBe(39);
@ -32,7 +33,8 @@ Caused by: java.lang.IllegalArgumentException: Amount must have max 2 non-zero d
at action.surefire.report.calc.CalcUtilsTest.scale(CalcUtilsTest.kt:31)
at action.surefire.report.calc.CalcUtilsTest.access$scale(CalcUtilsTest.kt:9)
at action.surefire.report.calc.CalcUtilsTest.test error handling(CalcUtilsTest.kt:27)
`
`,
false,
);
expect(filename).toBe('CalcUtilsTest');
expect(line).toBe(27);
@ -55,7 +57,8 @@ Stacktrace was: java.lang.IllegalArgumentException: Input='' didn't match condit
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
`
`,
false,
);
expect(filename).toBe('StringUtilsTest');
expect(line).toBe(26);
@ -73,38 +76,55 @@ event = { 'attr': 'test'}
E AttributeError: 'dict' object has no attribute 'attr'
test.py:14: AttributeError
`
`,
false
);
expect(filename).toBe('test.py');
expect(line).toBe(14);
});
it('should parse correctly filename and line for a Go file when filename is in stack trace', () => {
const {filename, line} = resolveFileAndLine(
null,
'com/ScaCap/action-surefire-report',
'main_test.go:8: failing test',
true,
);
expect(filename).toBe('main_test.go');
expect(line).toBe(8);
});
});
describe('resolvePath', () => {
it('should find correct file for Java filename', async () => {
const path = await resolvePath('EmailAddressTest');
expect(path).toBe(
'tests/email/src/test/java/action/surefire/report/email/EmailAddressTest.java'
'integration-tests/maven/email/src/test/java/action/surefire/report/email/EmailAddressTest.java'
);
});
it('should find correct file for Kotlin filename', async () => {
const path = await resolvePath('CalcUtilsTest');
expect(path).toBe('tests/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt');
expect(path).toBe('integration-tests/maven/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt');
});
it('should find correct file when extension is included', async () => {
const path = await resolvePath('CalcUtilsTest.kt');
expect(path).toBe('integration-tests/maven/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt');
});
});
describe('parseFile', () => {
it('should parse CalcUtils results', async () => {
const { count, skipped, annotations } = await parseFile(
'tests/utils/target/surefire-reports/TEST-action.surefire.report.calc.CalcUtilsTest.xml'
'integration-tests/maven/utils/target/surefire-reports/TEST-action.surefire.report.calc.CalcUtilsTest.xml'
);
expect(count).toBe(2);
expect(skipped).toBe(0);
expect(annotations).toStrictEqual([
{
path: 'tests/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
path: 'integration-tests/maven/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
start_line: 27,
end_line: 27,
start_column: 0,
@ -113,11 +133,10 @@ describe('parseFile', () => {
title: 'CalcUtilsTest.test error handling',
message:
'unexpected exception type thrown; expected:<java.lang.IllegalStateException> but was:<java.lang.IllegalArgumentException>',
raw_details:
'java.lang.AssertionError: unexpected exception type thrown; expected:<java.lang.IllegalStateException> but was:<java.lang.IllegalArgumentException>\n\tat action.surefire.report.calc.CalcUtilsTest.test error handling(CalcUtilsTest.kt:27)\nCaused by: java.lang.IllegalArgumentException: Amount must have max 2 non-zero decimal places\n\tat action.surefire.report.calc.CalcUtilsTest.scale(CalcUtilsTest.kt:31)\n\tat action.surefire.report.calc.CalcUtilsTest.access$scale(CalcUtilsTest.kt:9)\n\tat action.surefire.report.calc.CalcUtilsTest.test error handling(CalcUtilsTest.kt:27)'
raw_details: expect.stringContaining('at action.surefire.report.calc.CalcUtilsTest.test error handling(CalcUtilsTest.kt:27)')
},
{
path: 'tests/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
path: 'integration-tests/maven/utils/src/test/java/action/surefire/report/calc/CalcUtilsTest.kt',
start_line: 15,
end_line: 15,
start_column: 0,
@ -125,19 +144,18 @@ describe('parseFile', () => {
annotation_level: 'failure',
title: 'CalcUtilsTest.test scale',
message: 'Expected: <100.10>\n but: was <100.11>',
raw_details:
'java.lang.AssertionError: \n\nExpected: <100.10>\n but: was <100.11>\n\tat action.surefire.report.calc.CalcUtilsTest.test scale(CalcUtilsTest.kt:15)'
raw_details: expect.stringContaining('at action.surefire.report.calc.CalcUtilsTest.test scale(CalcUtilsTest.kt:15)')
}
]);
});
it('should parse pytest results', async () => {
const { count, skipped, annotations } = await parseFile('python/report.xml');
const { count, skipped, annotations } = await parseFile('integration-tests/python/report.xml');
expect(count).toBe(3);
expect(skipped).toBe(0);
expect(annotations).toStrictEqual([
{
path: 'python/test_sample.py',
path: 'integration-tests/python/test_sample.py',
start_line: 10,
end_line: 10,
start_column: 0,
@ -146,10 +164,10 @@ describe('parseFile', () => {
title: 'test_sample.test_which_fails',
message: "AssertionError: assert 'test' == 'xyz'\n - xyz\n + test",
raw_details:
"def test_which_fails():\n event = { 'attr': 'test'}\n> assert event['attr'] == 'xyz'\nE AssertionError: assert 'test' == 'xyz'\nE - xyz\nE + test\n\npython/test_sample.py:10: AssertionError"
"def test_which_fails():\n event = { 'attr': 'test'}\n> assert event['attr'] == 'xyz'\nE AssertionError: assert 'test' == 'xyz'\nE - xyz\nE + test\n\nintegration-tests/python/test_sample.py:10: AssertionError"
},
{
path: 'python/test_sample.py',
path: 'integration-tests/python/test_sample.py',
start_line: 14,
end_line: 14,
start_column: 0,
@ -158,20 +176,63 @@ describe('parseFile', () => {
title: 'test_sample.test_with_error',
message: "AttributeError: 'dict' object has no attribute 'attr'",
raw_details:
"def test_with_error():\n event = { 'attr': 'test'}\n> assert event.attr == 'test'\nE AttributeError: 'dict' object has no attribute 'attr'\n\npython/test_sample.py:14: AttributeError"
"def test_with_error():\n event = { 'attr': 'test'}\n> assert event.attr == 'test'\nE AttributeError: 'dict' object has no attribute 'attr'\n\nintegration-tests/python/test_sample.py:14: AttributeError"
}
]);
});
it('should parse go results', async () => {
const {count, skipped, annotations} = await parseFile('integration-tests/go/report.xml', true);
expect(count).toBe(3);
expect(skipped).toBe(0);
// noinspection RegExpRepeatedSpace
expect(annotations).toStrictEqual([
{
path: 'integration-tests/go/main_test.go',
start_line: 12,
end_line: 12,
start_column: 0,
end_column: 0,
annotation_level: 'failure',
title: 'main_test.go.TestFailing',
message: 'Failed',
raw_details: 'main_test.go:12: failing test'
},
{
path: 'integration-tests/go/utils/string_test.go',
start_line: 7,
end_line: 7,
start_column: 0,
end_column: 0,
annotation_level: 'failure',
title: 'string_test.go.TestFailing',
message: 'Failed',
raw_details: expect.stringMatching(new RegExp(`string_test.go:7:
\\s*Error Trace:.*action-surefire-report/integration-tests/go/utils/string_test.go:7
\\s*Error: \\s*Not equal:
\\s*expected: "1"
\\s*actual : "2"
\\s*
\\s*Diff:
\\s*--- Expected
\\s*\\+\\+\\+ Actual
\\s*@@ -1 \\+1 @@
\\s*-1
\\s*\\+2
\\s*Test:\\s*TestFailing`))
},
]);
});
it('should parse custom report with details as an array', async () => {
const { count, skipped, annotations } = await parseFile(
'custom_reports/TEST-pro.taskana.common.api.ListUtilTest-H2.xml'
'integration-tests/custom_reports/TEST-pro.taskana.common.api.ListUtilTest-H2.xml'
);
expect(count).toBe(1);
expect(skipped).toBe(0);
expect(annotations).toStrictEqual([
{
path: 'ListUtilTest',
path: 'pro/taskana/common/api/ListUtilTest(H2)',
start_line: 22,
end_line: 22,
start_column: 0,
@ -219,14 +280,14 @@ describe('parseFile', () => {
it('should parse custom report with flaky failures', async () => {
const { count, skipped, annotations } = await parseFile(
'custom_reports/TEST-test.MyIntegrationTestSuite.xml'
'integration-tests/custom_reports/TEST-test.MyIntegrationTestSuite.xml'
);
expect(count).toBe(5);
expect(skipped).toBe(0);
expect(annotations).toStrictEqual([
{
path: 'MyIntegrationTest',
path: 'test/MyIntegrationTest',
start_line: 1,
end_line: 1,
start_column: 0,
@ -240,7 +301,7 @@ describe('parseFile', () => {
raw_details: ''
},
{
path: 'DocumentUploadIntegrationTest',
path: 'test/DocumentUploadIntegrationTest',
start_line: 33,
end_line: 33,
start_column: 0,
@ -254,7 +315,7 @@ describe('parseFile', () => {
'\tat test.DocumentUploadIntegrationTest.shouldReturnBadRequestIfDocumentTypeIsInvalid(DocumentUploadIntegrationTest.java:33)'
},
{
path: 'DocumentUploadIntegrationTest',
path: 'test/DocumentUploadIntegrationTest',
start_line: 1,
end_line: 1,
start_column: 0,
@ -265,7 +326,7 @@ describe('parseFile', () => {
raw_details: ''
},
{
path: 'DocumentUploadIntegrationTest',
path: 'test/DocumentUploadIntegrationTest',
start_line: 47,
end_line: 47,
start_column: 0,