mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 14:27:10 +01:00
commit
ef9ec10825
12 changed files with 2559 additions and 6549 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"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
.github/workflows/check-dist.yml
vendored
4
.github/workflows/check-dist.yml
vendored
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- 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@v3
|
||||||
- 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@v3
|
||||||
- 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@v3
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
artifact: test-results
|
artifact: test-results
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ jobs:
|
||||||
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 +69,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
|
||||||
|
|
@ -310,7 +310,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).
|
||||||
|
|
|
||||||
993
dist/index.js
generated
vendored
993
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
|
||||||
|
|
|
||||||
7976
package-lock.json
generated
7976
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -37,7 +37,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 +58,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"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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[] = []
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue