Skip to content

Commit

Permalink
Report times in milliseconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Ring authored and Jozef Izso committed Jun 25, 2024
1 parent 49c1f3a commit 953e623
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions __tests__/__outputs__/dotnet-nunit.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
![Tests failed](https://img.shields.io/badge/tests-3%20passed%2C%205%20failed%2C%201%20skipped-critical)
## ❌ <a id="user-content-r0" href="#r0">fixtures/dotnet-nunit.xml</a>
**9** tests were completed in **0ms** with **3** passed, **5** failed and **1** skipped.
**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⚪|0ms|
|[DotnetTests.NUnitV3Tests.dll.DotnetTests.XUnitTests](#r0s0)|3✅|5❌|1⚪|69ms|
### ❌ <a id="user-content-r0s0" href="#r0s0">DotnetTests.NUnitV3Tests.dll.DotnetTests.XUnitTests</a>
```
CalculatorTests
Expand Down
20 changes: 10 additions & 10 deletions __tests__/__snapshots__/dotnet-nunit.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TestRunResult {
"error": undefined,
"name": "Is_Even_Number(2)",
"result": "success",
"time": 0.000622,
"time": 0.622,
},
TestCaseResult {
"error": Object {
Expand All @@ -27,7 +27,7 @@ TestRunResult {
},
"name": "Is_Even_Number(3)",
"result": "failed",
"time": 0.001098,
"time": 1.098,
},
TestCaseResult {
"error": Object {
Expand All @@ -39,7 +39,7 @@ TestRunResult {
},
"name": "Exception_In_TargetTest",
"result": "failed",
"time": 0.022805,
"time": 22.805,
},
TestCaseResult {
"error": Object {
Expand All @@ -50,7 +50,7 @@ TestRunResult {
},
"name": "Exception_In_Test",
"result": "failed",
"time": 0.000528,
"time": 0.528,
},
TestCaseResult {
"error": Object {
Expand All @@ -64,25 +64,25 @@ TestRunResult {
},
"name": "Failing_Test",
"result": "failed",
"time": 0.028162,
"time": 28.162,
},
TestCaseResult {
"error": undefined,
"name": "Passing_Test",
"result": "success",
"time": 0.000238,
"time": 0.23800000000000002,
},
TestCaseResult {
"error": undefined,
"name": "Passing_Test_With_Description",
"result": "success",
"time": 0.000135,
"time": 0.135,
},
TestCaseResult {
"error": undefined,
"name": "Skipped_Test",
"result": "skipped",
"time": 0.000398,
"time": 0.398,
},
TestCaseResult {
"error": Object {
Expand All @@ -93,7 +93,7 @@ TestRunResult {
},
"name": "Timeout_Test",
"result": "failed",
"time": 0.014949,
"time": 14.949,
},
],
},
Expand All @@ -102,6 +102,6 @@ TestRunResult {
"totalTime": undefined,
},
],
"totalTime": 0.230308,
"totalTime": 230.30800000000002,
}
`;
4 changes: 2 additions & 2 deletions src/parsers/dotnet-nunit/dotnet-nunit-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class DotNetNunitParser implements TestParser {

private getTestRunResult(path: string, nunit: NunitReport): TestRunResult {
const suites: TestSuiteResult[] = []
const time = parseFloat(nunit['test-run'].$.duration)
const time = parseFloat(nunit['test-run'].$.duration) * 1000

this.populateTestCasesRecursive(suites, [], nunit['test-run']['test-suite'])

Expand Down Expand Up @@ -93,7 +93,7 @@ export class DotNetNunitParser implements TestParser {
new TestCaseResult(
testCase.$.name,
this.getTestExecutionResult(testCase),
parseFloat(testCase.$.duration),
parseFloat(testCase.$.duration) * 1000,
this.getTestCaseError(testCase)
)
)
Expand Down

0 comments on commit 953e623

Please sign in to comment.