mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
commit
1e3a380fe6
19 changed files with 2679 additions and 6604 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
"i18n-text/no-en": "off",
|
"i18n-text/no-en": "off",
|
||||||
"eslint-comments/no-use": "off",
|
"eslint-comments/no-use": "off",
|
||||||
"import/no-namespace": "off",
|
"import/no-namespace": "off",
|
||||||
|
"import/no-named-as-default": "off",
|
||||||
"no-shadow": "off",
|
"no-shadow": "off",
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"prefer-template": "off",
|
"prefer-template": "off",
|
||||||
|
|
@ -60,29 +61,7 @@
|
||||||
},
|
},
|
||||||
"import/resolver": {
|
"import/resolver": {
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
"alwaysTryTypes": true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
||||||
|
|
||||||
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
||||||
|
|
||||||
// use <root>/path/to/folder/tsconfig.json
|
|
||||||
"project": "path/to/folder",
|
|
||||||
|
|
||||||
// Multiple tsconfigs (Useful for monorepos)
|
|
||||||
|
|
||||||
// use a glob pattern
|
|
||||||
"project": "packages/*/tsconfig.json",
|
|
||||||
|
|
||||||
// use an array
|
|
||||||
"project": [
|
|
||||||
"packages/module-a/tsconfig.json",
|
|
||||||
"packages/module-b/tsconfig.json"
|
|
||||||
],
|
|
||||||
|
|
||||||
// use an array of glob patterns
|
|
||||||
"project": [
|
|
||||||
"packages/*/tsconfig.json",
|
|
||||||
"other-packages/*/tsconfig.json"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
.github/dependabot.yml
vendored
Normal file
10
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
6
.github/workflows/check-dist.yml
vendored
6
.github/workflows/check-dist.yml
vendored
|
|
@ -21,10 +21,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set Node.js 16.x
|
- name: Set Node.js 16.x
|
||||||
uses: actions/setup-node@v3.5.1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ jobs:
|
||||||
id: diff
|
id: diff
|
||||||
|
|
||||||
# If index.js was different than expected, upload the expected version as an artifact
|
# If index.js was different than expected, upload the expected version as an artifact
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
|
|
|
||||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
name: Build & Test
|
name: Build & Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- run: node --version
|
- run: node --version
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
|
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: test-results
|
name: test-results
|
||||||
path: __tests__/__results__/*.xml
|
path: __tests__/__results__/*.xml
|
||||||
|
|
|
||||||
2
.github/workflows/manual-run.yml
vendored
2
.github/workflows/manual-run.yml
vendored
|
|
@ -8,7 +8,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
|
|
||||||
2
.github/workflows/test-report.yml
vendored
2
.github/workflows/test-report.yml
vendored
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
name: Workflow test
|
name: Workflow test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
artifact: test-results
|
artifact: test-results
|
||||||
|
|
|
||||||
30
CHANGELOG.md
30
CHANGELOG.md
|
|
@ -1,5 +1,35 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.7.0
|
||||||
|
* Fix #199: Use ✅ instead of ✔️ for better cross platform look by @petrdvorak in https://github.com/dorny/test-reporter/pull/200
|
||||||
|
* Verify content of dist/ folder matches build output by @dorny in https://github.com/dorny/test-reporter/pull/207
|
||||||
|
* Gracefully handle empty nested testsuite elements for JUnit. by @rvdlaarschot in https://github.com/dorny/test-reporter/pull/193
|
||||||
|
* Gracefully handle empty failure tags by @haudren-woven in https://github.com/dorny/test-reporter/pull/213
|
||||||
|
* Fix #208 - java-junit: show annotations on PR changed files by @atsu85 in https://github.com/dorny/test-reporter/pull/209
|
||||||
|
* Only report failure if fail-on-error is set by @trond-snekvik in https://github.com/dorny/test-reporter/pull/214
|
||||||
|
* Improve clarity on configuring for forkable repos by @abelbraaksma in https://github.com/dorny/test-reporter/pull/211
|
||||||
|
* Suppress "Processing test results from" log by @vasanthdharmaraj in https://github.com/dorny/test-reporter/pull/179
|
||||||
|
* Skip listing of files if error parsing is disabled by @dorny in https://github.com/dorny/test-reporter/pull/216
|
||||||
|
* Correct typo in docs by @tangowithfoxtrot in https://github.com/dorny/test-reporter/pull/254
|
||||||
|
* update dependencies by @j-catania in https://github.com/dorny/test-reporter/pull/269
|
||||||
|
* Add permissions to example yml files by @TurnrDev in https://github.com/dorny/test-reporter/pull/263
|
||||||
|
* add feature fail-on-empty by @gdams in https://github.com/dorny/test-reporter/pull/243
|
||||||
|
* Add dependabot configuration by @yeikel in https://github.com/dorny/test-reporter/pull/228
|
||||||
|
* Bump ws from 7.3.1 to 7.5.9 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/265
|
||||||
|
* Bump actions/checkout from 2 to 4 by @dependabot in https://github.com/dorny/test-reporter/pull/279
|
||||||
|
* Add new output for url url html by @luisito666 in https://github.com/dorny/test-reporter/pull/242
|
||||||
|
* Update README.md by @IanMoroney in https://github.com/dorny/test-reporter/pull/158
|
||||||
|
* Update jest-Junit part of Readme by @ryancasburn-KAI in https://github.com/dorny/test-reporter/pull/176
|
||||||
|
* fix: default-valued fields are not mandatory by @TomerFi in https://github.com/dorny/test-reporter/pull/172
|
||||||
|
* Bump ansi-regex from 4.1.0 to 4.1.1 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/278
|
||||||
|
* Bump decode-uri-component from 0.2.0 to 0.2.2 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/276
|
||||||
|
* Bump minimist from 1.2.5 to 1.2.8 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/275
|
||||||
|
* Bump qs from 6.5.2 to 6.5.3 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/272
|
||||||
|
* Bump json5 from 2.1.3 to 2.2.3 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/271
|
||||||
|
* Bump ansi-regex from 3.0.0 to 3.0.1 in /reports/mocha by @dependabot in https://github.com/dorny/test-reporter/pull/270
|
||||||
|
* declare 'url' and 'url_html' as action outputs by @micha-one in https://github.com/dorny/test-reporter/pull/287
|
||||||
|
* Avoid split on undefined by @cazou in https://github.com/dorny/test-reporter/pull/258
|
||||||
|
|
||||||
## v1.6.0
|
## v1.6.0
|
||||||
- [Update to node16 + recent versions of core and exec packages](https://github.com/dorny/test-reporter/pull/203)
|
- [Update to node16 + recent versions of core and exec packages](https://github.com/dorny/test-reporter/pull/203)
|
||||||
- [Update all dependencies to latest versions](https://github.com/dorny/test-reporter/pull/186)
|
- [Update all dependencies to latest versions](https://github.com/dorny/test-reporter/pull/186)
|
||||||
|
|
|
||||||
29
README.md
29
README.md
|
|
@ -33,12 +33,16 @@ If that's fine for you, using this action is as simple as:
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: read
|
||||||
|
checks: write
|
||||||
jobs:
|
jobs:
|
||||||
build-test:
|
build-test:
|
||||||
name: Build & Test
|
name: Build & Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2 # checkout the repo
|
- uses: actions/checkout@v3 # 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)
|
||||||
|
|
||||||
|
|
@ -69,10 +73,10 @@ jobs:
|
||||||
build-test:
|
build-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2 # checkout the repo
|
- uses: actions/checkout@v3 # 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@v2 # upload test results
|
- uses: actions/upload-artifact@v3 # upload test results
|
||||||
if: success() || failure() # run this step even if previous step failed
|
if: success() || failure() # run this step even if previous step failed
|
||||||
with:
|
with:
|
||||||
name: test-results
|
name: test-results
|
||||||
|
|
@ -86,6 +90,10 @@ on:
|
||||||
workflows: ['CI'] # runs after CI workflow
|
workflows: ['CI'] # runs after CI workflow
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: read
|
||||||
|
checks: write
|
||||||
jobs:
|
jobs:
|
||||||
report:
|
report:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -116,7 +124,7 @@ jobs:
|
||||||
# Name of the Check Run which will be created
|
# Name of the Check Run which will be created
|
||||||
name: ''
|
name: ''
|
||||||
|
|
||||||
# Coma separated list of paths to test results
|
# Comma-separated list of paths to test results
|
||||||
# Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob)
|
# Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob)
|
||||||
# All matched result files must be of the same format
|
# All matched result files must be of the same format
|
||||||
path: ''
|
path: ''
|
||||||
|
|
@ -158,6 +166,9 @@ jobs:
|
||||||
# Set action as failed if test report contains any failed test
|
# Set action as failed if test report contains any failed test
|
||||||
fail-on-error: 'true'
|
fail-on-error: 'true'
|
||||||
|
|
||||||
|
# Set this action as failed if no test results were found
|
||||||
|
fail-on-empty: 'true'
|
||||||
|
|
||||||
# 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: ''
|
||||||
|
|
||||||
|
|
@ -174,6 +185,8 @@ jobs:
|
||||||
| failed | Count of failed tests |
|
| failed | Count of failed tests |
|
||||||
| skipped | Count of skipped tests |
|
| skipped | Count of skipped tests |
|
||||||
| time | Test execution time [ms] |
|
| time | Test execution time [ms] |
|
||||||
|
| url | Check run URL |
|
||||||
|
| url_html | Check run URL HTML |
|
||||||
|
|
||||||
## Supported formats
|
## Supported formats
|
||||||
|
|
||||||
|
|
@ -258,14 +271,14 @@ Some heuristic was necessary to figure out the mapping between the line in the s
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>jest-Junit</summary>
|
<summary>jest-junit</summary>
|
||||||
|
|
||||||
[JEST](https://jestjs.io/) testing framework support requires the usage of [jest-Junit](https://github.com/jest-community/jest-Junit) reporter.
|
[JEST](https://jestjs.io/) testing framework support requires the usage of [jest-junit](https://github.com/jest-community/jest-junit) reporter.
|
||||||
It will create test results in Junit XML format which can be then processed by this action.
|
It will create test results in Junit XML format which can be then processed by this action.
|
||||||
You can use the following example configuration in `package.json`:
|
You can use the following example configuration in `package.json`:
|
||||||
```json
|
```json
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --ci --reporters=default --reporters=jest-Junit"
|
"test": "jest --ci --reporters=default --reporters=jest-junit"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jest": "^26.5.3",
|
"jest": "^26.5.3",
|
||||||
|
|
@ -310,7 +323,7 @@ Unfortunately, there are some known issues and limitations caused by GitHub API:
|
||||||
|
|
||||||
- Test report (i.e. Check Run summary) is markdown text. No custom styling or HTML is possible.
|
- Test report (i.e. Check Run summary) is markdown text. No custom styling or HTML is possible.
|
||||||
- Maximum report size is 65535 bytes. Input parameters `list-suites` and `list-tests` will be automatically adjusted if max size is exceeded.
|
- Maximum report size is 65535 bytes. Input parameters `list-suites` and `list-tests` will be automatically adjusted if max size is exceeded.
|
||||||
- Test report can't reference any additional files (e.g. screenshots). You can use `actions/upload-artifact@v2` to upload them and inspect them manually.
|
- Test report can't reference any additional files (e.g. screenshots). You can use `actions/upload-artifact@v3` to upload them and inspect them manually.
|
||||||
- Check Runs are created for specific commit SHA. It's not possible to specify under which workflow test report should belong if more
|
- Check Runs are created for specific commit SHA. It's not possible to specify under which workflow test report should belong if more
|
||||||
workflows are running for the same SHA. Thanks to this GitHub "feature" it's possible your test report will appear in an unexpected place in GitHub UI.
|
workflows are running for the same SHA. Thanks to this GitHub "feature" it's possible your test report will appear in an unexpected place in GitHub UI.
|
||||||
For more information, see [#67](https://github.com/dorny/test-reporter/issues/67).
|
For more information, see [#67](https://github.com/dorny/test-reporter/issues/67).
|
||||||
|
|
|
||||||
16
action.yml
16
action.yml
|
|
@ -11,7 +11,7 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
path:
|
path:
|
||||||
description: |
|
description: |
|
||||||
Coma separated list of paths to test results
|
Comma-separated list of paths to test results
|
||||||
Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob)
|
Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob)
|
||||||
All matched result files must be of same format
|
All matched result files must be of same format
|
||||||
required: true
|
required: true
|
||||||
|
|
@ -37,7 +37,7 @@ inputs:
|
||||||
Limits which test suites are listed. Supported options:
|
Limits which test suites are listed. Supported options:
|
||||||
- all
|
- all
|
||||||
- only-failed
|
- only-failed
|
||||||
required: true
|
required: false
|
||||||
default: 'all'
|
default: 'all'
|
||||||
list-tests:
|
list-tests:
|
||||||
description: |
|
description: |
|
||||||
|
|
@ -45,16 +45,20 @@ inputs:
|
||||||
- all
|
- all
|
||||||
- only-failed
|
- only-failed
|
||||||
- none
|
- none
|
||||||
required: true
|
required: false
|
||||||
default: 'all'
|
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.
|
||||||
Must be less or equal to 50.
|
Must be less or equal to 50.
|
||||||
required: true
|
required: false
|
||||||
default: '10'
|
default: '10'
|
||||||
fail-on-error:
|
fail-on-error:
|
||||||
description: Set this action as failed if test report contain any failed test
|
description: Set this action as failed if test report contain any failed test
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
fail-on-empty:
|
||||||
|
description: Set this action as failed if no test results were found
|
||||||
required: true
|
required: true
|
||||||
default: 'true'
|
default: 'true'
|
||||||
working-directory:
|
working-directory:
|
||||||
|
|
@ -85,6 +89,10 @@ outputs:
|
||||||
description: Count of skipped tests
|
description: Count of skipped tests
|
||||||
time:
|
time:
|
||||||
description: Test execution time [ms]
|
description: Test execution time [ms]
|
||||||
|
url:
|
||||||
|
description: Check run URL
|
||||||
|
url_html:
|
||||||
|
description: Check run URL HTML
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|
|
||||||
1002
dist/index.js
generated
vendored
1002
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
25
dist/licenses.txt
generated
vendored
25
dist/licenses.txt
generated
vendored
|
|
@ -696,31 +696,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
compress-brotli
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright © 2019 Kiko Beats <josefrancisco.verdu@gmail.com> (kikobeats.com)
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
decompress-response
|
decompress-response
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|
|
||||||
7980
package-lock.json
generated
7980
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "test-check",
|
"name": "test-check",
|
||||||
"version": "0.0.0",
|
"version": "1.7.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",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint src/**/*.ts",
|
||||||
"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/*",
|
||||||
"test": "jest --ci --reporters=default --reporters=jest-junit",
|
"test": "jest --ci --reporters=default --reporters=jest-junit",
|
||||||
"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\"",
|
||||||
|
|
@ -37,7 +38,7 @@
|
||||||
"fast-glob": "^3.2.5",
|
"fast-glob": "^3.2.5",
|
||||||
"got": "^11.8.2",
|
"got": "^11.8.2",
|
||||||
"picomatch": "^2.2.2",
|
"picomatch": "^2.2.2",
|
||||||
"xml2js": "^0.4.23"
|
"xml2js": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@octokit/types": "^7.1.0",
|
"@octokit/types": "^7.1.0",
|
||||||
|
|
@ -58,11 +59,12 @@
|
||||||
"eslint-plugin-github": "^4.1.2",
|
"eslint-plugin-github": "^4.1.2",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-jest": "^26.8.3",
|
"eslint-plugin-jest": "^26.8.3",
|
||||||
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^28.1.3",
|
"jest": "^28.1.3",
|
||||||
"jest-circus": "^28.1.3",
|
"jest-circus": "^28.1.3",
|
||||||
"jest-junit": "^14.0.0",
|
"jest-junit": "^14.0.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^3.0.0",
|
||||||
"ts-jest": "^28.0.8",
|
"ts-jest": "^28.0.8",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
47
reports/jest/package-lock.json
generated
47
reports/jest/package-lock.json
generated
|
|
@ -804,9 +804,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ansi-styles": {
|
"ansi-styles": {
|
||||||
|
|
@ -1343,9 +1343,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"decode-uri-component": {
|
"decode-uri-component": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
|
||||||
"integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
|
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"deep-is": {
|
"deep-is": {
|
||||||
|
|
@ -2546,9 +2546,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
|
||||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
"integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
|
|
@ -2908,13 +2908,10 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"json5": {
|
"json5": {
|
||||||
"version": "2.1.3",
|
"version": "2.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
||||||
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
|
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {
|
|
||||||
"minimist": "^1.2.5"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"jsprim": {
|
"jsprim": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
|
|
@ -3080,9 +3077,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
|
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"mixin-deep": {
|
"mixin-deep": {
|
||||||
|
|
@ -3486,9 +3483,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"qs": {
|
"qs": {
|
||||||
"version": "6.5.2",
|
"version": "6.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
|
||||||
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
|
"integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"react-is": {
|
"react-is": {
|
||||||
|
|
@ -4660,9 +4657,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.3.1",
|
"version": "7.5.9",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz",
|
||||||
"integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==",
|
"integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"xml": {
|
"xml": {
|
||||||
|
|
|
||||||
24
reports/mocha/package-lock.json
generated
24
reports/mocha/package-lock.json
generated
|
|
@ -17,9 +17,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
|
||||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
|
"integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ansi-styles": {
|
"ansi-styles": {
|
||||||
|
|
@ -139,9 +139,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"is-fullwidth-code-point": {
|
"is-fullwidth-code-point": {
|
||||||
|
|
@ -639,9 +639,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"is-fullwidth-code-point": {
|
"is-fullwidth-code-point": {
|
||||||
|
|
@ -700,9 +700,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"is-fullwidth-code-point": {
|
"is-fullwidth-code-point": {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,10 @@ import {FileContent, InputProvider, ReportInput} from './input-provider'
|
||||||
import {listFiles} from '../utils/git'
|
import {listFiles} from '../utils/git'
|
||||||
|
|
||||||
export class LocalFileProvider implements InputProvider {
|
export class LocalFileProvider implements InputProvider {
|
||||||
constructor(readonly name: string, readonly pattern: string[]) {}
|
constructor(
|
||||||
|
readonly name: string,
|
||||||
|
readonly pattern: string[]
|
||||||
|
) {}
|
||||||
|
|
||||||
async load(): Promise<ReportInput> {
|
async load(): Promise<ReportInput> {
|
||||||
const result: FileContent[] = []
|
const result: FileContent[] = []
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ class TestReporter {
|
||||||
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 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 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 token = core.getInput('token', {required: true})
|
readonly token = core.getInput('token', {required: true})
|
||||||
|
|
@ -135,7 +136,7 @@ class TestReporter {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.length === 0) {
|
if (results.length === 0 && this.failOnEmpty) {
|
||||||
core.setFailed(`No test report files were found`)
|
core.setFailed(`No test report files were found`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -198,6 +199,8 @@ class TestReporter {
|
||||||
core.info(`Check run create response: ${resp.status}`)
|
core.info(`Check run create response: ${resp.status}`)
|
||||||
core.info(`Check run URL: ${resp.data.url}`)
|
core.info(`Check run URL: ${resp.data.url}`)
|
||||||
core.info(`Check run HTML: ${resp.data.html_url}`)
|
core.info(`Check run HTML: ${resp.data.html_url}`)
|
||||||
|
core.setOutput('url', resp.data.url)
|
||||||
|
core.setOutput('url_html', resp.data.html_url)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import {DEFAULT_LOCALE} from './utils/node-utils'
|
import {DEFAULT_LOCALE} from './utils/node-utils'
|
||||||
|
|
||||||
export class TestRunResult {
|
export class TestRunResult {
|
||||||
constructor(readonly path: string, readonly suites: TestSuiteResult[], private totalTime?: number) {}
|
constructor(
|
||||||
|
readonly path: string,
|
||||||
|
readonly suites: TestSuiteResult[],
|
||||||
|
private totalTime?: number
|
||||||
|
) {}
|
||||||
|
|
||||||
get tests(): number {
|
get tests(): number {
|
||||||
return this.suites.reduce((sum, g) => sum + g.tests, 0)
|
return this.suites.reduce((sum, g) => sum + g.tests, 0)
|
||||||
|
|
@ -40,7 +44,11 @@ export class TestRunResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TestSuiteResult {
|
export class TestSuiteResult {
|
||||||
constructor(readonly name: string, readonly groups: TestGroupResult[], private totalTime?: number) {}
|
constructor(
|
||||||
|
readonly name: string,
|
||||||
|
readonly groups: TestGroupResult[],
|
||||||
|
private totalTime?: number
|
||||||
|
) {}
|
||||||
|
|
||||||
get tests(): number {
|
get tests(): number {
|
||||||
return this.groups.reduce((sum, g) => sum + g.tests.length, 0)
|
return this.groups.reduce((sum, g) => sum + g.tests.length, 0)
|
||||||
|
|
@ -78,7 +86,10 @@ export class TestSuiteResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TestGroupResult {
|
export class TestGroupResult {
|
||||||
constructor(readonly name: string | undefined | null, readonly tests: TestCaseResult[]) {}
|
constructor(
|
||||||
|
readonly name: string | undefined | null,
|
||||||
|
readonly tests: TestCaseResult[]
|
||||||
|
) {}
|
||||||
|
|
||||||
get passed(): number {
|
get passed(): number {
|
||||||
return this.tests.reduce((sum, t) => (t.result === 'success' ? sum + 1 : sum), 0)
|
return this.tests.reduce((sum, t) => (t.result === 'success' ? sum + 1 : sum), 0)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@ export function parseIsoDate(str: string): Date {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFirstNonEmptyLine(stackTrace: string): string | undefined {
|
export function getFirstNonEmptyLine(stackTrace: string): string | undefined {
|
||||||
const lines = stackTrace.split(/\r?\n/g)
|
const lines = stackTrace?.split(/\r?\n/g)
|
||||||
return lines.find(str => !/^\s*$/.test(str))
|
return lines?.find(str => !/^\s*$/.test(str))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue