generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'upstream-main' into ritchxu/support-actions-summary
- Loading branch information
Showing
37 changed files
with
2,135 additions
and
1,342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18.19.0 | ||
v20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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| | ||
## ❌ <a id="user-content-r0" href="#r0">fixtures/dotnet-nunit.xml</a> | ||
**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| | ||
### ❌ <a id="user-content-r0s0" href="#r0s0">DotnetTests.NUnitV3Tests.dll.DotnetTests.XUnitTests</a> | ||
``` | ||
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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| | ||
## ❌ <a id="user-content-r0" href="#r0">fixtures/rspec-json.json</a> | ||
**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| | ||
### ❌ <a id="user-content-r0s0" href="#r0s0">./spec/config/check_env_vars_spec.rb</a> | ||
``` | ||
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ AcmeLibTests.AcmeLibTests | |
✅ test_always_pass | ||
✅ test_always_skip | ||
❌ test_always_fail | ||
failed | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <top (required)>' | ||
./spec/config/check_env_vars_spec.rb:19:in \`block (4 levels) in <top (required)>'", | ||
"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, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
}) | ||
}) |
Oops, something went wrong.