diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 5f4b9d2..e571511 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -46,7 +46,7 @@ jobs: id: diff # If index.js was different than expected, upload the expected version as an artifact - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ failure() && steps.diff.conclusion == 'failure' }} with: name: dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 545b4e3..a8a86e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Upload test results if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results path: __tests__/__results__/*.xml diff --git a/.nvmrc b/.nvmrc index eb800ed..9a2a0e2 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.19.0 +v20 diff --git a/README.md b/README.md index 2164279..daffb3a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This [Github Action](https://github.com/features/actions) displays test results |:--:|:--:|:--:|:--:| **Supported languages / frameworks:** -- .NET / [xUnit](https://xunit.net/) / [NUnit](https://nunit.org/) / [MSTest](https://github.com/Microsoft/testfx-docs) +- .NET / [dotnet test](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#examples) ( [xUnit](https://xunit.net/) / [NUnit](https://nunit.org/) / [MSTest](https://github.com/Microsoft/testfx-docs) ) - Dart / [test](https://pub.dev/packages/test) - Flutter / [test](https://pub.dev/packages/test) - Java / [JUnit](https://junit.org/) @@ -43,7 +43,7 @@ jobs: name: Build & Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 # checkout the repo + - uses: actions/checkout@v4 # checkout the repo - run: npm ci # install packages - run: npm test # run tests (configured to use jest-junit reporter) @@ -74,10 +74,10 @@ jobs: build-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 # checkout the repo + - uses: actions/checkout@v4 # checkout the repo - run: npm ci # install packages - run: npm test # run tests (configured to use jest-junit reporter) - - uses: actions/upload-artifact@v3 # upload test results + - uses: actions/upload-artifact@v4 # upload test results if: success() || failure() # run this step even if previous step failed with: name: test-results @@ -137,11 +137,13 @@ jobs: # Format of test results. Supported options: # dart-json + # dotnet-nunit # dotnet-trx # flutter-json # java-junit # jest-junit # mocha-json + # rspec-json reporter: '' # Allows you to generate only the summary. @@ -315,16 +317,22 @@ Configuration of `uniqueOutputName`, `suiteNameTemplate`, `classNameTemplate`, ` - Mocha version [v7.2.0](https://github.com/mochajs/mocha/releases/tag/v7.2.0) or higher - Usage of [json](https://mochajs.org/#json) reporter. -You can use the following example configuration in `package.json`: +For Mocha >= [v9.1.0](https://github.com/mochajs/mocha/releases/tag/v9.1.0), you can use the following example configuration in `package.json`: ```json "scripts": { - "test": "mocha --reporter json > test-results.json" + "test": "mocha --reporter json --reporter-option output=test-results.json" } ``` -Test processing might fail if any of your tests write anything on standard output. -Mocha, unfortunately, doesn't have the option to store `json` output directly to the file, and we have to rely on redirecting its standard output. -There is a work in progress to fix it: [mocha#4607](https://github.com/mochajs/mocha/pull/4607) +For Mocha < v9.1, the command should look like this: +```json +"scripts": { + "test": "mocha --reporter json > test-results.json" +} +``` +Additionally, test processing might fail if any of your tests write anything on standard output. +Before version [v9.1.0](https://github.com/mochajs/mocha/releases/tag/v9.1.0), Mocha doesn't have the option to store `json` output directly to the file, and we have to rely on redirecting its standard output ([mocha#4607](https://github.com/mochajs/mocha/pull/4607)). +Please update Mocha to version [v9.1.0](https://github.com/mochajs/mocha/releases/tag/v9.1.0) or above if you encounter this issue.
@@ -339,7 +347,7 @@ Unfortunately, there are some known issues and limitations caused by GitHub API: - Test report (i.e. Check Run summary) is markdown text. No custom styling or HTML is possible. - Maximum report size is 65535 bytes. Input parameters `list-suites` and `list-tests` will be automatically adjusted if max size is exceeded. -- Test report can't reference any additional files (e.g. screenshots). You can use `actions/upload-artifact@v3` to upload them and inspect them manually. +- Test report can't reference any additional files (e.g. screenshots). You can use `actions/upload-artifact@v4` to upload them and inspect them manually. - Check Runs are created for specific commit SHA. It's not possible to specify under which workflow test report should belong if more workflows are running for the same SHA. Thanks to this GitHub "feature" it's possible your test report will appear in an unexpected place in GitHub UI. For more information, see [#67](https://github.com/dorny/test-reporter/issues/67). diff --git a/__tests__/__outputs__/dotnet-nunit.md b/__tests__/__outputs__/dotnet-nunit.md new file mode 100644 index 0000000..c7f2d52 --- /dev/null +++ b/__tests__/__outputs__/dotnet-nunit.md @@ -0,0 +1,31 @@ +![Tests failed](https://img.shields.io/badge/tests-3%20passed%2C%205%20failed%2C%201%20skipped-critical) +|Report|Passed|Failed|Skipped|Time| +|:---|---:|---:|---:|---:| +|fixtures/dotnet-nunit.xml|3 ✅|5 ❌|1 ⚪|230ms| +## ❌ fixtures/dotnet-nunit.xml +**9** tests were completed in **230ms** with **3** passed, **5** failed and **1** skipped. +|Test suite|Passed|Failed|Skipped|Time| +|:---|---:|---:|---:|---:| +|[DotnetTests.NUnitV3Tests.dll.DotnetTests.XUnitTests](#r0s0)|3 ✅|5 ❌|1 ⚪|69ms| +### ❌ DotnetTests.NUnitV3Tests.dll.DotnetTests.XUnitTests +``` +CalculatorTests + ✅ Is_Even_Number(2) + ❌ Is_Even_Number(3) + Expected: True + But was: False + + ❌ Exception_In_TargetTest + System.DivideByZeroException : Attempted to divide by zero. + ❌ Exception_In_Test + System.Exception : Test + ❌ Failing_Test + Expected: 3 + But was: 2 + + ✅ Passing_Test + ✅ Passing_Test_With_Description + ⚪ Skipped_Test + ❌ Timeout_Test + +``` \ No newline at end of file diff --git a/__tests__/__outputs__/rspec-json.md b/__tests__/__outputs__/rspec-json.md new file mode 100644 index 0000000..88336be --- /dev/null +++ b/__tests__/__outputs__/rspec-json.md @@ -0,0 +1,19 @@ +![Tests failed](https://img.shields.io/badge/tests-1%20passed%2C%201%20failed%2C%201%20skipped-critical) +|Report|Passed|Failed|Skipped|Time| +|:---|---:|---:|---:|---:| +|fixtures/rspec-json.json|1 ✅|1 ❌|1 ⚪|0ms| +## ❌ fixtures/rspec-json.json +**3** tests were completed in **0ms** with **1** passed, **1** failed and **1** skipped. +|Test suite|Passed|Failed|Skipped|Time| +|:---|---:|---:|---:|---:| +|[./spec/config/check_env_vars_spec.rb](#r0s0)|1 ✅|1 ❌|1 ⚪|0ms| +### ❌ ./spec/config/check_env_vars_spec.rb +``` +CheckEnvVars#call when all env vars are defined behaves like success load + ❌ CheckEnvVars#call when all env vars are defined behaves like success load fails in assertion + (#ActiveSupport::BroadcastLogger:0x00007f1007fedf58).debug("All config env vars exist") + expected: 0 times with arguments: ("All config env vars exist") + received: 1 time with arguments: ("All config env vars exist") + ✅ CheckEnvVars#call when all env vars are defined behaves like success load logs success message + ⚪ CheckEnvVars#call when all env vars are defined behaves like success load skips the test +``` \ No newline at end of file diff --git a/__tests__/__outputs__/swift-xunit.md b/__tests__/__outputs__/swift-xunit.md index d3bfc2b..b84a926 100644 --- a/__tests__/__outputs__/swift-xunit.md +++ b/__tests__/__outputs__/swift-xunit.md @@ -13,4 +13,5 @@ AcmeLibTests.AcmeLibTests ✅ test_always_pass ✅ test_always_skip ❌ test_always_fail + failed ``` \ No newline at end of file diff --git a/__tests__/__snapshots__/dotnet-nunit.test.ts.snap b/__tests__/__snapshots__/dotnet-nunit.test.ts.snap new file mode 100644 index 0000000..60d55f2 --- /dev/null +++ b/__tests__/__snapshots__/dotnet-nunit.test.ts.snap @@ -0,0 +1,107 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dotnet-nunit tests report from ./reports/dotnet test results matches snapshot 1`] = ` +TestRunResult { + "path": "fixtures/dotnet-nunit.xml", + "suites": [ + TestSuiteResult { + "groups": [ + TestGroupResult { + "name": "CalculatorTests", + "tests": [ + TestCaseResult { + "error": undefined, + "name": "Is_Even_Number(2)", + "result": "success", + "time": 0.622, + }, + TestCaseResult { + "error": { + "details": " at DotnetTests.XUnitTests.CalculatorTests.Is_Even_Number(Int32 i) in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.NUnitV3Tests\\CalculatorTests.cs:line 61 +", + "line": undefined, + "message": " Expected: True + But was: False +", + "path": undefined, + }, + "name": "Is_Even_Number(3)", + "result": "failed", + "time": 1.098, + }, + TestCaseResult { + "error": { + "details": " at DotnetTests.Unit.Calculator.Div(Int32 a, Int32 b) in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.Unit\\Calculator.cs:line 9 + at DotnetTests.XUnitTests.CalculatorTests.Exception_In_TargetTest() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.NUnitV3Tests\\CalculatorTests.cs:line 33", + "line": undefined, + "message": "System.DivideByZeroException : Attempted to divide by zero.", + "path": undefined, + }, + "name": "Exception_In_TargetTest", + "result": "failed", + "time": 22.805, + }, + TestCaseResult { + "error": { + "details": " at DotnetTests.XUnitTests.CalculatorTests.Exception_In_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.NUnitV3Tests\\CalculatorTests.cs:line 39", + "line": undefined, + "message": "System.Exception : Test", + "path": undefined, + }, + "name": "Exception_In_Test", + "result": "failed", + "time": 0.528, + }, + TestCaseResult { + "error": { + "details": " at DotnetTests.XUnitTests.CalculatorTests.Failing_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.NUnitV3Tests\\CalculatorTests.cs:line 27 +", + "line": undefined, + "message": " Expected: 3 + But was: 2 +", + "path": undefined, + }, + "name": "Failing_Test", + "result": "failed", + "time": 28.162, + }, + TestCaseResult { + "error": undefined, + "name": "Passing_Test", + "result": "success", + "time": 0.23800000000000002, + }, + TestCaseResult { + "error": undefined, + "name": "Passing_Test_With_Description", + "result": "success", + "time": 0.135, + }, + TestCaseResult { + "error": undefined, + "name": "Skipped_Test", + "result": "skipped", + "time": 0.398, + }, + TestCaseResult { + "error": { + "details": "", + "line": undefined, + "message": "", + "path": undefined, + }, + "name": "Timeout_Test", + "result": "failed", + "time": 14.949, + }, + ], + }, + ], + "name": "DotnetTests.NUnitV3Tests.dll.DotnetTests.XUnitTests", + "totalTime": undefined, + }, + ], + "totalTime": 230.30800000000002, +} +`; diff --git a/__tests__/__snapshots__/java-junit.test.ts.snap b/__tests__/__snapshots__/java-junit.test.ts.snap index 041f380..341b092 100644 --- a/__tests__/__snapshots__/java-junit.test.ts.snap +++ b/__tests__/__snapshots__/java-junit.test.ts.snap @@ -41,7 +41,7 @@ at java.lang.Thread.run(Thread.java:748) ", "line": 29, - "message": undefined, + "message": "java.lang.AssertionError: expected [1.2.1] but found [1.2.0]", "path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java", }, "name": "testVersionStrings", @@ -100,7 +100,7 @@ at java.lang.Thread.run(Thread.java:748) ", "line": 29, - "message": undefined, + "message": "java.lang.AssertionError: expected [1.2.1] but found [1.2.0]", "path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java", }, "name": "testVersionStrings", diff --git a/__tests__/__snapshots__/rspec-json.test.ts.snap b/__tests__/__snapshots__/rspec-json.test.ts.snap new file mode 100644 index 0000000..cc14bfb --- /dev/null +++ b/__tests__/__snapshots__/rspec-json.test.ts.snap @@ -0,0 +1,49 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`rspec-json tests report from ./reports/rspec-json test results matches snapshot 1`] = ` +TestRunResult { + "path": "fixtures/rspec-json.json", + "suites": [ + TestSuiteResult { + "groups": [ + TestGroupResult { + "name": "CheckEnvVars#call when all env vars are defined behaves like success load", + "tests": [ + TestCaseResult { + "error": { + "details": "/usr/local/bundle/ruby/3.3.0/gems/net-http-0.4.1/lib/net/http.rb:1603:in \`initialize' +./config/check_env_vars.rb:11:in \`call' +./spec/config/check_env_vars_spec.rb:7:in \`block (3 levels) in ' +./spec/config/check_env_vars_spec.rb:19:in \`block (4 levels) in '", + "line": 11, + "message": "(#ActiveSupport::BroadcastLogger:0x00007f1007fedf58).debug("All config env vars exist") + expected: 0 times with arguments: ("All config env vars exist") + received: 1 time with arguments: ("All config env vars exist")", + "path": "./config/check_env_vars.rb", + }, + "name": "CheckEnvVars#call when all env vars are defined behaves like success load fails in assertion", + "result": "failed", + "time": 0.004411051, + }, + TestCaseResult { + "error": undefined, + "name": "CheckEnvVars#call when all env vars are defined behaves like success load logs success message", + "result": "success", + "time": 0.079159625, + }, + TestCaseResult { + "error": undefined, + "name": "CheckEnvVars#call when all env vars are defined behaves like success load skips the test", + "result": "skipped", + "time": 0.000023007, + }, + ], + }, + ], + "name": "./spec/config/check_env_vars_spec.rb", + "totalTime": undefined, + }, + ], + "totalTime": 0.19118387, +} +`; diff --git a/__tests__/__snapshots__/swift-xunit.test.ts.snap b/__tests__/__snapshots__/swift-xunit.test.ts.snap index 01aa7d9..ae34deb 100644 --- a/__tests__/__snapshots__/swift-xunit.test.ts.snap +++ b/__tests__/__snapshots__/swift-xunit.test.ts.snap @@ -25,7 +25,7 @@ TestRunResult { "error": { "details": undefined, "line": undefined, - "message": undefined, + "message": "failed", "path": undefined, }, "name": "test_always_fail", diff --git a/__tests__/dotnet-nunit.test.ts b/__tests__/dotnet-nunit.test.ts new file mode 100644 index 0000000..e0b4778 --- /dev/null +++ b/__tests__/dotnet-nunit.test.ts @@ -0,0 +1,29 @@ +import * as fs from 'fs' +import * as path from 'path' + +import {DotnetNunitParser} from '../src/parsers/dotnet-nunit/dotnet-nunit-parser' +import {ParseOptions} from '../src/test-parser' +import {getReport} from '../src/report/get-report' +import {normalizeFilePath} from '../src/utils/path-utils' + +describe('dotnet-nunit tests', () => { + it('report from ./reports/dotnet test results matches snapshot', async () => { + const fixturePath = path.join(__dirname, 'fixtures', 'dotnet-nunit.xml') + const outputPath = path.join(__dirname, '__outputs__', 'dotnet-nunit.md') + const filePath = normalizeFilePath(path.relative(__dirname, fixturePath)) + const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'}) + + const opts: ParseOptions = { + parseErrors: true, + trackedFiles: ['DotnetTests.Unit/Calculator.cs', 'DotnetTests.NUnitV3Tests/CalculatorTests.cs'] + } + + const parser = new DotnetNunitParser(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) + }) +}) diff --git a/__tests__/fixtures/dotnet-nunit.xml b/__tests__/fixtures/dotnet-nunit.xml new file mode 100644 index 0000000..e08a9f3 --- /dev/null +++ b/__tests__/fixtures/dotnet-nunit.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/__tests__/fixtures/empty/dart-json.json b/__tests__/fixtures/empty/dart-json.json index 4f3a23e..e47cf11 100644 --- a/__tests__/fixtures/empty/dart-json.json +++ b/__tests__/fixtures/empty/dart-json.json @@ -1,9 +1,15 @@ -{"protocolVersion":"0.1.1","runnerVersion":"1.15.4","pid":21320,"type":"start","time":0} -{"suite":{"id":0,"platform":"vm","path":"test\\main_test.dart"},"type":"suite","time":0} -{"test":{"id":1,"name":"loading test\\main_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":1} -{"suite":{"id":2,"platform":"vm","path":"test\\second_test.dart"},"type":"suite","time":11} -{"test":{"id":3,"name":"loading test\\second_test.dart","suiteID":2,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":11} -{"count":2,"type":"allSuites","time":11} -{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":4018} -{"testID":3,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":4025} -{"success":true,"type":"done","time":4029} +{"protocolVersion":"0.1.1","runnerVersion":"1.25.3","pid":7103,"type":"start","time":0} +{"suite":{"id":0,"platform":"vm","path":"test/second_test.dart"},"type":"suite","time":0} +{"test":{"id":1,"name":"loading test/second_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":0} +{"suite":{"id":2,"platform":"vm","path":"test/main_test.dart"},"type":"suite","time":4} +{"test":{"id":3,"name":"loading test/main_test.dart","suiteID":2,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":4} +{"count":2,"time":5,"type":"allSuites"} +{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":294} +{"testID":3,"messageType":"print","message":"Hello from the test","type":"print","time":297} +{"testID":3,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":321} +{"group":{"id":4,"suiteID":2,"parentID":null,"name":"","metadata":{"skip":false,"skipReason":null},"testCount":0,"line":null,"column":null,"url":null},"type":"group","time":322} +{"test":{"id":5,"name":"(setUpAll)","suiteID":2,"groupIDs":[4],"metadata":{"skip":false,"skipReason":null},"line":6,"column":3,"url":"file:///Users/domu/Downloads/test-reporter/reports/dart/test/main_test.dart"},"type":"testStart","time":322} +{"testID":5,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":330} +{"test":{"id":6,"name":"(tearDownAll)","suiteID":2,"groupIDs":[4],"metadata":{"skip":false,"skipReason":null},"line":7,"column":3,"url":"file:///Users/domu/Downloads/test-reporter/reports/dart/test/main_test.dart"},"type":"testStart","time":330} +{"testID":6,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":331} +{"success":true,"type":"done","time":333} diff --git a/__tests__/fixtures/empty/rspec-json.json b/__tests__/fixtures/empty/rspec-json.json new file mode 100644 index 0000000..3629097 --- /dev/null +++ b/__tests__/fixtures/empty/rspec-json.json @@ -0,0 +1,17 @@ +{ + "version": "3.13.0", + "messages": [ + "No examples found." + ], + "examples": [ + + ], + "summary": { + "duration": 0.002514266, + "example_count": 0, + "failure_count": 0, + "pending_count": 0, + "errors_outside_of_examples_count": 0 + }, + "summary_line": "0 examples, 0 failures" +} diff --git a/__tests__/fixtures/external/nunit-sample.xml b/__tests__/fixtures/external/nunit-sample.xml new file mode 100644 index 0000000..b261560 --- /dev/null +++ b/__tests__/fixtures/external/nunit-sample.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/__tests__/fixtures/rspec-json.json b/__tests__/fixtures/rspec-json.json new file mode 100644 index 0000000..34d4e49 --- /dev/null +++ b/__tests__/fixtures/rspec-json.json @@ -0,0 +1,53 @@ +{ + "version": "3.13.0", + "examples": [ + { + "id": "./spec/config/check_env_vars_spec.rb[1:1:1:1:1]", + "description": "logs success message", + "full_description": "CheckEnvVars#call when all env vars are defined behaves like success load logs success message", + "status": "passed", + "file_path": "./spec/config/check_env_vars_spec.rb", + "line_number": 12, + "run_time": 0.079159625, + "pending_message": null + }, + { + "id": "./spec/config/check_env_vars_spec.rb[1:1:1:1:2]", + "description": "fails in assertion", + "full_description": "CheckEnvVars#call when all env vars are defined behaves like success load fails in assertion", + "status": "failed", + "file_path": "./spec/config/check_env_vars_spec.rb", + "line_number": 17, + "run_time": 0.004411051, + "pending_message": null, + "exception": { + "class": "RSpec::Mocks::MockExpectationError", + "message": "(#ActiveSupport::BroadcastLogger:0x00007f1007fedf58).debug(\"All config env vars exist\")\n expected: 0 times with arguments: (\"All config env vars exist\")\n received: 1 time with arguments: (\"All config env vars exist\")", + "backtrace": [ + "/usr/local/bundle/ruby/3.3.0/gems/net-http-0.4.1/lib/net/http.rb:1603:in `initialize'", + "./config/check_env_vars.rb:11:in `call'", + "./spec/config/check_env_vars_spec.rb:7:in `block (3 levels) in \u003ctop (required)\u003e'", + "./spec/config/check_env_vars_spec.rb:19:in `block (4 levels) in \u003ctop (required)\u003e'" + ] + } + }, + { + "id": "./spec/config/check_env_vars_spec.rb[1:1:1:1:4]", + "description": "skips the test", + "full_description": "CheckEnvVars#call when all env vars are defined behaves like success load skips the test", + "status": "pending", + "file_path": "./spec/config/check_env_vars_spec.rb", + "line_number": 27, + "run_time": 2.3007e-05, + "pending_message": "Temporarily skipped with xit" + } + ], + "summary": { + "duration": 0.19118387, + "example_count": 3, + "failure_count": 1, + "pending_count": 1, + "errors_outside_of_examples_count": 0 + }, + "summary_line": "3 examples, 1 failures, 1 pending" +} diff --git a/__tests__/rspec-json.test.ts b/__tests__/rspec-json.test.ts new file mode 100644 index 0000000..f77475a --- /dev/null +++ b/__tests__/rspec-json.test.ts @@ -0,0 +1,45 @@ +import * as fs from 'fs' +import * as path from 'path' + +import {RspecJsonParser} from '../src/parsers/rspec-json/rspec-json-parser' +import {ParseOptions} from '../src/test-parser' +import {getReport} from '../src/report/get-report' +import {normalizeFilePath} from '../src/utils/path-utils' + +describe('rspec-json tests', () => { + it('produces empty test run result when there are no test cases', async () => { + const fixturePath = path.join(__dirname, 'fixtures', 'empty', 'rspec-json.json') + const filePath = normalizeFilePath(path.relative(__dirname, fixturePath)) + const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'}) + + const opts: ParseOptions = { + parseErrors: true, + trackedFiles: [] + } + + const parser = new RspecJsonParser(opts) + const result = await parser.parse(filePath, fileContent) + expect(result.tests).toBe(0) + expect(result.result).toBe('success') + }) + + it('report from ./reports/rspec-json test results matches snapshot', async () => { + const fixturePath = path.join(__dirname, 'fixtures', 'rspec-json.json') + const outputPath = path.join(__dirname, '__outputs__', 'rspec-json.md') + const filePath = normalizeFilePath(path.relative(__dirname, fixturePath)) + const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'}) + + const opts: ParseOptions = { + parseErrors: true, + trackedFiles: ['test/main.test.js', 'test/second.test.js', 'lib/main.js'] + } + + const parser = new RspecJsonParser(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) + }) +}) diff --git a/action.yml b/action.yml index 5f3687e..dae5bc0 100644 --- a/action.yml +++ b/action.yml @@ -26,11 +26,13 @@ inputs: description: | Format of test results. Supported options: - dart-json + - dotnet-nunit - dotnet-trx - flutter-json - java-junit - jest-junit - mocha-json + - rspec-json - swift-xunit required: true list-suites: diff --git a/dist/index.js b/dist/index.js index 7902034..3528cdc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29,15 +29,6 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -49,6 +40,16 @@ const adm_zip_1 = __importDefault(__nccwpck_require__(6761)); const picomatch_1 = __importDefault(__nccwpck_require__(8569)); const github_utils_1 = __nccwpck_require__(3522); class ArtifactProvider { + octokit; + artifact; + name; + pattern; + sha; + runId; + token; + artifactNameMatch; + fileNameMatch; + getReportName; constructor(octokit, artifact, name, pattern, sha, runId, token) { this.octokit = octokit; this.artifact = artifact; @@ -81,60 +82,59 @@ class ArtifactProvider { } this.fileNameMatch = (0, picomatch_1.default)(pattern); } - load() { - return __awaiter(this, void 0, void 0, function* () { - const result = {}; - const resp = yield this.octokit.rest.actions.listWorkflowRunArtifacts(Object.assign(Object.assign({}, github.context.repo), { run_id: this.runId })); - if (resp.data.artifacts.length === 0) { - core.warning(`No artifacts found in run ${this.runId}`); - return {}; - } - const artifacts = resp.data.artifacts.filter(a => this.artifactNameMatch(a.name)); - if (artifacts.length === 0) { - core.warning(`No artifact matches ${this.artifact}`); - return {}; - } - for (const art of artifacts) { - const fileName = `${art.name}.zip`; - yield (0, github_utils_1.downloadArtifact)(this.octokit, art.id, fileName, this.token); - core.startGroup(`Reading archive ${fileName}`); - try { - const reportName = this.getReportName(art.name); - core.info(`Report name: ${reportName}`); - const files = []; - const zip = new adm_zip_1.default(fileName); - for (const entry of zip.getEntries()) { - const file = entry.entryName; - if (entry.isDirectory) { - core.info(`Skipping ${file}: entry is a directory`); - continue; - } - if (!this.fileNameMatch(file)) { - core.info(`Skipping ${file}: filename does not match pattern`); - continue; - } - const content = zip.readAsText(entry); - files.push({ file, content }); - core.info(`Read ${file}: ${content.length} chars`); - } - if (result[reportName]) { - result[reportName].push(...files); + async load() { + const result = {}; + const resp = await this.octokit.rest.actions.listWorkflowRunArtifacts({ + ...github.context.repo, + run_id: this.runId + }); + if (resp.data.artifacts.length === 0) { + core.warning(`No artifacts found in run ${this.runId}`); + return {}; + } + const artifacts = resp.data.artifacts.filter(a => this.artifactNameMatch(a.name)); + if (artifacts.length === 0) { + core.warning(`No artifact matches ${this.artifact}`); + return {}; + } + for (const art of artifacts) { + const fileName = `${art.name}.zip`; + await (0, github_utils_1.downloadArtifact)(this.octokit, art.id, fileName, this.token); + core.startGroup(`Reading archive ${fileName}`); + try { + const reportName = this.getReportName(art.name); + core.info(`Report name: ${reportName}`); + const files = []; + const zip = new adm_zip_1.default(fileName); + for (const entry of zip.getEntries()) { + const file = entry.entryName; + if (entry.isDirectory) { + core.info(`Skipping ${file}: entry is a directory`); + continue; } - else { - result[reportName] = files; + if (!this.fileNameMatch(file)) { + core.info(`Skipping ${file}: filename does not match pattern`); + continue; } + const content = zip.readAsText(entry); + files.push({ file, content }); + core.info(`Read ${file}: ${content.length} chars`); + } + if (result[reportName]) { + result[reportName].push(...files); } - finally { - core.endGroup(); + else { + result[reportName] = files; } } - return result; - }); + finally { + core.endGroup(); + } + } + return result; } - listTrackedFiles() { - return __awaiter(this, void 0, void 0, function* () { - return (0, github_utils_1.listFiles)(this.octokit, this.sha); - }); + async listTrackedFiles() { + return (0, github_utils_1.listFiles)(this.octokit, this.sha); } } exports.ArtifactProvider = ArtifactProvider; @@ -170,15 +170,6 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -188,27 +179,25 @@ const fs = __importStar(__nccwpck_require__(7147)); const fast_glob_1 = __importDefault(__nccwpck_require__(3664)); const git_1 = __nccwpck_require__(9844); class LocalFileProvider { + name; + pattern; constructor(name, pattern) { this.name = name; this.pattern = pattern; } - load() { - return __awaiter(this, void 0, void 0, function* () { - const result = []; - for (const pat of this.pattern) { - const paths = yield (0, fast_glob_1.default)(pat, { dot: true }); - for (const file of paths) { - const content = yield fs.promises.readFile(file, { encoding: 'utf8' }); - result.push({ file, content }); - } + async load() { + const result = []; + for (const pat of this.pattern) { + const paths = await (0, fast_glob_1.default)(pat, { dot: true }); + for (const file of paths) { + const content = await fs.promises.readFile(file, { encoding: 'utf8' }); + result.push({ file, content }); } - return { [this.name]: result }; - }); + } + return { [this.name]: result }; } - listTrackedFiles() { - return __awaiter(this, void 0, void 0, function* () { - return (0, git_1.listFiles)(); - }); + async listTrackedFiles() { + return (0, git_1.listFiles)(); } } exports.LocalFileProvider = LocalFileProvider; @@ -244,15 +233,6 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__nccwpck_require__(2186)); const github = __importStar(__nccwpck_require__(5438)); @@ -261,45 +241,46 @@ const local_file_provider_1 = __nccwpck_require__(9399); const get_annotations_1 = __nccwpck_require__(5867); const get_report_1 = __nccwpck_require__(3737); const dart_json_parser_1 = __nccwpck_require__(4528); +const dotnet_nunit_parser_1 = __nccwpck_require__(5706); const dotnet_trx_parser_1 = __nccwpck_require__(2664); const java_junit_parser_1 = __nccwpck_require__(676); const jest_junit_parser_1 = __nccwpck_require__(1113); const mocha_json_parser_1 = __nccwpck_require__(6043); +const rspec_json_parser_1 = __nccwpck_require__(406); const swift_xunit_parser_1 = __nccwpck_require__(5366); const path_utils_1 = __nccwpck_require__(4070); const github_utils_1 = __nccwpck_require__(3522); -function main() { - return __awaiter(this, void 0, void 0, function* () { - try { - const testReporter = new TestReporter(); - yield testReporter.run(); - } - catch (error) { - if (error instanceof Error) - core.setFailed(error); - else - core.setFailed(JSON.stringify(error)); - } - }); +async function main() { + try { + const testReporter = new TestReporter(); + await testReporter.run(); + } + catch (error) { + if (error instanceof Error) + core.setFailed(error); + else + core.setFailed(JSON.stringify(error)); + } } class TestReporter { + artifact = core.getInput('artifact', { required: false }); + name = core.getInput('name', { required: true }); + path = core.getInput('path', { required: true }); + pathReplaceBackslashes = core.getInput('path-replace-backslashes', { required: false }) === 'true'; + reporter = core.getInput('reporter', { required: true }); + listSuites = core.getInput('list-suites', { required: true }); + listTests = core.getInput('list-tests', { required: true }); + maxAnnotations = parseInt(core.getInput('max-annotations', { required: true })); + failOnError = core.getInput('fail-on-error', { required: true }) === 'true'; + failOnEmpty = core.getInput('fail-on-empty', { required: true }) === 'true'; + workDirInput = core.getInput('working-directory', { required: false }); + onlySummary = core.getInput('only-summary', { required: false }) === 'true'; + useActionsSummary = core.getInput('use-actions-summary', { required: false }) === 'true'; + badgeTitle = core.getInput('badge-title', { required: false }); + token = core.getInput('token', { required: true }); + octokit; + context = (0, github_utils_1.getCheckRunContext)(); constructor() { - this.artifact = core.getInput('artifact', { required: false }); - this.name = core.getInput('name', { required: true }); - this.path = core.getInput('path', { required: true }); - this.pathReplaceBackslashes = core.getInput('path-replace-backslashes', { required: false }) === 'true'; - this.reporter = core.getInput('reporter', { required: true }); - this.listSuites = core.getInput('list-suites', { required: true }); - this.listTests = core.getInput('list-tests', { required: true }); - this.maxAnnotations = parseInt(core.getInput('max-annotations', { required: true })); - this.failOnError = core.getInput('fail-on-error', { required: true }) === 'true'; - this.failOnEmpty = core.getInput('fail-on-empty', { required: true }) === 'true'; - this.workDirInput = core.getInput('working-directory', { required: false }); - this.onlySummary = core.getInput('only-summary', { required: false }) === 'true'; - this.useActionsSummary = core.getInput('use-actions-summary', { required: false }) === 'true'; - this.badgeTitle = core.getInput('badge-title', { required: false }); - this.token = core.getInput('token', { required: true }); - this.context = (0, github_utils_1.getCheckRunContext)(); this.octokit = github.getOctokit(this.token); if (this.listSuites !== 'all' && this.listSuites !== 'failed' && this.listSuites !== 'none') { core.setFailed(`Input parameter 'list-suites' has invalid value`); @@ -314,127 +295,137 @@ class TestReporter { return; } } - run() { - return __awaiter(this, void 0, void 0, function* () { - if (this.workDirInput) { - core.info(`Changing directory to '${this.workDirInput}'`); - process.chdir(this.workDirInput); - } - core.info(`Check runs will be created with SHA=${this.context.sha}`); - // Split path pattern by ',' and optionally convert all backslashes to forward slashes - // fast-glob (micromatch) always interprets backslashes as escape characters instead of directory separators - const pathsList = this.path.split(','); - const pattern = this.pathReplaceBackslashes ? pathsList.map(path_utils_1.normalizeFilePath) : pathsList; - const inputProvider = this.artifact - ? new artifact_provider_1.ArtifactProvider(this.octokit, this.artifact, this.name, pattern, this.context.sha, this.context.runId, this.token) - : new local_file_provider_1.LocalFileProvider(this.name, pattern); - const parseErrors = this.maxAnnotations > 0; - const trackedFiles = parseErrors ? yield inputProvider.listTrackedFiles() : []; - const workDir = this.artifact ? undefined : (0, path_utils_1.normalizeDirPath)(process.cwd(), true); - if (parseErrors) - core.info(`Found ${trackedFiles.length} files tracked by GitHub`); - const options = { - workDir, - trackedFiles, - parseErrors - }; - core.info(`Using test report parser '${this.reporter}'`); - const parser = this.getParser(this.reporter, options); - const results = []; - const input = yield inputProvider.load(); - for (const [reportName, files] of Object.entries(input)) { - try { - core.startGroup(`Creating test report ${reportName}`); - const tr = yield this.createReport(parser, reportName, files); - results.push(...tr); - } - finally { - core.endGroup(); - } + async run() { + if (this.workDirInput) { + core.info(`Changing directory to '${this.workDirInput}'`); + process.chdir(this.workDirInput); + } + core.info(`Check runs will be created with SHA=${this.context.sha}`); + // Split path pattern by ',' and optionally convert all backslashes to forward slashes + // fast-glob (micromatch) always interprets backslashes as escape characters instead of directory separators + const pathsList = this.path.split(','); + const pattern = this.pathReplaceBackslashes ? pathsList.map(path_utils_1.normalizeFilePath) : pathsList; + const inputProvider = this.artifact + ? new artifact_provider_1.ArtifactProvider(this.octokit, this.artifact, this.name, pattern, this.context.sha, this.context.runId, this.token) + : new local_file_provider_1.LocalFileProvider(this.name, pattern); + const parseErrors = this.maxAnnotations > 0; + const trackedFiles = parseErrors ? await inputProvider.listTrackedFiles() : []; + const workDir = this.artifact ? undefined : (0, path_utils_1.normalizeDirPath)(process.cwd(), true); + if (parseErrors) + core.info(`Found ${trackedFiles.length} files tracked by GitHub`); + const options = { + workDir, + trackedFiles, + parseErrors + }; + core.info(`Using test report parser '${this.reporter}'`); + const parser = this.getParser(this.reporter, options); + const results = []; + const input = await inputProvider.load(); + for (const [reportName, files] of Object.entries(input)) { + try { + core.startGroup(`Creating test report ${reportName}`); + const tr = await this.createReport(parser, reportName, files); + results.push(...tr); + } + finally { + core.endGroup(); + } + } + const isFailed = results.some(tr => tr.result === 'failed'); + const conclusion = isFailed ? 'failure' : 'success'; + const passed = results.reduce((sum, tr) => sum + tr.passed, 0); + const failed = results.reduce((sum, tr) => sum + tr.failed, 0); + const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); + const time = results.reduce((sum, tr) => sum + tr.time, 0); + core.setOutput('conclusion', conclusion); + core.setOutput('passed', passed); + core.setOutput('failed', failed); + core.setOutput('skipped', skipped); + core.setOutput('time', time); + if (this.failOnError && isFailed) { + core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`); + return; + } + if (results.length === 0 && this.failOnEmpty) { + core.setFailed(`No test report files were found`); + return; + } + } + async createReport(parser, name, files) { + if (files.length === 0) { + core.warning(`No file matches path ${this.path}`); + return []; + } + core.info(`Processing test results for check run ${name}`); + const results = []; + for (const { file, content } of files) { + try { + const tr = await parser.parse(file, content); + results.push(tr); + } + catch (error) { + core.error(`Processing test results from ${file} failed`); + throw error; } - const isFailed = results.some(tr => tr.result === 'failed'); + } + const { listSuites, listTests, onlySummary, useActionsSummary, badgeTitle } = this; + let baseUrl = ''; + if (this.useActionsSummary) { + const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary, useActionsSummary, badgeTitle }); + core.info('Summary content:'); + core.info(summary); + await core.summary.addRaw(summary).write(); + } + else { + core.info(`Creating check run ${name}`); + const createResp = await this.octokit.rest.checks.create({ + head_sha: this.context.sha, + name, + status: 'in_progress', + output: { + title: name, + summary: '' + }, + ...github.context.repo + }); + core.info('Creating report summary'); + baseUrl = createResp.data.html_url; + const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary, useActionsSummary, badgeTitle }); + core.info('Creating annotations'); + const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations); + const isFailed = this.failOnError && results.some(tr => tr.result === 'failed'); const conclusion = isFailed ? 'failure' : 'success'; const passed = results.reduce((sum, tr) => sum + tr.passed, 0); const failed = results.reduce((sum, tr) => sum + tr.failed, 0); const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); - const time = results.reduce((sum, tr) => sum + tr.time, 0); - core.setOutput('conclusion', conclusion); - core.setOutput('passed', passed); - core.setOutput('failed', failed); - core.setOutput('skipped', skipped); - core.setOutput('time', time); - if (this.failOnError && isFailed) { - core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`); - return; - } - if (results.length === 0 && this.failOnEmpty) { - core.setFailed(`No test report files were found`); - return; - } - }); - } - createReport(parser, name, files) { - return __awaiter(this, void 0, void 0, function* () { - if (files.length === 0) { - core.warning(`No file matches path ${this.path}`); - return []; - } - core.info(`Processing test results for check run ${name}`); - const results = []; - for (const { file, content } of files) { - try { - const tr = yield parser.parse(file, content); - results.push(tr); - } - catch (error) { - core.error(`Processing test results from ${file} failed`); - throw error; - } - } - const { listSuites, listTests, onlySummary, useActionsSummary, badgeTitle } = this; - let baseUrl = ''; - if (this.useActionsSummary) { - const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary, useActionsSummary, badgeTitle }); - core.info('Summary content:'); - core.info(summary); - yield core.summary.addRaw(summary).write(); - } - else { - core.info(`Creating check run ${name}`); - const createResp = yield this.octokit.rest.checks.create(Object.assign({ head_sha: this.context.sha, name, status: 'in_progress', output: { - title: name, - summary: '' - } }, github.context.repo)); - core.info('Creating report summary'); - baseUrl = createResp.data.html_url; - const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary, useActionsSummary, badgeTitle }); - core.info('Creating annotations'); - const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations); - const isFailed = this.failOnError && results.some(tr => tr.result === 'failed'); - const conclusion = isFailed ? 'failure' : 'success'; - const passed = results.reduce((sum, tr) => sum + tr.passed, 0); - const failed = results.reduce((sum, tr) => sum + tr.failed, 0); - const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); - const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `; - core.info(`Updating check run conclusion (${conclusion}) and output`); - const resp = yield this.octokit.rest.checks.update(Object.assign({ check_run_id: createResp.data.id, conclusion, status: 'completed', output: { - title: shortSummary, - summary, - annotations - } }, github.context.repo)); - core.info(`Check run create response: ${resp.status}`); - core.info(`Check run URL: ${resp.data.url}`); - core.info(`Check run HTML: ${resp.data.html_url}`); - core.setOutput('url', resp.data.url); - core.setOutput('url_html', resp.data.html_url); - } - return results; - }); + const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `; + core.info(`Updating check run conclusion (${conclusion}) and output`); + const resp = await this.octokit.rest.checks.update({ + check_run_id: createResp.data.id, + conclusion, + status: 'completed', + output: { + title: shortSummary, + summary, + annotations + }, + ...github.context.repo + }); + core.info(`Check run create response: ${resp.status}`); + core.info(`Check run URL: ${resp.data.url}`); + core.info(`Check run HTML: ${resp.data.html_url}`); + core.setOutput('url', resp.data.url); + core.setOutput('url_html', resp.data.html_url); + } + return results; } getParser(reporter, options) { switch (reporter) { case 'dart-json': return new dart_json_parser_1.DartJsonParser(options, 'dart'); + case 'dotnet-nunit': + return new dotnet_nunit_parser_1.DotnetNunitParser(options); case 'dotnet-trx': return new dotnet_trx_parser_1.DotnetTrxParser(options); case 'flutter-json': @@ -445,6 +436,8 @@ class TestReporter { return new jest_junit_parser_1.JestJunitParser(options); case 'mocha-json': return new mocha_json_parser_1.MochaJsonParser(options); + case 'rspec-json': + return new rspec_json_parser_1.RspecJsonParser(options); case 'swift-xunit': return new swift_xunit_parser_1.SwiftXunitParser(options); default: @@ -458,25 +451,20 @@ main(); /***/ }), /***/ 4528: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DartJsonParser = void 0; const path_utils_1 = __nccwpck_require__(4070); const dart_json_types_1 = __nccwpck_require__(7887); const test_results_1 = __nccwpck_require__(2768); class TestRun { + path; + suites; + success; + time; constructor(path, suites, success, time) { this.path = path; this.suites = suites; @@ -485,32 +473,37 @@ class TestRun { } } class TestSuite { + suite; constructor(suite) { this.suite = suite; - this.groups = {}; } + groups = {}; } class TestGroup { + group; constructor(group) { this.group = group; - this.tests = []; } + tests = []; } class TestCase { + testStart; constructor(testStart) { this.testStart = testStart; - this.print = []; this.groupId = testStart.test.groupIDs[testStart.test.groupIDs.length - 1]; } + groupId; + print = []; + testDone; + error; get result() { - var _a, _b, _c, _d; - if ((_a = this.testDone) === null || _a === void 0 ? void 0 : _a.skipped) { + if (this.testDone?.skipped) { return 'skipped'; } - if (((_b = this.testDone) === null || _b === void 0 ? void 0 : _b.result) === 'success') { + if (this.testDone?.result === 'success') { return 'success'; } - if (((_c = this.testDone) === null || _c === void 0 ? void 0 : _c.result) === 'error' || ((_d = this.testDone) === null || _d === void 0 ? void 0 : _d.result) === 'failure') { + if (this.testDone?.result === 'error' || this.testDone?.result === 'failure') { return 'failed'; } return undefined; @@ -520,16 +513,17 @@ class TestCase { } } class DartJsonParser { + options; + sdk; + assumedWorkDir; constructor(options, sdk) { this.options = options; this.sdk = sdk; } - parse(path, content) { - return __awaiter(this, void 0, void 0, function* () { - const tr = this.getTestRun(path, content); - const result = this.getTestRunResult(tr); - return Promise.resolve(result); - }); + async parse(path, content) { + const tr = this.getTestRun(path, content); + const result = this.getTestRunResult(tr); + return Promise.resolve(result); } getTestRun(path, content) { const lines = content.split(/\n\r?/g); @@ -566,7 +560,7 @@ class DartJsonParser { group.tests.push(test); tests[evt.test.id] = test; } - else if ((0, dart_json_types_1.isTestDoneEvent)(evt) && !evt.hidden && tests[evt.testID]) { + else if ((0, dart_json_types_1.isTestDoneEvent)(evt) && tests[evt.testID]) { tests[evt.testID].testDone = evt; } else if ((0, dart_json_types_1.isErrorEvent)(evt) && tests[evt.testID]) { @@ -590,10 +584,12 @@ class DartJsonParser { } getGroups(suite) { const groups = Object.values(suite.groups).filter(grp => grp.tests.length > 0); - groups.sort((a, b) => { var _a, _b; return ((_a = a.group.line) !== null && _a !== void 0 ? _a : 0) - ((_b = b.group.line) !== null && _b !== void 0 ? _b : 0); }); + groups.sort((a, b) => (a.group.line ?? 0) - (b.group.line ?? 0)); return groups.map(group => { - group.tests.sort((a, b) => { var _a, _b; return ((_a = a.testStart.test.line) !== null && _a !== void 0 ? _a : 0) - ((_b = b.testStart.test.line) !== null && _b !== void 0 ? _b : 0); }); - const tests = group.tests.map(tc => { + group.tests.sort((a, b) => (a.testStart.test.line ?? 0) - (b.testStart.test.line ?? 0)); + const tests = group.tests + .filter(tc => !tc.testDone?.hidden) + .map(tc => { const error = this.getError(suite, tc); const testName = group.group.name !== undefined && tc.testStart.test.name.startsWith(group.group.name) ? tc.testStart.test.name.slice(group.group.name.length).trim() @@ -604,19 +600,18 @@ class DartJsonParser { }); } getError(testSuite, test) { - var _a, _b, _c, _d, _e, _f; if (!this.options.parseErrors || !test.error) { return undefined; } const { trackedFiles } = this.options; - const stackTrace = (_b = (_a = test.error) === null || _a === void 0 ? void 0 : _a.stackTrace) !== null && _b !== void 0 ? _b : ''; + const stackTrace = test.error?.stackTrace ?? ''; const print = test.print .filter(p => p.messageType === 'print') .map(p => p.message) .join('\n'); const details = [print, stackTrace].filter(str => str !== '').join('\n'); const src = this.exceptionThrowSource(details, trackedFiles); - const message = this.getErrorMessage((_d = (_c = test.error) === null || _c === void 0 ? void 0 : _c.error) !== null && _d !== void 0 ? _d : '', print); + const message = this.getErrorMessage(test.error?.error ?? '', print); let path; let line; if (src !== undefined) { @@ -627,7 +622,7 @@ class DartJsonParser { const testStartPath = this.getRelativePath(testSuite.suite.path); if (trackedFiles.includes(testStartPath)) { path = testStartPath; - line = (_f = (_e = test.testStart.test.root_line) !== null && _e !== void 0 ? _e : test.testStart.test.line) !== null && _f !== void 0 ? _f : undefined; + line = test.testStart.test.root_line ?? test.testStart.test.line ?? undefined; } } return { @@ -681,8 +676,9 @@ class DartJsonParser { return path; } getWorkDir(path) { - var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } exports.DartJsonParser = DartJsonParser; @@ -728,22 +724,133 @@ function isMessageEvent(event) { exports.isMessageEvent = isMessageEvent; +/***/ }), + +/***/ 5706: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DotnetNunitParser = void 0; +const xml2js_1 = __nccwpck_require__(6189); +const node_utils_1 = __nccwpck_require__(5824); +const path_utils_1 = __nccwpck_require__(4070); +const test_results_1 = __nccwpck_require__(2768); +class DotnetNunitParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const ju = await this.getNunitReport(path, content); + return this.getTestRunResult(path, ju); + } + async getNunitReport(path, content) { + try { + return (await (0, xml2js_1.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } + } + getTestRunResult(path, nunit) { + const suites = []; + const time = parseFloat(nunit['test-run'].$.duration) * 1000; + this.populateTestCasesRecursive(suites, [], nunit['test-run']['test-suite']); + return new test_results_1.TestRunResult(path, suites, time); + } + populateTestCasesRecursive(result, suitePath, testSuites) { + if (testSuites === undefined) { + return; + } + for (const suite of testSuites) { + suitePath.push(suite); + this.populateTestCasesRecursive(result, suitePath, suite['test-suite']); + const testcases = suite['test-case']; + if (testcases !== undefined) { + for (const testcase of testcases) { + this.addTestCase(result, suitePath, testcase); + } + } + suitePath.pop(); + } + } + addTestCase(result, suitePath, testCase) { + // The last suite in the suite path is the "group". + // The rest are concatenated together to form the "suite". + // But ignore "Theory" suites. + const suitesWithoutTheories = suitePath.filter(suite => suite.$.type !== 'Theory'); + const suiteName = suitesWithoutTheories + .slice(0, suitesWithoutTheories.length - 1) + .map(suite => suite.$.name) + .join('.'); + const groupName = suitesWithoutTheories[suitesWithoutTheories.length - 1].$.name; + let existingSuite = result.find(existingSuite => existingSuite.name === suiteName); + if (existingSuite === undefined) { + existingSuite = new test_results_1.TestSuiteResult(suiteName, []); + result.push(existingSuite); + } + let existingGroup = existingSuite.groups.find(existingGroup => existingGroup.name === groupName); + if (existingGroup === undefined) { + existingGroup = new test_results_1.TestGroupResult(groupName, []); + existingSuite.groups.push(existingGroup); + } + existingGroup.tests.push(new test_results_1.TestCaseResult(testCase.$.name, this.getTestExecutionResult(testCase), parseFloat(testCase.$.duration) * 1000, this.getTestCaseError(testCase))); + } + getTestExecutionResult(test) { + if (test.$.result === 'Failed' || test.failure) + return 'failed'; + if (test.$.result === 'Skipped') + return 'skipped'; + return 'success'; + } + getTestCaseError(tc) { + if (!this.options.parseErrors || !tc.failure || tc.failure.length === 0) { + return undefined; + } + const details = tc.failure[0]; + let path; + let line; + if (details['stack-trace'] !== undefined && details['stack-trace'].length > 0) { + const src = (0, node_utils_1.getExceptionSource)(details['stack-trace'][0], this.options.trackedFiles, file => this.getRelativePath(file)); + if (src) { + path = src.path; + line = src.line; + } + } + return { + path, + line, + message: details.message && details.message.length > 0 ? details.message[0] : '', + details: details['stack-trace'] && details['stack-trace'].length > 0 ? details['stack-trace'][0] : '' + }; + } + getRelativePath(path) { + path = (0, path_utils_1.normalizeFilePath)(path); + const workDir = this.getWorkDir(path); + if (workDir !== undefined && path.startsWith(workDir)) { + path = path.substr(workDir.length); + } + return path; + } + getWorkDir(path) { + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); + } +} +exports.DotnetNunitParser = DotnetNunitParser; + + /***/ }), /***/ 2664: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DotnetTrxParser = void 0; const xml2js_1 = __nccwpck_require__(6189); @@ -751,12 +858,17 @@ const path_utils_1 = __nccwpck_require__(4070); const parse_utils_1 = __nccwpck_require__(7811); const test_results_1 = __nccwpck_require__(2768); class TestClass { + name; constructor(name) { this.name = name; - this.tests = []; } + tests = []; } class Test { + name; + outcome; + duration; + error; constructor(name, outcome, duration, error) { this.name = name; this.outcome = outcome; @@ -775,27 +887,25 @@ class Test { } } class DotnetTrxParser { + options; + assumedWorkDir; constructor(options) { this.options = options; } - parse(path, content) { - return __awaiter(this, void 0, void 0, function* () { - const trx = yield this.getTrxReport(path, content); - const tc = this.getTestClasses(trx); - const tr = this.getTestRunResult(path, trx, tc); - tr.sort(true); - return tr; - }); + async parse(path, content) { + const trx = await this.getTrxReport(path, content); + const tc = this.getTestClasses(trx); + const tr = this.getTestRunResult(path, trx, tc); + tr.sort(true); + return tr; } - getTrxReport(path, content) { - return __awaiter(this, void 0, void 0, function* () { - try { - return (yield (0, xml2js_1.parseStringPromise)(content)); - } - catch (e) { - throw new Error(`Invalid XML at ${path}\n\n${e}`); - } - }); + async getTrxReport(path, content) { + try { + return (await (0, xml2js_1.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } } getTestClasses(trx) { if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined) { @@ -846,12 +956,11 @@ class DotnetTrxParser { return new test_results_1.TestRunResult(path, suites, totalTime); } getErrorInfo(testResult) { - var _a; if (testResult.$.outcome !== 'Failed') { return undefined; } const output = testResult.Output; - const error = (output === null || output === void 0 ? void 0 : output.length) > 0 && ((_a = output[0].ErrorInfo) === null || _a === void 0 ? void 0 : _a.length) > 0 ? output[0].ErrorInfo[0] : undefined; + const error = output?.length > 0 && output[0].ErrorInfo?.length > 0 ? output[0].ErrorInfo[0] : undefined; return error; } getError(test) { @@ -902,8 +1011,9 @@ class DotnetTrxParser { } } getWorkDir(path) { - var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } exports.DotnetTrxParser = DotnetTrxParser; @@ -939,15 +1049,6 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JavaJunitParser = void 0; const path = __importStar(__nccwpck_require__(1017)); @@ -956,53 +1057,49 @@ const java_stack_trace_element_parser_1 = __nccwpck_require__(5775); const path_utils_1 = __nccwpck_require__(4070); const test_results_1 = __nccwpck_require__(2768); class JavaJunitParser { + options; + trackedFiles; constructor(options) { - var _a; this.options = options; // Map to efficient lookup of all paths with given file name this.trackedFiles = {}; for (const filePath of options.trackedFiles) { const fileName = path.basename(filePath); - const files = (_a = this.trackedFiles[fileName]) !== null && _a !== void 0 ? _a : (this.trackedFiles[fileName] = []); + const files = this.trackedFiles[fileName] ?? (this.trackedFiles[fileName] = []); files.push((0, path_utils_1.normalizeFilePath)(filePath)); } } - parse(filePath, content) { - return __awaiter(this, void 0, void 0, function* () { - const reportOrSuite = yield this.getJunitReport(filePath, content); - const isReport = reportOrSuite.testsuites !== undefined; - // XML might contain: - // - multiple suites under root node - // - single as root node - let ju; - if (isReport) { - ju = reportOrSuite; - } - else { - // Make it behave the same way as if suite was inside root node - const suite = reportOrSuite.testsuite; - ju = { - testsuites: { - $: { time: suite.$.time }, - testsuite: [suite] - } - }; - } - return this.getTestRunResult(filePath, ju); - }); + async parse(filePath, content) { + const reportOrSuite = await this.getJunitReport(filePath, content); + const isReport = reportOrSuite.testsuites !== undefined; + // XML might contain: + // - multiple suites under root node + // - single as root node + let ju; + if (isReport) { + ju = reportOrSuite; + } + else { + // Make it behave the same way as if suite was inside root node + const suite = reportOrSuite.testsuite; + ju = { + testsuites: { + $: { time: suite.$.time }, + testsuite: [suite] + } + }; + } + return this.getTestRunResult(filePath, ju); } - getJunitReport(filePath, content) { - return __awaiter(this, void 0, void 0, function* () { - try { - return yield (0, xml2js_1.parseStringPromise)(content); - } - catch (e) { - throw new Error(`Invalid XML at ${filePath}\n\n${e}`); - } - }); + async getJunitReport(filePath, content) { + try { + return await (0, xml2js_1.parseStringPromise)(content); + } + catch (e) { + throw new Error(`Invalid XML at ${filePath}\n\n${e}`); + } } getTestRunResult(filePath, junit) { - var _a; const suites = junit.testsuites.testsuite === undefined ? [] : junit.testsuites.testsuite.map(ts => { @@ -1011,7 +1108,7 @@ class JavaJunitParser { const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time); return sr; }); - const seconds = parseFloat((_a = junit.testsuites.$) === null || _a === void 0 ? void 0 : _a.time); + const seconds = parseFloat(junit.testsuites.$?.time); const time = isNaN(seconds) ? undefined : seconds * 1000; return new test_results_1.TestRunResult(filePath, suites, time); } @@ -1051,12 +1148,11 @@ class JavaJunitParser { return 'success'; } getTestCaseError(tc) { - var _a; if (!this.options.parseErrors) { return undefined; } // We process and the same way - const failures = (_a = tc.failure) !== null && _a !== void 0 ? _a : tc.error; + const failures = tc.failure ?? tc.error; if (!failures) { return undefined; } @@ -1071,11 +1167,18 @@ class JavaJunitParser { line = src.line; } } + let message; + if (typeof failure === 'object') { + message = failure.$.message; + if (failure.$?.type) { + message = failure.$.type + ': ' + message; + } + } return { path: filePath, line, details, - message: typeof failure === 'object' ? failure.message : undefined + message }; } exceptionThrowSource(stackTrace) { @@ -1182,19 +1285,10 @@ function parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion) { /***/ }), /***/ 1113: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JestJunitParser = void 0; const xml2js_1 = __nccwpck_require__(6189); @@ -1202,24 +1296,22 @@ const node_utils_1 = __nccwpck_require__(5824); const path_utils_1 = __nccwpck_require__(4070); const test_results_1 = __nccwpck_require__(2768); class JestJunitParser { + options; + assumedWorkDir; constructor(options) { this.options = options; } - parse(path, content) { - return __awaiter(this, void 0, void 0, function* () { - const ju = yield this.getJunitReport(path, content); - return this.getTestRunResult(path, ju); - }); + async parse(path, content) { + const ju = await this.getJunitReport(path, content); + return this.getTestRunResult(path, ju); } - getJunitReport(path, content) { - return __awaiter(this, void 0, void 0, function* () { - try { - return (yield (0, xml2js_1.parseStringPromise)(content)); - } - catch (e) { - throw new Error(`Invalid XML at ${path}\n\n${e}`); - } - }); + async getJunitReport(path, content) { + try { + return (await (0, xml2js_1.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } } getTestRunResult(path, junit) { const suites = junit.testsuites.testsuite === undefined @@ -1291,8 +1383,9 @@ class JestJunitParser { return path; } getWorkDir(path) { - var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } escapeCharacters(s) { return s.replace(/([<>])/g, '\\$1'); @@ -1304,35 +1397,26 @@ exports.JestJunitParser = JestJunitParser; /***/ }), /***/ 6043: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MochaJsonParser = void 0; const test_results_1 = __nccwpck_require__(2768); const node_utils_1 = __nccwpck_require__(5824); const path_utils_1 = __nccwpck_require__(4070); class MochaJsonParser { + options; + assumedWorkDir; constructor(options) { this.options = options; } - parse(path, content) { - return __awaiter(this, void 0, void 0, function* () { - const mocha = this.getMochaJson(path, content); - const result = this.getTestRunResult(path, mocha); - result.sort(true); - return Promise.resolve(result); - }); + async parse(path, content) { + const mocha = this.getMochaJson(path, content); + const result = this.getTestRunResult(path, mocha); + result.sort(true); + return Promise.resolve(result); } getMochaJson(path, content) { try { @@ -1345,9 +1429,8 @@ class MochaJsonParser { getTestRunResult(resultsPath, mocha) { const suitesMap = {}; const getSuite = (test) => { - var _a; const path = this.getRelativePath(test.file); - return (_a = suitesMap[path]) !== null && _a !== void 0 ? _a : (suitesMap[path] = new test_results_1.TestSuiteResult(path, [])); + return suitesMap[path] ?? (suitesMap[path] = new test_results_1.TestSuiteResult(path, [])); }; for (const test of mocha.passes) { const suite = getSuite(test); @@ -1365,7 +1448,6 @@ class MochaJsonParser { return new test_results_1.TestRunResult(resultsPath, suites, mocha.stats.duration); } processTest(suite, test, result) { - var _a; const groupName = test.fullTitle !== test.title ? test.fullTitle.substr(0, test.fullTitle.length - test.title.length).trimEnd() : null; @@ -1375,7 +1457,7 @@ class MochaJsonParser { suite.groups.push(group); } const error = this.getTestCaseError(test); - const testCase = new test_results_1.TestCaseResult(test.title, result, (_a = test.duration) !== null && _a !== void 0 ? _a : 0, error); + const testCase = new test_results_1.TestCaseResult(test.title, result, test.duration ?? 0, error); group.tests.push(testCase); } getTestCaseError(test) { @@ -1407,13 +1489,117 @@ class MochaJsonParser { return path; } getWorkDir(path) { - var _a, _b; - return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } exports.MochaJsonParser = MochaJsonParser; +/***/ }), + +/***/ 406: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RspecJsonParser = void 0; +const test_results_1 = __nccwpck_require__(2768); +class RspecJsonParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const mocha = this.getRspecJson(path, content); + const result = this.getTestRunResult(path, mocha); + result.sort(true); + return Promise.resolve(result); + } + getRspecJson(path, content) { + try { + return JSON.parse(content); + } + catch (e) { + throw new Error(`Invalid JSON at ${path}\n\n${e}`); + } + } + getTestRunResult(resultsPath, rspec) { + const suitesMap = {}; + const getSuite = (test) => { + const path = test.file_path; + return suitesMap[path] ?? (suitesMap[path] = new test_results_1.TestSuiteResult(path, [])); + }; + for (const test of rspec.examples) { + const suite = getSuite(test); + if (test.status === 'failed') { + this.processTest(suite, test, 'failed'); + } + else if (test.status === 'passed') { + this.processTest(suite, test, 'success'); + } + else if (test.status === 'pending') { + this.processTest(suite, test, 'skipped'); + } + } + const suites = Object.values(suitesMap); + return new test_results_1.TestRunResult(resultsPath, suites, rspec.summary.duration); + } + processTest(suite, test, result) { + const groupName = test.full_description !== test.description + ? test.full_description.substr(0, test.full_description.length - test.description.length).trimEnd() + : null; + let group = suite.groups.find(grp => grp.name === groupName); + if (group === undefined) { + group = new test_results_1.TestGroupResult(groupName, []); + suite.groups.push(group); + } + const error = this.getTestCaseError(test); + const testCase = new test_results_1.TestCaseResult(test.full_description, result, test.run_time ?? 0, error); + group.tests.push(testCase); + } + getTestCaseError(test) { + const backtrace = test.exception?.backtrace; + const message = test.exception?.message; + if (backtrace === undefined) { + return undefined; + } + let path; + let line; + const details = backtrace.join('\n'); + const src = this.getExceptionSource(backtrace); + if (src) { + path = src.path; + line = src.line; + } + return { + path, + line, + message, + details + }; + } + getExceptionSource(backtrace) { + const re = /^(.*?):(\d+):/; + for (const str of backtrace) { + const match = str.match(re); + if (match !== null) { + const [_, path, lineStr] = match; + if (path.startsWith('./')) { + const line = parseInt(lineStr); + return { path, line }; + } + } + } + return undefined; + } +} +exports.RspecJsonParser = RspecJsonParser; + + /***/ }), /***/ 5366: @@ -1425,6 +1611,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SwiftXunitParser = void 0; const java_junit_parser_1 = __nccwpck_require__(676); class SwiftXunitParser extends java_junit_parser_1.JavaJunitParser { + options; constructor(options) { super(options); this.options = options; @@ -1445,7 +1632,6 @@ exports.getAnnotations = void 0; const markdown_utils_1 = __nccwpck_require__(6482); const parse_utils_1 = __nccwpck_require__(7811); function getAnnotations(results, maxCount) { - var _a, _b, _c, _d; if (maxCount === 0) { return []; } @@ -1461,8 +1647,8 @@ function getAnnotations(results, maxCount) { if (err === undefined) { continue; } - const path = (_a = err.path) !== null && _a !== void 0 ? _a : tr.path; - const line = (_b = err.line) !== null && _b !== void 0 ? _b : 0; + const path = err.path ?? tr.path; + const line = err.line ?? 0; if (mergeDup) { const dup = errors.find(e => path === e.path && line === e.line && err.details === e.details); if (dup !== undefined) { @@ -1475,7 +1661,7 @@ function getAnnotations(results, maxCount) { suiteName: ts.name, testName: tg.name ? `${tg.name} ► ${tc.name}` : tc.name, details: err.details, - message: (_d = (_c = err.message) !== null && _c !== void 0 ? _c : (0, parse_utils_1.getFirstNonEmptyLine)(err.details)) !== null && _d !== void 0 ? _d : 'Test failed', + message: err.message ?? (0, parse_utils_1.getFirstNonEmptyLine)(err.details) ?? 'Test failed', path, line }); @@ -1571,7 +1757,7 @@ const defaultOptions = { function getReport(results, options = defaultOptions) { core.info('Generating check run summary'); applySort(results); - const opts = Object.assign({}, options); + const opts = { ...options }; let lines = renderReport(results, opts); let report = lines.join('\n'); if (getByteLength(report) <= getMaxReportLength(options)) { @@ -1732,7 +1918,6 @@ function getSuitesReport(tr, runIndex, options) { return sections; } function getTestsReport(ts, runIndex, suiteIndex, options) { - var _a, _b, _c; if (options.listTests === 'failed' && ts.result !== 'failed') { return []; } @@ -1756,7 +1941,9 @@ function getTestsReport(ts, runIndex, suiteIndex, options) { const result = getResultIcon(tc.result); sections.push(`${space}${result} ${tc.name}`); if (tc.error) { - const lines = (_c = ((_a = tc.error.message) !== null && _a !== void 0 ? _a : (_b = (0, parse_utils_1.getFirstNonEmptyLine)(tc.error.details)) === null || _b === void 0 ? void 0 : _b.trim())) === null || _c === void 0 ? void 0 : _c.split(/\r?\n/g).map(l => '\t' + l); + const lines = (tc.error.message ?? (0, parse_utils_1.getFirstNonEmptyLine)(tc.error.details)?.trim()) + ?.split(/\r?\n/g) + .map(l => '\t' + l); if (lines) { sections.push(...lines); } @@ -1799,6 +1986,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TestCaseResult = exports.TestGroupResult = exports.TestSuiteResult = exports.TestRunResult = void 0; const node_utils_1 = __nccwpck_require__(5824); class TestRunResult { + path; + suites; + totalTime; constructor(path, suites, totalTime) { this.path = path; this.suites = suites; @@ -1817,8 +2007,7 @@ class TestRunResult { return this.suites.reduce((sum, g) => sum + g.skipped, 0); } get time() { - var _a; - return (_a = this.totalTime) !== null && _a !== void 0 ? _a : this.suites.reduce((sum, g) => sum + g.time, 0); + return this.totalTime ?? this.suites.reduce((sum, g) => sum + g.time, 0); } get result() { return this.suites.some(t => t.result === 'failed') ? 'failed' : 'success'; @@ -1837,6 +2026,9 @@ class TestRunResult { } exports.TestRunResult = TestRunResult; class TestSuiteResult { + name; + groups; + totalTime; constructor(name, groups, totalTime) { this.name = name; this.groups = groups; @@ -1855,8 +2047,7 @@ class TestSuiteResult { return this.groups.reduce((sum, g) => sum + g.skipped, 0); } get time() { - var _a; - return (_a = this.totalTime) !== null && _a !== void 0 ? _a : this.groups.reduce((sum, g) => sum + g.time, 0); + return this.totalTime ?? this.groups.reduce((sum, g) => sum + g.time, 0); } get result() { return this.groups.some(t => t.result === 'failed') ? 'failed' : 'success'; @@ -1865,7 +2056,7 @@ class TestSuiteResult { return this.groups.filter(grp => grp.result === 'failed'); } sort(deep) { - this.groups.sort((a, b) => { var _a, _b; return ((_a = a.name) !== null && _a !== void 0 ? _a : '').localeCompare((_b = b.name) !== null && _b !== void 0 ? _b : '', node_utils_1.DEFAULT_LOCALE); }); + this.groups.sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '', node_utils_1.DEFAULT_LOCALE)); if (deep) { for (const grp of this.groups) { grp.sort(); @@ -1875,6 +2066,8 @@ class TestSuiteResult { } exports.TestSuiteResult = TestSuiteResult; class TestGroupResult { + name; + tests; constructor(name, tests) { this.name = name; this.tests = tests; @@ -1903,6 +2096,10 @@ class TestGroupResult { } exports.TestGroupResult = TestGroupResult; class TestCaseResult { + name; + result; + time; + error; constructor(name, result, time, error) { this.name = name; this.result = result; @@ -1943,32 +2140,21 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.listFiles = void 0; const core = __importStar(__nccwpck_require__(2186)); const exec_1 = __nccwpck_require__(1514); -function listFiles() { - return __awaiter(this, void 0, void 0, function* () { - core.startGroup('Listing all files tracked by git'); - let output = ''; - try { - output = (yield (0, exec_1.getExecOutput)('git', ['ls-files', '-z'])).stdout; - } - finally { - fixStdOutNullTermination(); - core.endGroup(); - } - return output.split('\u0000').filter(s => s.length > 0); - }); +async function listFiles() { + core.startGroup('Listing all files tracked by git'); + let output = ''; + try { + output = (await (0, exec_1.getExecOutput)('git', ['ls-files', '-z'])).stdout; + } + finally { + fixStdOutNullTermination(); + core.endGroup(); + } + return output.split('\u0000').filter(s => s.length > 0); } exports.listFiles = listFiles; function fixStdOutNullTermination() { @@ -2009,15 +2195,6 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -2051,83 +2228,76 @@ function getCheckRunContext() { return { sha: github.context.sha, runId }; } exports.getCheckRunContext = getCheckRunContext; -function downloadArtifact(octokit, artifactId, fileName, token) { - return __awaiter(this, void 0, void 0, function* () { - core.startGroup(`Downloading artifact ${fileName}`); - try { - core.info(`Artifact ID: ${artifactId}`); - const req = octokit.rest.actions.downloadArtifact.endpoint(Object.assign(Object.assign({}, github.context.repo), { artifact_id: artifactId, archive_format: 'zip' })); - const headers = { - Authorization: `Bearer ${token}` - }; - const resp = yield (0, got_1.default)(req.url, { - headers, - followRedirect: false - }); - core.info(`Fetch artifact URL: ${resp.statusCode} ${resp.statusMessage}`); - if (resp.statusCode !== 302) { - throw new Error('Fetch artifact URL failed: received unexpected status code'); - } - const url = resp.headers.location; - if (url === undefined) { - const receivedHeaders = Object.keys(resp.headers); - core.info(`Received headers: ${receivedHeaders.join(', ')}`); - throw new Error('Location header was not found in API response'); - } - if (typeof url !== 'string') { - throw new Error(`Location header has unexpected value: ${url}`); - } - const downloadStream = got_1.default.stream(url, { headers }); - const fileWriterStream = (0, fs_1.createWriteStream)(fileName); - core.info(`Downloading ${url}`); - downloadStream.on('downloadProgress', ({ transferred }) => { - core.info(`Progress: ${transferred} B`); - }); - yield asyncStream(downloadStream, fileWriterStream); - } - finally { - core.endGroup(); - } - }); +async function downloadArtifact(octokit, artifactId, fileName, token) { + core.startGroup(`Downloading artifact ${fileName}`); + try { + core.info(`Artifact ID: ${artifactId}`); + const req = octokit.rest.actions.downloadArtifact.endpoint({ + ...github.context.repo, + artifact_id: artifactId, + archive_format: 'zip' + }); + const headers = { + Authorization: `Bearer ${token}` + }; + const downloadStream = got_1.default.stream(req.url, { headers }); + const fileWriterStream = (0, fs_1.createWriteStream)(fileName); + downloadStream.on('redirect', response => { + core.info(`Downloading ${response.headers.location}`); + }); + downloadStream.on('downloadProgress', ({ transferred }) => { + core.info(`Progress: ${transferred} B`); + }); + await asyncStream(downloadStream, fileWriterStream); + } + finally { + core.endGroup(); + } } exports.downloadArtifact = downloadArtifact; -function listFiles(octokit, sha) { - return __awaiter(this, void 0, void 0, function* () { - core.startGroup('Fetching list of tracked files from GitHub'); - try { - const commit = yield octokit.rest.git.getCommit(Object.assign({ commit_sha: sha }, github.context.repo)); - const files = yield listGitTree(octokit, commit.data.tree.sha, ''); - return files; - } - finally { - core.endGroup(); - } - }); +async function listFiles(octokit, sha) { + core.startGroup('Fetching list of tracked files from GitHub'); + try { + const commit = await octokit.rest.git.getCommit({ + commit_sha: sha, + ...github.context.repo + }); + const files = await listGitTree(octokit, commit.data.tree.sha, ''); + return files; + } + finally { + core.endGroup(); + } } exports.listFiles = listFiles; -function listGitTree(octokit, sha, path) { - return __awaiter(this, void 0, void 0, function* () { - const pathLog = path ? ` at ${path}` : ''; - core.info(`Fetching tree ${sha}${pathLog}`); - let truncated = false; - let tree = yield octokit.rest.git.getTree(Object.assign({ recursive: 'true', tree_sha: sha }, github.context.repo)); - if (tree.data.truncated) { - truncated = true; - tree = yield octokit.rest.git.getTree(Object.assign({ tree_sha: sha }, github.context.repo)); +async function listGitTree(octokit, sha, path) { + const pathLog = path ? ` at ${path}` : ''; + core.info(`Fetching tree ${sha}${pathLog}`); + let truncated = false; + let tree = await octokit.rest.git.getTree({ + recursive: 'true', + tree_sha: sha, + ...github.context.repo + }); + if (tree.data.truncated) { + truncated = true; + tree = await octokit.rest.git.getTree({ + tree_sha: sha, + ...github.context.repo + }); + } + const result = []; + for (const tr of tree.data.tree) { + const file = `${path}${tr.path}`; + if (tr.type === 'blob') { + result.push(file); } - const result = []; - for (const tr of tree.data.tree) { - const file = `${path}${tr.path}`; - if (tr.type === 'blob') { - result.push(file); - } - else if (tr.type === 'tree' && truncated) { - const files = yield listGitTree(octokit, tr.sha, `${file}/`); - result.push(...files); - } + else if (tr.type === 'tree' && truncated) { + const files = await listGitTree(octokit, tr.sha, `${file}/`); + result.push(...files); } - return result; - }); + } + return result; } @@ -2168,8 +2338,7 @@ function tableEscape(content) { } exports.tableEscape = tableEscape; function fixEol(text) { - var _a; - return (_a = text === null || text === void 0 ? void 0 : text.replace(/\r/g, '')) !== null && _a !== void 0 ? _a : ''; + return text?.replace(/\r/g, '') ?? ''; } exports.fixEol = fixEol; function ellipsis(text, maxLength) { @@ -2252,8 +2421,8 @@ function parseIsoDate(str) { } exports.parseIsoDate = parseIsoDate; function getFirstNonEmptyLine(stackTrace) { - const lines = stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.split(/\r?\n/g); - return lines === null || lines === void 0 ? void 0 : lines.find(str => !/^\s*$/.test(str)); + const lines = stackTrace?.split(/\r?\n/g); + return lines?.find(str => !/^\s*$/.test(str)); } exports.getFirstNonEmptyLine = getFirstNonEmptyLine; diff --git a/package-lock.json b/package-lock.json index b728053..6f0c3e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,50 +1,48 @@ { - "name": "test-check", - "version": "1.8.0", + "name": "test-reporter", + "version": "2.0.0-preview", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "test-check", - "version": "1.8.0", + "name": "test-reporter", + "version": "2.0.0-preview", "license": "MIT", "dependencies": { "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1", "@actions/github": "^6.0.0", - "adm-zip": "^0.5.10", + "adm-zip": "^0.5.14", "fast-glob": "^3.3.2", - "got": "^11.8.2", - "picomatch": "^3.0.1", + "got": "^11.8.6", + "picomatch": "^4.0.2", "xml2js": "^0.6.2" }, "devDependencies": { - "@octokit/types": "^12.4.0", - "@octokit/webhooks": "^12.0.11", - "@octokit/webhooks-types": "^7.3.1", + "@octokit/webhooks-types": "^7.5.1", "@types/adm-zip": "^0.5.5", "@types/github-slugger": "^1.3.0", - "@types/jest": "^29.5.11", - "@types/node": "^20.11.9", + "@types/jest": "^29.5.12", + "@types/node": "^20.14.8", "@types/picomatch": "^2.3.3", "@types/xml2js": "^0.4.14", - "@typescript-eslint/eslint-plugin": "^6.19.1", - "@typescript-eslint/parser": "^6.19.1", + "@typescript-eslint/eslint-plugin": "^7.14.1", + "@typescript-eslint/parser": "^7.14.1", "@vercel/ncc": "^0.38.1", "eol-converter-cli": "^1.0.8", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-github": "^4.10.1", + "eslint-plugin-github": "^4.10.2", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jest": "^27.6.3", + "eslint-plugin-jest": "^28.6.0", "eslint-plugin-prettier": "^5.1.3", "jest": "^29.7.0", "jest-circus": "^29.7.0", "jest-junit": "^16.0.0", "js-yaml": "^4.1.0", - "prettier": "^3.2.4", - "ts-jest": "^29.1.2", - "typescript": "^5.3.3" + "prettier": "^3.3.2", + "ts-jest": "^29.1.5", + "typescript": "^5.5.2" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -788,9 +786,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", - "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -820,9 +818,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -843,13 +841,13 @@ "dev": true }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -870,9 +868,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -1459,40 +1457,10 @@ "@octokit/openapi-types": "^19.1.0" } }, - "node_modules/@octokit/webhooks": { - "version": "12.0.11", - "resolved": "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-12.0.11.tgz", - "integrity": "sha512-YEQOb7v0TZ662nh5jsbY1CMgJyMajCEagKrHWC30LTCwCtnuIrLtEpE20vq4AtH0SuZI90+PtV66/Bnnw0jkvg==", - "dev": true, - "dependencies": { - "@octokit/request-error": "^5.0.0", - "@octokit/webhooks-methods": "^4.0.0", - "@octokit/webhooks-types": "7.1.0", - "aggregate-error": "^3.1.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@octokit/webhooks-methods": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@octokit/webhooks-methods/-/webhooks-methods-4.0.0.tgz", - "integrity": "sha512-M8mwmTXp+VeolOS/kfRvsDdW+IO0qJ8kYodM/sAysk093q6ApgmBXwK1ZlUvAwXVrp/YVHp6aArj4auAxUAOFw==", - "dev": true, - "engines": { - "node": ">= 18" - } - }, "node_modules/@octokit/webhooks-types": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-7.3.1.tgz", - "integrity": "sha512-u6355ZsZnHwmxen30SrqnYb1pXieBFkYgkNzt+Ed4Ao5tupN1OErHfzwiV6hq6duGkDAYASbq7/uVJQ69PjLEg==", - "dev": true - }, - "node_modules/@octokit/webhooks/node_modules/@octokit/webhooks-types": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-7.1.0.tgz", - "integrity": "sha512-y92CpG4kFFtBBjni8LHoV12IegJ+KFxLgKRengrVjKmGE5XMeCuGvlfRe75lTRrgXaG6XIWJlFpIDTlkoJsU8w==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-7.5.1.tgz", + "integrity": "sha512-1dozxWEP8lKGbtEu7HkRbK1F/nIPuJXNfT0gd96y6d3LcHZTtRtlf8xz3nicSJfesADxJyDh+mWBOsdLkqgzYw==", "dev": true }, "node_modules/@pkgr/core": { @@ -1659,21 +1627,15 @@ } }, "node_modules/@types/jest": { - "version": "29.5.11", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", - "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" } }, - "node_modules/@types/json-schema": { - "version": "7.0.13", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", - "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==", - "dev": true - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -1689,9 +1651,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.9.tgz", - "integrity": "sha512-CQXNuMoS/VcoAMISe5pm4JnEd1Br5jildbQEToEMQvutmv+EaQr90ry9raiudgpyDuqFiV9e4rnjSfLNq12M5w==", + "version": "20.14.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz", + "integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==", "dependencies": { "undici-types": "~5.26.4" } @@ -1710,12 +1672,6 @@ "@types/node": "*" } }, - "node_modules/@types/semver": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.2.tgz", - "integrity": "sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==", - "dev": true - }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -1747,33 +1703,31 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.1.tgz", - "integrity": "sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.14.1.tgz", + "integrity": "sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.19.1", - "@typescript-eslint/type-utils": "6.19.1", - "@typescript-eslint/utils": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/type-utils": "7.14.1", + "@typescript-eslint/utils": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1781,151 +1735,27 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.1.tgz", - "integrity": "sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.1.tgz", - "integrity": "sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.1.tgz", - "integrity": "sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.1.tgz", - "integrity": "sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.19.1", - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/typescript-estree": "6.19.1", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.1.tgz", - "integrity": "sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@typescript-eslint/parser": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.1.tgz", - "integrity": "sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.19.1", - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/typescript-estree": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1", + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/typescript-estree": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1933,116 +1763,17 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.1.tgz", - "integrity": "sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.1.tgz", - "integrity": "sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.1.tgz", - "integrity": "sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.1.tgz", - "integrity": "sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.14.1.tgz", + "integrity": "sha512-gPrFSsoYcsffYXTOZ+hT7fyJr95rdVe4kGVX1ps/dJ+DfmlnjFN/GcMxXcVkeHDKqsq6uAcVaQaIi3cFffmAbA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -2050,25 +1781,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.1.tgz", - "integrity": "sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.14.1.tgz", + "integrity": "sha512-/MzmgNd3nnbDbOi3LfasXWWe292+iuo+umJ0bCCMCPc1jLO/z2BQmWUUUXvXLbrQey/JgzdF/OV+I5bzEGwJkQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.19.1", - "@typescript-eslint/utils": "6.19.1", + "@typescript-eslint/typescript-estree": "7.14.1", + "@typescript-eslint/utils": "7.14.1", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -2076,53 +1807,36 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.1.tgz", - "integrity": "sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.1.tgz", - "integrity": "sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==", + "node_modules/@typescript-eslint/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.14.1.tgz", + "integrity": "sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==", "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.1.tgz", - "integrity": "sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.14.1.tgz", + "integrity": "sha512-k5d0VuxViE2ulIO6FbxxSZaxqDVUyMbXcidC8rHvii0I56XZPv8cq+EhMns+d/EVIL41sMXqRbK3D10Oza1bbA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/visitor-keys": "6.19.1", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -2134,49 +1848,7 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.1.tgz", - "integrity": "sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.19.1", - "@typescript-eslint/types": "6.19.1", - "@typescript-eslint/typescript-estree": "6.19.1", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.1.tgz", - "integrity": "sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.19.1", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/brace-expansion": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", @@ -2185,10 +1857,10 @@ "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -2200,83 +1872,39 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.14.1.tgz", + "integrity": "sha512-CMmVVELns3nak3cpJhZosDkm63n+DwBlDX8g0k4QUa9BMnF+lH2lr3d130M1Zt1xxmB3LLk3NV7KQCq86ZBBhQ==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/typescript-estree": "7.14.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.14.1.tgz", + "integrity": "sha512-Crb+F75U1JAEtBeQGxSKwI60hZmmzaqA3z9sYsVm8X7W5cwLEm5bRe0/uXS6+MR/y8CVpKSR/ontIAIEPFcEkA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "7.14.1", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -2320,24 +1948,11 @@ } }, "node_modules/adm-zip": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz", - "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==", - "engines": { - "node": ">=6.0" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, + "version": "0.5.14", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.14.tgz", + "integrity": "sha512-DnyqqifT4Jrcvb8USYjp6FHtBpEIz1mnXu6pTRHZ0RL69LbQYiO+0lDFg5+OKA7U29oWSs3a/i8fhn8ZcceIWg==", "engines": { - "node": ">=8" + "node": ">=12.0" } }, "node_modules/ajv": { @@ -2943,15 +2558,6 @@ "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -3418,16 +3024,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -3611,14 +3217,14 @@ } }, "node_modules/eslint-plugin-github": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.10.1.tgz", - "integrity": "sha512-1AqQBockOM+m0ZUpwfjWtX0lWdX5cRi/hwJnSNvXoOmz/Hh+ULH6QFz6ENWueTWjoWpgPv0af3bj+snps6o4og==", + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.10.2.tgz", + "integrity": "sha512-F1F5aAFgi1Y5hYoTFzGQACBkw5W1hu2Fu5FSTrMlXqrojJnKl1S2pWO/rprlowRQpt+hzHhqSpsfnodJEVd5QA==", "dev": true, "dependencies": { "@github/browserslist-config": "^1.0.0", - "@typescript-eslint/eslint-plugin": "^6.0.0", - "@typescript-eslint/parser": "^6.0.0", + "@typescript-eslint/eslint-plugin": "^7.0.1", + "@typescript-eslint/parser": "^7.0.1", "aria-query": "^5.3.0", "eslint-config-prettier": ">=8.0.0", "eslint-plugin-escompat": "^3.3.3", @@ -3712,19 +3318,19 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.6.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.3.tgz", - "integrity": "sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==", + "version": "28.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.6.0.tgz", + "integrity": "sha512-YG28E1/MIKwnz+e2H7VwYPzHUYU4aMa19w0yGcwXnnmJH6EfgHahTJ2un3IyraUxNfnz/KUhJAFXNNwWPo12tg==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "^5.10.0" + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0", - "eslint": "^7.0.0 || ^8.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", "jest": "*" }, "peerDependenciesMeta": { @@ -3823,19 +3429,6 @@ "node": ">=4.0.0" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -3945,15 +3538,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -4540,9 +4124,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -4592,15 +4176,6 @@ "node": ">=0.8.19" } }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -6199,11 +5774,11 @@ "dev": true }, "node_modules/picomatch": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-3.0.1.tgz", - "integrity": "sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -6292,9 +5867,9 @@ } }, "node_modules/prettier": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", - "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -6624,13 +6199,10 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", + "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -6638,24 +6210,6 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/set-function-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", @@ -7004,21 +6558,21 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", - "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" } }, "node_modules/ts-jest": { - "version": "29.1.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", - "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", + "version": "29.1.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.5.tgz", + "integrity": "sha512-UuClSYxM7byvvYfyWdFI+/2UxMmwNyJb0NPkZPQE2hew3RurV7l7zURgOHAd/1I1ZdPpe3GUsXNXAcN8TFKSIg==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -7034,10 +6588,11 @@ "ts-jest": "cli.js" }, "engines": { - "node": "^16.10.0 || ^18.0.0 || >=20.0.0" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", @@ -7047,6 +6602,9 @@ "@babel/core": { "optional": true }, + "@jest/transform": { + "optional": true + }, "@jest/types": { "optional": true }, @@ -7091,27 +6649,6 @@ "node": ">=4" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -7219,9 +6756,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 9742e5d..dbe60ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "test-check", - "version": "1.8.0", + "name": "test-reporter", + "version": "2.0.0-preview", "private": true, "description": "Presents test results from popular testing frameworks as Github check run", "main": "lib/main.js", @@ -16,12 +16,13 @@ "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\"", "dotnet-fixture": "dotnet test reports/dotnet/DotnetTests.XUnitTests --logger \"trx;LogFileName=../../../../__tests__/fixtures/dotnet-trx.trx\"", + "dotnet-nunit-fixture": "nunit.exe reports/dotnet/DotnetTests.NUnitV3Tests/bin/Debug/netcoreapp3.1/DotnetTests.NUnitV3Tests.dll --result=__tests__/fixtures/dotnet-nunit.xml", "jest-fixture": "cd \"reports/jest\" && npm test", "mocha-fixture": "cd \"reports/mocha\" && npm test" }, "repository": { "type": "git", - "url": "git+https://github.com/dorny/test-check.git" + "url": "git+https://github.com/dorny/test-reporter.git" }, "keywords": [ "actions", @@ -35,39 +36,37 @@ "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1", "@actions/github": "^6.0.0", - "adm-zip": "^0.5.10", + "adm-zip": "^0.5.14", "fast-glob": "^3.3.2", - "got": "^11.8.2", - "picomatch": "^3.0.1", + "got": "^11.8.6", + "picomatch": "^4.0.2", "xml2js": "^0.6.2" }, "devDependencies": { - "@octokit/types": "^12.4.0", - "@octokit/webhooks": "^12.0.11", - "@octokit/webhooks-types": "^7.3.1", + "@octokit/webhooks-types": "^7.5.1", "@types/adm-zip": "^0.5.5", "@types/github-slugger": "^1.3.0", - "@types/jest": "^29.5.11", - "@types/node": "^20.11.9", + "@types/jest": "^29.5.12", + "@types/node": "^20.14.8", "@types/picomatch": "^2.3.3", "@types/xml2js": "^0.4.14", - "@typescript-eslint/eslint-plugin": "^6.19.1", - "@typescript-eslint/parser": "^6.19.1", + "@typescript-eslint/eslint-plugin": "^7.14.1", + "@typescript-eslint/parser": "^7.14.1", "@vercel/ncc": "^0.38.1", "eol-converter-cli": "^1.0.8", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-github": "^4.10.1", + "eslint-plugin-github": "^4.10.2", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jest": "^27.6.3", + "eslint-plugin-jest": "^28.6.0", "eslint-plugin-prettier": "^5.1.3", "jest": "^29.7.0", "jest-circus": "^29.7.0", "jest-junit": "^16.0.0", "js-yaml": "^4.1.0", - "prettier": "^3.2.4", - "ts-jest": "^29.1.2", - "typescript": "^5.3.3" + "prettier": "^3.3.2", + "ts-jest": "^29.1.5", + "typescript": "^5.5.2" }, "jest-junit": { "suiteName": "jest tests", @@ -78,5 +77,8 @@ "suiteNameTemplate": "{filepath}", "classNameTemplate": "{classname}", "titleTemplate": "{title}" + }, + "engines": { + "node": ">=20" } } diff --git a/reports/dart/pubspec.lock b/reports/dart/pubspec.lock index 882993d..f21dc87 100644 --- a/reports/dart/pubspec.lock +++ b/reports/dart/pubspec.lock @@ -5,344 +5,377 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + url: "https://pub.dev" source: hosted - version: "11.0.0" + version: "67.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + url: "https://pub.dev" source: hosted - version: "0.40.4" + version: "6.4.1" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" source: hosted - version: "1.6.0" + version: "2.5.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.0.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" + version: "2.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.14.13" + version: "1.18.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.1.1" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76" + url: "https://pub.dev" source: hosted - version: "0.14.1" + version: "1.7.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "2.1.5" - glob: + version: "3.0.3" + file: dependency: transitive description: - name: glob - url: "https://pub.dartlang.org" + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "1.2.0" - http: + version: "7.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: dependency: transitive description: - name: http - url: "https://pub.dartlang.org" + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "0.12.2" + version: "2.1.2" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "4.0.2" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" source: hosted - version: "0.3.4" + version: "1.0.4" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.dev" source: hosted - version: "0.6.2" + version: "0.7.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "0.11.4" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" source: hosted - version: "0.12.9" + version: "0.12.16+1" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "25dfcaf170a0190f47ca6355bdd4552cb8924b430512ff0cafb8db9bd41fe33b" + url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.14.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" + url: "https://pub.dev" source: hosted - version: "0.9.7" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" + version: "1.0.5" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" source: hosted - version: "1.4.12" + version: "2.0.2" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "1.9.3" + version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.0" pedantic: dependency: "direct dev" description: name: pedantic - url: "https://pub.dartlang.org" + sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + url: "https://pub.dev" source: hosted - version: "1.9.2" + version: "1.11.1" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.5.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "1.4.4" + version: "2.1.4" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted - version: "0.7.9" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" source: hosted - version: "0.2.8" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" source: hosted - version: "0.2.3" + version: "1.0.4" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.1" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" source: hosted - version: "0.10.9" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.9.5" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" test: dependency: "direct dev" description: name: test - url: "https://pub.dartlang.org" + sha256: d87214d19fb311997d8128ec501a980f77cb240ac4e7e219accf452813ff473c + url: "https://pub.dev" source: hosted - version: "1.15.4" + version: "1.25.3" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "2419f20b0c8677b2d67c8ac4d1ac7372d862dc6c460cdbb052b40155408cd794" + url: "https://pub.dev" source: hosted - version: "0.2.18" + version: "0.7.1" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: "2236f70be1e5ab405c675e88c36935a87dad9e05a506b57dd5c0f617f5aebcb2" + url: "https://pub.dev" source: hosted - version: "0.3.11+1" + version: "0.6.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.2" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: a75f83f14ad81d5fe4b3319710b90dec37da0e22612326b696c9e1b8f34bbf48 + url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "14.2.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" source: hosted - version: "0.9.7+15" + version: "0.5.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "2.4.5" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "1.2.1" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "3.1.2" sdks: - dart: ">=2.8.1 <3.0.0" + dart: ">=3.3.0 <4.0.0" diff --git a/reports/dart/pubspec.yaml b/reports/dart/pubspec.yaml index 860687f..ade3578 100644 --- a/reports/dart/pubspec.yaml +++ b/reports/dart/pubspec.yaml @@ -2,7 +2,7 @@ name: darttest description: A simple command-line application. environment: - sdk: '>=2.8.1 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dev_dependencies: pedantic: ^1.9.0 diff --git a/reports/dotnet/DotnetTests.NUnitV3Tests/CalculatorTests.cs b/reports/dotnet/DotnetTests.NUnitV3Tests/CalculatorTests.cs new file mode 100644 index 0000000..9452ae9 --- /dev/null +++ b/reports/dotnet/DotnetTests.NUnitV3Tests/CalculatorTests.cs @@ -0,0 +1,64 @@ +using System; +using System.Threading; +using DotnetTests.Unit; +using NUnit.Framework; + +namespace DotnetTests.XUnitTests +{ + public class CalculatorTests + { + private readonly Calculator _calculator = new Calculator(); + + [Test] + public void Passing_Test() + { + Assert.That(_calculator.Sum(1, 1), Is.EqualTo(2)); + } + + [Test(Description = "Some description")] + public void Passing_Test_With_Description() + { + Assert.That(2, Is.EqualTo(2)); + } + + [Test] + public void Failing_Test() + { + Assert.That(_calculator.Sum(1, 1), Is.EqualTo(3)); + } + + [Test] + public void Exception_In_TargetTest() + { + _calculator.Div(1, 0); + } + + [Test] + public void Exception_In_Test() + { + throw new Exception("Test"); + } + + [Test] + [Timeout(1)] + public void Timeout_Test() + { + Thread.Sleep(100); + } + + [Test] + [Ignore("Skipped")] + public void Skipped_Test() + { + throw new Exception("Test"); + } + + [Theory] + [TestCase(2)] + [TestCase(3)] + public void Is_Even_Number(int i) + { + Assert.True(i % 2 == 0); + } + } +} diff --git a/reports/dotnet/DotnetTests.NUnitV3Tests/DotnetTests.NUnitV3Tests.csproj b/reports/dotnet/DotnetTests.NUnitV3Tests/DotnetTests.NUnitV3Tests.csproj new file mode 100644 index 0000000..932ff5b --- /dev/null +++ b/reports/dotnet/DotnetTests.NUnitV3Tests/DotnetTests.NUnitV3Tests.csproj @@ -0,0 +1,18 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + + + diff --git a/reports/dotnet/DotnetTests.sln b/reports/dotnet/DotnetTests.sln index 1c0bbeb..7c5ff87 100644 --- a/reports/dotnet/DotnetTests.sln +++ b/reports/dotnet/DotnetTests.sln @@ -9,6 +9,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BCAC3B31 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetTests.XUnitTests", "DotnetTests.XUnitTests\DotnetTests.XUnitTests.csproj", "{F8607EDB-D25D-47AA-8132-38ACA242E845}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotnetTests.NUnitV3Tests", "DotnetTests.NUnitV3Tests\DotnetTests.NUnitV3Tests.csproj", "{81023ED7-56CB-47E9-86C5-9125A0873C55}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -23,12 +25,17 @@ Global {F8607EDB-D25D-47AA-8132-38ACA242E845}.Debug|Any CPU.Build.0 = Debug|Any CPU {F8607EDB-D25D-47AA-8132-38ACA242E845}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8607EDB-D25D-47AA-8132-38ACA242E845}.Release|Any CPU.Build.0 = Release|Any CPU + {81023ED7-56CB-47E9-86C5-9125A0873C55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81023ED7-56CB-47E9-86C5-9125A0873C55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81023ED7-56CB-47E9-86C5-9125A0873C55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81023ED7-56CB-47E9-86C5-9125A0873C55}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {F8607EDB-D25D-47AA-8132-38ACA242E845} = {BCAC3B31-ADB1-4221-9D5B-182EE868648C} + {81023ED7-56CB-47E9-86C5-9125A0873C55} = {BCAC3B31-ADB1-4221-9D5B-182EE868648C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6ED5543C-74AA-4B21-8050-943550F3F66E} diff --git a/src/main.ts b/src/main.ts index 0c2abe4..97dcd60 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,10 +12,12 @@ import {getAnnotations} from './report/get-annotations' import {getReport} from './report/get-report' import {DartJsonParser} from './parsers/dart-json/dart-json-parser' +import {DotnetNunitParser} from './parsers/dotnet-nunit/dotnet-nunit-parser' import {DotnetTrxParser} from './parsers/dotnet-trx/dotnet-trx-parser' import {JavaJunitParser} from './parsers/java-junit/java-junit-parser' import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser' import {MochaJsonParser} from './parsers/mocha-json/mocha-json-parser' +import {RspecJsonParser} from './parsers/rspec-json/rspec-json-parser' import {SwiftXunitParser} from './parsers/swift-xunit/swift-xunit-parser' import {normalizeDirPath, normalizeFilePath} from './utils/path-utils' @@ -226,6 +228,8 @@ class TestReporter { switch (reporter) { case 'dart-json': return new DartJsonParser(options, 'dart') + case 'dotnet-nunit': + return new DotnetNunitParser(options) case 'dotnet-trx': return new DotnetTrxParser(options) case 'flutter-json': @@ -236,6 +240,8 @@ class TestReporter { return new JestJunitParser(options) case 'mocha-json': return new MochaJsonParser(options) + case 'rspec-json': + return new RspecJsonParser(options) case 'swift-xunit': return new SwiftXunitParser(options) default: diff --git a/src/parsers/dart-json/dart-json-parser.ts b/src/parsers/dart-json/dart-json-parser.ts index 25a716b..f0afd45 100644 --- a/src/parsers/dart-json/dart-json-parser.ts +++ b/src/parsers/dart-json/dart-json-parser.ts @@ -123,7 +123,7 @@ export class DartJsonParser implements TestParser { const group = suite.groups[evt.test.groupIDs[evt.test.groupIDs.length - 1]] group.tests.push(test) tests[evt.test.id] = test - } else if (isTestDoneEvent(evt) && !evt.hidden && tests[evt.testID]) { + } else if (isTestDoneEvent(evt) && tests[evt.testID]) { tests[evt.testID].testDone = evt } else if (isErrorEvent(evt) && tests[evt.testID]) { tests[evt.testID].error = evt @@ -152,14 +152,16 @@ export class DartJsonParser implements TestParser { return groups.map(group => { group.tests.sort((a, b) => (a.testStart.test.line ?? 0) - (b.testStart.test.line ?? 0)) - const tests = group.tests.map(tc => { - const error = this.getError(suite, tc) - const testName = - group.group.name !== undefined && tc.testStart.test.name.startsWith(group.group.name) - ? tc.testStart.test.name.slice(group.group.name.length).trim() - : tc.testStart.test.name.trim() - return new TestCaseResult(testName, tc.result, tc.time, error) - }) + const tests = group.tests + .filter(tc => !tc.testDone?.hidden) + .map(tc => { + const error = this.getError(suite, tc) + const testName = + group.group.name !== undefined && tc.testStart.test.name.startsWith(group.group.name) + ? tc.testStart.test.name.slice(group.group.name.length).trim() + : tc.testStart.test.name.trim() + return new TestCaseResult(testName, tc.result, tc.time, error) + }) return new TestGroupResult(group.group.name, tests) }) } diff --git a/src/parsers/dotnet-nunit/dotnet-nunit-parser.ts b/src/parsers/dotnet-nunit/dotnet-nunit-parser.ts new file mode 100644 index 0000000..4bc27f1 --- /dev/null +++ b/src/parsers/dotnet-nunit/dotnet-nunit-parser.ts @@ -0,0 +1,151 @@ +import {ParseOptions, TestParser} from '../../test-parser' +import {parseStringPromise} from 'xml2js' + +import {NunitReport, TestCase, TestSuite} from './dotnet-nunit-types' +import {getExceptionSource} from '../../utils/node-utils' +import {getBasePath, normalizeFilePath} from '../../utils/path-utils' + +import { + TestExecutionResult, + TestRunResult, + TestSuiteResult, + TestGroupResult, + TestCaseResult, + TestCaseError +} from '../../test-results' + +export class DotnetNunitParser implements TestParser { + assumedWorkDir: string | undefined + + constructor(readonly options: ParseOptions) {} + + async parse(path: string, content: string): Promise { + const ju = await this.getNunitReport(path, content) + return this.getTestRunResult(path, ju) + } + + private async getNunitReport(path: string, content: string): Promise { + try { + return (await parseStringPromise(content)) as NunitReport + } catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`) + } + } + + private getTestRunResult(path: string, nunit: NunitReport): TestRunResult { + const suites: TestSuiteResult[] = [] + const time = parseFloat(nunit['test-run'].$.duration) * 1000 + + this.populateTestCasesRecursive(suites, [], nunit['test-run']['test-suite']) + + return new TestRunResult(path, suites, time) + } + + private populateTestCasesRecursive( + result: TestSuiteResult[], + suitePath: TestSuite[], + testSuites: TestSuite[] | undefined + ): void { + if (testSuites === undefined) { + return + } + + for (const suite of testSuites) { + suitePath.push(suite) + + this.populateTestCasesRecursive(result, suitePath, suite['test-suite']) + + const testcases = suite['test-case'] + if (testcases !== undefined) { + for (const testcase of testcases) { + this.addTestCase(result, suitePath, testcase) + } + } + + suitePath.pop() + } + } + + private addTestCase(result: TestSuiteResult[], suitePath: TestSuite[], testCase: TestCase): void { + // The last suite in the suite path is the "group". + // The rest are concatenated together to form the "suite". + // But ignore "Theory" suites. + const suitesWithoutTheories = suitePath.filter(suite => suite.$.type !== 'Theory') + const suiteName = suitesWithoutTheories + .slice(0, suitesWithoutTheories.length - 1) + .map(suite => suite.$.name) + .join('.') + const groupName = suitesWithoutTheories[suitesWithoutTheories.length - 1].$.name + + let existingSuite = result.find(existingSuite => existingSuite.name === suiteName) + if (existingSuite === undefined) { + existingSuite = new TestSuiteResult(suiteName, []) + result.push(existingSuite) + } + + let existingGroup = existingSuite.groups.find(existingGroup => existingGroup.name === groupName) + if (existingGroup === undefined) { + existingGroup = new TestGroupResult(groupName, []) + existingSuite.groups.push(existingGroup) + } + + existingGroup.tests.push( + new TestCaseResult( + testCase.$.name, + this.getTestExecutionResult(testCase), + parseFloat(testCase.$.duration) * 1000, + this.getTestCaseError(testCase) + ) + ) + } + + private getTestExecutionResult(test: TestCase): TestExecutionResult { + if (test.$.result === 'Failed' || test.failure) return 'failed' + if (test.$.result === 'Skipped') return 'skipped' + return 'success' + } + + private getTestCaseError(tc: TestCase): TestCaseError | undefined { + if (!this.options.parseErrors || !tc.failure || tc.failure.length === 0) { + return undefined + } + + const details = tc.failure[0] + let path + let line + + if (details['stack-trace'] !== undefined && details['stack-trace'].length > 0) { + const src = getExceptionSource(details['stack-trace'][0], this.options.trackedFiles, file => + this.getRelativePath(file) + ) + if (src) { + path = src.path + line = src.line + } + } + + return { + path, + line, + message: details.message && details.message.length > 0 ? details.message[0] : '', + details: details['stack-trace'] && details['stack-trace'].length > 0 ? details['stack-trace'][0] : '' + } + } + + private getRelativePath(path: string): string { + path = normalizeFilePath(path) + const workDir = this.getWorkDir(path) + if (workDir !== undefined && path.startsWith(workDir)) { + path = path.substr(workDir.length) + } + return path + } + + private getWorkDir(path: string): string | undefined { + return ( + this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = getBasePath(path, this.options.trackedFiles)) + ) + } +} diff --git a/src/parsers/dotnet-nunit/dotnet-nunit-types.ts b/src/parsers/dotnet-nunit/dotnet-nunit-types.ts new file mode 100644 index 0000000..ec1696c --- /dev/null +++ b/src/parsers/dotnet-nunit/dotnet-nunit-types.ts @@ -0,0 +1,57 @@ +export interface NunitReport { + 'test-run': TestRun +} + +export interface TestRun { + $: { + id: string + runstate: string + testcasecount: string + result: string + total: string + passed: string + failed: string + inconclusive: string + skipped: string + asserts: string + 'engine-version': string + 'clr-version': string + 'start-time': string + 'end-time': string + duration: string + } + 'test-suite'?: TestSuite[] +} + +export interface TestSuite { + $: { + name: string + type: string + } + 'test-case'?: TestCase[] + 'test-suite'?: TestSuite[] +} + +export interface TestCase { + $: { + id: string + name: string + fullname: string + methodname: string + classname: string + runstate: string + seed: string + result: string + label: string + 'start-time': string + 'end-time': string + duration: string + asserts: string + } + failure?: TestFailure[] +} + +export interface TestFailure { + message?: string[] + 'stack-trace'?: string[] +} diff --git a/src/parsers/java-junit/java-junit-parser.ts b/src/parsers/java-junit/java-junit-parser.ts index 9925365..5163f46 100644 --- a/src/parsers/java-junit/java-junit-parser.ts +++ b/src/parsers/java-junit/java-junit-parser.ts @@ -137,11 +137,18 @@ export class JavaJunitParser implements TestParser { } } + let message + if (typeof failure === 'object') { + message = failure.$.message + if (failure.$?.type) { + message = failure.$.type + ': ' + message + } + } return { path: filePath, line, details, - message: typeof failure === 'object' ? failure.message : undefined + message } } diff --git a/src/parsers/java-junit/java-junit-types.ts b/src/parsers/java-junit/java-junit-types.ts index 7fab71e..7ca6246 100644 --- a/src/parsers/java-junit/java-junit-types.ts +++ b/src/parsers/java-junit/java-junit-types.ts @@ -40,6 +40,8 @@ export interface TestCase { export interface Failure { _: string - type: string - message: string + $: { + type?: string + message: string + } } diff --git a/src/parsers/rspec-json/rspec-json-parser.ts b/src/parsers/rspec-json/rspec-json-parser.ts new file mode 100644 index 0000000..bf72393 --- /dev/null +++ b/src/parsers/rspec-json/rspec-json-parser.ts @@ -0,0 +1,112 @@ +import {ParseOptions, TestParser} from '../../test-parser' +import { + TestCaseError, + TestCaseResult, + TestExecutionResult, + TestGroupResult, + TestRunResult, + TestSuiteResult +} from '../../test-results' +import {RspecJson, RspecExample} from './rspec-json-types' + +export class RspecJsonParser implements TestParser { + assumedWorkDir: string | undefined + + constructor(readonly options: ParseOptions) {} + + async parse(path: string, content: string): Promise { + const mocha = this.getRspecJson(path, content) + const result = this.getTestRunResult(path, mocha) + result.sort(true) + return Promise.resolve(result) + } + + private getRspecJson(path: string, content: string): RspecJson { + try { + return JSON.parse(content) + } catch (e) { + throw new Error(`Invalid JSON at ${path}\n\n${e}`) + } + } + + private getTestRunResult(resultsPath: string, rspec: RspecJson): TestRunResult { + const suitesMap: {[path: string]: TestSuiteResult} = {} + + const getSuite = (test: RspecExample): TestSuiteResult => { + const path = test.file_path + return suitesMap[path] ?? (suitesMap[path] = new TestSuiteResult(path, [])) + } + + for (const test of rspec.examples) { + const suite = getSuite(test) + if (test.status === 'failed') { + this.processTest(suite, test, 'failed') + } else if (test.status === 'passed') { + this.processTest(suite, test, 'success') + } else if (test.status === 'pending') { + this.processTest(suite, test, 'skipped') + } + } + + const suites = Object.values(suitesMap) + return new TestRunResult(resultsPath, suites, rspec.summary.duration) + } + + private processTest(suite: TestSuiteResult, test: RspecExample, result: TestExecutionResult): void { + const groupName = + test.full_description !== test.description + ? test.full_description.substr(0, test.full_description.length - test.description.length).trimEnd() + : null + + let group = suite.groups.find(grp => grp.name === groupName) + if (group === undefined) { + group = new TestGroupResult(groupName, []) + suite.groups.push(group) + } + + const error = this.getTestCaseError(test) + const testCase = new TestCaseResult(test.full_description, result, test.run_time ?? 0, error) + group.tests.push(testCase) + } + + private getTestCaseError(test: RspecExample): TestCaseError | undefined { + const backtrace = test.exception?.backtrace + const message = test.exception?.message + if (backtrace === undefined) { + return undefined + } + + let path + let line + const details = backtrace.join('\n') + + const src = this.getExceptionSource(backtrace) + if (src) { + path = src.path + line = src.line + } + + return { + path, + line, + message, + details + } + } + + private getExceptionSource(backtrace: string[]): {path: string; line: number} | undefined { + const re = /^(.*?):(\d+):/ + + for (const str of backtrace) { + const match = str.match(re) + if (match !== null) { + const [_, path, lineStr] = match + if (path.startsWith('./')) { + const line = parseInt(lineStr) + return {path, line} + } + } + } + return undefined + } +} diff --git a/src/parsers/rspec-json/rspec-json-types.ts b/src/parsers/rspec-json/rspec-json-types.ts new file mode 100644 index 0000000..dca00b7 --- /dev/null +++ b/src/parsers/rspec-json/rspec-json-types.ts @@ -0,0 +1,34 @@ +export interface RspecJson { + version: number + examples: RspecExample[] + summary: RspecSummary + summary_line: string +} + +export interface RspecExample { + id: string + description: string + full_description: string + status: TestStatus + file_path: string + line_number: number + run_time: number + pending_message: string | null + exception?: RspecException +} + +type TestStatus = 'passed' | 'failed' | 'pending' + +export interface RspecException { + class: string + message: string + backtrace: string[] +} + +export interface RspecSummary { + duration: number + example_count: number + failure_count: number + pending_count: number + errors_outside_of_examples_count: number +} diff --git a/src/utils/github-utils.ts b/src/utils/github-utils.ts index 1d4add7..19fe921 100644 --- a/src/utils/github-utils.ts +++ b/src/utils/github-utils.ts @@ -50,33 +50,17 @@ export async function downloadArtifact( const headers = { Authorization: `Bearer ${token}` } - const resp = await got(req.url, { - headers, - followRedirect: false - }) - - core.info(`Fetch artifact URL: ${resp.statusCode} ${resp.statusMessage}`) - if (resp.statusCode !== 302) { - throw new Error('Fetch artifact URL failed: received unexpected status code') - } - - const url = resp.headers.location - if (url === undefined) { - const receivedHeaders = Object.keys(resp.headers) - core.info(`Received headers: ${receivedHeaders.join(', ')}`) - throw new Error('Location header was not found in API response') - } - if (typeof url !== 'string') { - throw new Error(`Location header has unexpected value: ${url}`) - } - const downloadStream = got.stream(url, {headers}) + const downloadStream = got.stream(req.url, {headers}) const fileWriterStream = createWriteStream(fileName) - core.info(`Downloading ${url}`) + downloadStream.on('redirect', response => { + core.info(`Downloading ${response.headers.location}`) + }) downloadStream.on('downloadProgress', ({transferred}) => { core.info(`Progress: ${transferred} B`) }) + await asyncStream(downloadStream, fileWriterStream) } finally { core.endGroup() diff --git a/tsconfig.json b/tsconfig.json index f6e7cb5..1408a09 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,16 @@ { "compilerOptions": { - "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "outDir": "./lib", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "lib": ["es2023"], + "module": "node16", + "target": "es2022", + + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "moduleResolution": "node16", + + "outDir": "./lib", + "rootDir": "./src", }, "exclude": ["node_modules", "**/*.test.ts"] }