1
0
Fork 0
mirror of synced 2026-06-05 14:48:19 +00:00

Compare commits

..

No commits in common. "main" and "release/v2.5.0" have entirely different histories.

66 changed files with 60623 additions and 58076 deletions

4
.eslintignore Normal file
View file

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

68
.eslintrc.json Normal file
View file

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

View file

@ -16,9 +16,6 @@ on:
- '**.md' - '**.md'
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
check-dist: check-dist:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -49,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@v7 - uses: actions/upload-artifact@v6
if: ${{ failure() && steps.diff.conclusion == 'failure' }} if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with: with:
name: dist name: dist

View file

@ -8,9 +8,6 @@ on:
- main - main
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
jobs: jobs:
build-test: build-test:
name: Build & Test name: Build & Test
@ -28,7 +25,7 @@ jobs:
- name: Upload test results - name: Upload test results
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v6
with: with:
name: test-results name: test-results
path: __tests__/__results__/*.xml path: __tests__/__results__/*.xml

View file

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

View file

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

View file

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

2
.nvmrc
View file

@ -1 +1 @@
v24 v20

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,88 +0,0 @@
import * as github from '@actions/github'
import {getCheckRunContext} from '../src/utils/github-utils'
describe('GitHub workflow_run context resolution', () => {
const originalContext = {
eventName: github.context.eventName,
payload: github.context.payload,
runId: github.context.runId,
sha: github.context.sha
}
afterEach(() => {
github.context.eventName = originalContext.eventName
github.context.payload = originalContext.payload
github.context.runId = originalContext.runId
github.context.sha = originalContext.sha
})
it('uses the head SHA from the PR matching workflow_run.head_branch when CI is triggered by a PR update', () => {
github.context.eventName = 'workflow_run'
github.context.payload = {
workflow_run: {
id: 9001,
head_branch: 'feature/refactor-reporter',
head_sha: 'merge-commit-sha-should-not-win',
pull_requests: [
{head: {ref: 'main', sha: 'sha-from-main-pr'}},
{head: {ref: 'feature/refactor-reporter', sha: 'sha-from-updated-pr-head'}}
]
}
} as typeof github.context.payload
expect(getCheckRunContext()).toEqual({
sha: 'sha-from-updated-pr-head',
runId: 9001
})
})
it('falls back to the first associated PR head SHA when no PR branch matches (common with merge queue / detached branches)', () => {
github.context.eventName = 'workflow_run'
github.context.payload = {
workflow_run: {
id: 9002,
head_branch: 'gh-readonly-queue/main/pr-742-123456',
head_sha: 'merge-queue-commit-sha',
pull_requests: [
{head: {ref: 'feature/billing-fix', sha: 'sha-from-first-associated-pr'}},
{head: {ref: 'feature/other-pr', sha: 'sha-from-second-associated-pr'}}
]
}
} as typeof github.context.payload
expect(getCheckRunContext()).toEqual({
sha: 'sha-from-first-associated-pr',
runId: 9002
})
})
it('uses workflow_run.head_sha when the run comes from a branch push with no related pull request', () => {
github.context.eventName = 'workflow_run'
github.context.payload = {
workflow_run: {
id: 9003,
head_branch: 'main',
head_sha: 'sha-from-push-on-main',
pull_requests: []
}
} as typeof github.context.payload
expect(getCheckRunContext()).toEqual({
sha: 'sha-from-push-on-main',
runId: 9003
})
})
it('throws a clear error when webhook payload has neither PR head SHA nor workflow_run.head_sha', () => {
github.context.eventName = 'workflow_run'
github.context.payload = {
workflow_run: {
id: 9004,
head_branch: 'feature/missing-sha',
pull_requests: [{head: {ref: 'feature/missing-sha'}}]
}
} as typeof github.context.payload
expect(() => getCheckRunContext()).toThrow('Unable to resolve SHA from workflow_run (no PR head.sha or head_sha)')
})
})

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

56165
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

481
dist/licenses.txt generated vendored
View file

@ -71,6 +71,28 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
@nodelib/fs.scandir @nodelib/fs.scandir
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -318,6 +340,44 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
@sindresorhus/is
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.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.
@szmarczak/http-timer
MIT
MIT License
Copyright (c) 2018 Szymon Marczak
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.
adm-zip adm-zip
MIT MIT
MIT License MIT License
@ -573,14 +633,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
fast-content-type-parse cacheable-lookup
MIT MIT
MIT License MIT License
Copyright (c) 2023 The Fastify Team Copyright (c) 2019 Szymon Marczak
The Fastify team members are listed at https://github.com/fastify/fastify#team
and in the README file.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -600,6 +657,138 @@ 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
cacheable-request
MIT
MIT License
Copyright (c) 2017 Luke Childs
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.
clone-response
MIT
MIT License
Copyright (c) 2017 Luke Childs
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
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.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.
defer-to-connect
MIT
MIT License
Copyright (c) 2018 Szymon Marczak
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.
deprecation
ISC
The ISC License
Copyright (c) Gregor Martynus and contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
end-of-stream
MIT
The MIT License (MIT)
Copyright (c) 2014 Mathias Buus
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.
fast-glob fast-glob
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -667,6 +856,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
get-stream
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.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.
glob-parent glob-parent
ISC ISC
The ISC License The ISC License
@ -686,6 +888,57 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
got
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
http-cache-semantics
BSD-2-Clause
Copyright 2016-2018 Kornel Lesiński
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
http2-wrapper
MIT
MIT License
Copyright (c) 2018 Szymon Marczak
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.
is-extglob is-extglob
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -761,29 +1014,46 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
json-with-bigint json-buffer
MIT
Copyright (c) 2013 Dominic Tarr
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.
keyv
MIT
lowercase-keys
MIT MIT
MIT License MIT License
Copyright (c) 2023 Ivan Korolenko Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal 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:
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 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 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.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
merge2 merge2
@ -836,6 +1106,64 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
mimic-response
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
normalize-url
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
once
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
p-cancelable
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
picomatch picomatch
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -861,6 +1189,30 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
pump
MIT
The MIT License (MIT)
Copyright (c) 2014 Mathias Buus
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.
queue-microtask queue-microtask
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@ -885,11 +1237,73 @@ 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. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
quick-lru
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
resolve-alpn
MIT
MIT License
Copyright (c) 2018 Szymon Marczak
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.
responselike
MIT
Copyright (c) 2017 Luke Childs
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.
reusify reusify
MIT MIT
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2015-2024 Matteo Collina Copyright (c) 2015 Matteo Collina
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -1073,13 +1487,32 @@ universal-user-agent
ISC ISC
# [ISC License](https://spdx.org/licenses/ISC) # [ISC License](https://spdx.org/licenses/ISC)
Copyright (c) 2018-2021, Gregor Martynus (https://github.com/gr2m) Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
wrappy
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
xml2js xml2js
MIT MIT
Copyright 2010, 2011, 2012, 2013. All rights reserved. Copyright 2010, 2011, 2012, 2013. All rights reserved.

3
dist/package.json generated vendored
View file

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

View file

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

View file

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

3941
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

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

View file

@ -3981,11 +3981,10 @@
} }
}, },
"node_modules/lodash": { "node_modules/lodash": {
"version": "4.17.23", "version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true, "dev": true
"license": "MIT"
}, },
"node_modules/lodash.sortby": { "node_modules/lodash.sortby": {
"version": "4.7.0", "version": "4.7.0",
@ -4110,11 +4109,10 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "3.1.5", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true, "dev": true,
"license": "ISC",
"dependencies": { "dependencies": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
}, },
@ -4548,11 +4546,10 @@
"dev": true "dev": true
}, },
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.3.2", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": ">=8.6" "node": ">=8.6"
}, },
@ -4656,11 +4653,10 @@
} }
}, },
"node_modules/qs": { "node_modules/qs": {
"version": "6.5.5", "version": "6.5.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.5.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
"integrity": "sha512-mzR4sElr1bfCaPJe7m8ilJ6ZXdDaGoObcYR0ZHSsktM/Lt21MVHj5De30GQH2eiZ1qGRTO7LCAzQsUeXTNexWQ==", "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==",
"dev": true, "dev": true,
"license": "BSD-3-Clause",
"engines": { "engines": {
"node": ">=0.6" "node": ">=0.6"
} }

View file

@ -555,13 +555,13 @@
"license": "ISC" "license": "ISC"
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "9.0.9", "version": "9.0.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
"integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
"dev": true, "dev": true,
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"brace-expansion": "^2.0.2" "brace-expansion": "^2.0.1"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.17" "node": ">=16 || 14 >=14.17"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,10 +1,13 @@
import {createWriteStream} from 'fs' import {createWriteStream} from 'fs'
import {pipeline} from 'stream/promises'
import {Readable, Transform} from 'stream'
import * as core from '@actions/core' import * as core from '@actions/core'
import * as github from '@actions/github' import * as github from '@actions/github'
import {GitHub} from '@actions/github/lib/utils' import {GitHub} from '@actions/github/lib/utils'
import type {PullRequest, WorkflowRunEvent} from '@octokit/webhooks-types' import type {PullRequest, WorkflowRunEvent} from '@octokit/webhooks-types'
import {IncomingMessage} from 'http'
import * as stream from 'stream'
import {promisify} from 'util'
import got, {Progress} from 'got'
const asyncStream = promisify(stream.pipeline)
export function getCheckRunContext(): {sha: string; runId: number} { export function getCheckRunContext(): {sha: string; runId: number} {
if (github.context.eventName === 'workflow_run') { if (github.context.eventName === 'workflow_run') {
@ -13,18 +16,8 @@ export function getCheckRunContext(): {sha: string; runId: number} {
if (!event.workflow_run) { if (!event.workflow_run) {
throw new Error("Event of type 'workflow_run' is missing 'workflow_run' field") throw new Error("Event of type 'workflow_run' is missing 'workflow_run' field")
} }
const prs = event.workflow_run.pull_requests ?? []
// For `workflow_run`, we want to report against the PR commit when possible so annotations land
// on the contributor's changes. Prefer the PR whose `head.ref` matches `workflow_run.head_branch`,
// then fall back to the first PR head SHA, and finally to `workflow_run.head_sha` for non-PR runs.
const prShaMatch = prs.find(pr => pr.head?.ref === event.workflow_run.head_branch)?.head?.sha
const prShaFirst = prs[0]?.head?.sha
const sha = prShaMatch ?? prShaFirst ?? event.workflow_run.head_sha
if (!sha) {
throw new Error('Unable to resolve SHA from workflow_run (no PR head.sha or head_sha)')
}
return { return {
sha, sha: event.workflow_run.head_commit.id,
runId: event.workflow_run.id runId: event.workflow_run.id
} }
} }
@ -55,33 +48,21 @@ export async function downloadArtifact(
archive_format: 'zip' archive_format: 'zip'
}) })
const response = await fetch(req.url, { const headers = {
headers: {Authorization: `Bearer ${token}`}, Authorization: `Bearer ${token}`
redirect: 'follow'
})
if (!response.ok) {
throw new Error(`Download failed: ${response.status} ${response.statusText}`)
}
if (!response.body) {
throw new Error('Response body is empty')
} }
core.info(`Downloading from ${response.url}`) const downloadStream = got.stream(req.url, {headers})
const readable = Readable.fromWeb(response.body)
const fileWriterStream = createWriteStream(fileName) const fileWriterStream = createWriteStream(fileName)
let transferred = 0 downloadStream.on('redirect', (response: IncomingMessage) => {
const progress = new Transform({ core.info(`Downloading ${response.headers.location}`)
transform(chunk, _encoding, callback) { })
transferred += chunk.length downloadStream.on('downloadProgress', (progress: Progress) => {
core.info(`Progress: ${transferred} B`) core.info(`Progress: ${progress.transferred} B`)
callback(null, chunk)
}
}) })
await pipeline(readable, progress, fileWriterStream) await asyncStream(downloadStream, fileWriterStream)
} finally { } finally {
core.endGroup() core.endGroup()
} }
@ -125,11 +106,7 @@ async function listGitTree(octokit: InstanceType<typeof GitHub>, sha: string, pa
if (tr.type === 'blob') { if (tr.type === 'blob') {
result.push(file) result.push(file)
} else if (tr.type === 'tree' && truncated) { } else if (tr.type === 'tree' && truncated) {
if (!tr.sha) { const files = await listGitTree(octokit, tr.sha as string, `${file}/`)
core.warning(`Skipping tree ${file}: missing SHA`)
continue
}
const files = await listGitTree(octokit, tr.sha, `${file}/`)
result.push(...files) result.push(...files)
} }
} }

View file

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

View file

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

View file

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