Skip to content

Commit

Permalink
New report rendering with code blocks instead of tables
Browse files Browse the repository at this point in the history
Previously we listed tests using markdown tables. Each test group had it's own table and textual preface saying how many tests were executed in what time.
This was completely reworked - now tests are listed inside code block. Grouping is achieved using simple indentation. Duration of individual tests is no longer shown - it produced too much "noise" in the report. Pass/Fail check-mark was also moved before name of test suite.
Behavior of "listTests" option was also changed - now if set to failed, it will list all tests, but only if suite is failed. Otherwise test listing is completely omitted.
Last change affects report trimming - if report is still too big after "listTests" is set to "failed" - it will trim report to fit max size and add informational message at the end.
  • Loading branch information
dorny committed Mar 31, 2021
1 parent 96df6db commit 690ec77
Show file tree
Hide file tree
Showing 13 changed files with 3,289 additions and 1,043 deletions.
50 changes: 23 additions & 27 deletions __tests__/__outputs__/dart-json.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
![Tests failed](https://img.shields.io/badge/tests-1%20passed%2C%204%20failed%2C%201%20skipped-critical)
## <a id="user-content-r0" href="#r0">fixtures/dart-json.json</a>
**6** tests were completed in **3.760s** with **1** passed, **4** failed and **1** skipped.
## <a id="user-content-r0" href="#r0">fixtures/dart-json.json</a>
**6** tests were completed in **4s** with **1** passed, **4** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[test/main_test.dart](#r0s0)|1✔️|3❌||74ms|
|[test/second_test.dart](#r0s1)||1❌|1✖️|51ms|
### <a id="user-content-r0s0" href="#r0s0">test/main_test.dart</a> ❌
**4** tests were completed in **74ms** with **1** passed, **3** failed and **0** skipped.

**Test 1**
|Result|Test|Time|
|:---:|:---|---:|
|✔️|Passing test|36ms|

**Test 1 Test 1.1**
|Result|Test|Time|
|:---:|:---|---:|
||Failing test|20ms|
||Exception in target unit|6ms|

**Test 2**
|Result|Test|Time|
|:---:|:---|---:|
||Exception in test|12ms|
### <a id="user-content-r0s1" href="#r0s1">test/second_test.dart</a> ❌
**2** tests were completed in **51ms** with **0** passed, **1** failed and **1** skipped.

|Result|Test|Time|
|:---:|:---|---:|
||Timeout test|37ms|
|✖️|Skipped test|14ms|
### ❌ <a id="user-content-r0s0" href="#r0s0">test/main_test.dart</a>
```
Test 1
✔️ Passing test
Test 1 Test 1.1
❌ Failing test
Expected: <2>
Actual: <1>
❌ Exception in target unit
Exception: Some error
Test 2
❌ Exception in test
Exception: Some error
```
### ❌ <a id="user-content-r0s1" href="#r0s1">test/second_test.dart</a>
```
❌ Timeout test
TimeoutException after 0:00:00.000001: Test timed out after 0 seconds.
✖️ Skipped test
```
31 changes: 17 additions & 14 deletions __tests__/__outputs__/dotnet-trx.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
![Tests failed](https://img.shields.io/badge/tests-3%20passed%2C%203%20failed%2C%201%20skipped-critical)
## <a id="user-content-r0" href="#r0">fixtures/dotnet-trx.trx</a>
**7** tests were completed in **1.061s** with **3** passed, **3** failed and **1** skipped.
## <a id="user-content-r0" href="#r0">fixtures/dotnet-trx.trx</a>
**7** tests were completed in **1s** with **3** passed, **3** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[DotnetTests.XUnitTests.CalculatorTests](#r0s0)|3✔️|3❌|1✖️|110ms|
### <a id="user-content-r0s0" href="#r0s0">DotnetTests.XUnitTests.CalculatorTests</a> ❌
**7** tests were completed in **110ms** with **3** passed, **3** failed and **1** skipped.

|Result|Test|Time|
|:---:|:---|---:|
||Exception_In_TargetTest|0ms|
||Exception_In_Test|2ms|
||Failing_Test|3ms|
|✔️|Passing_Test|0ms|
|✔️|Passing_Test_With_Name|0ms|
|✖️|Skipped_Test|1ms|
|✔️|Timeout_Test|102ms|
### ❌ <a id="user-content-r0s0" href="#r0s0">DotnetTests.XUnitTests.CalculatorTests</a>
```
❌ Exception_In_TargetTest
System.DivideByZeroException : Attempted to divide by zero.
❌ Exception_In_Test
System.Exception : Test
❌ Failing_Test
Assert.Equal() Failure
Expected: 3
Actual: 2
✔️ Passing_Test
✔️ Passing_Test_With_Name
✖️ Skipped_Test
✔️ Timeout_Test
```
1,118 changes: 1,054 additions & 64 deletions __tests__/__outputs__/fluent-validation-test-results.md

Large diffs are not rendered by default.

48 changes: 21 additions & 27 deletions __tests__/__outputs__/jest-junit.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
![Tests failed](https://img.shields.io/badge/tests-1%20passed%2C%204%20failed%2C%201%20skipped-critical)
## <a id="user-content-r0" href="#r0">fixtures/jest-junit.xml</a>
**6** tests were completed in **1.360s** with **1** passed, **4** failed and **1** skipped.
## <a id="user-content-r0" href="#r0">fixtures/jest-junit.xml</a>
**6** tests were completed in **1s** with **1** passed, **4** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[__tests__\main.test.js](#r0s0)|1✔️|3❌||486ms|
|[__tests__\second.test.js](#r0s1)||1❌|1✖️|82ms|
### <a id="user-content-r0s0" href="#r0s0">__tests__\main.test.js</a> ❌
**4** tests were completed in **486ms** with **1** passed, **3** failed and **0** skipped.

**Test 1**
|Result|Test|Time|
|:---:|:---|---:|
|✔️|Passing test|1ms|

**Test 1 › Test 1.1**
|Result|Test|Time|
|:---:|:---|---:|
||Failing test|2ms|
||Exception in target unit|0ms|

**Test 2**
|Result|Test|Time|
|:---:|:---|---:|
||Exception in test|0ms|
### <a id="user-content-r0s1" href="#r0s1">__tests__\second.test.js</a> ❌
**2** tests were completed in **82ms** with **0** passed, **1** failed and **1** skipped.

|Result|Test|Time|
|:---:|:---|---:|
||Timeout test|4ms|
|✖️|Skipped test|0ms|
### ❌ <a id="user-content-r0s0" href="#r0s0">__tests__\main.test.js</a>
```
Test 1
✔️ Passing test
Test 1 › Test 1.1
❌ Failing test
Error: expect(received).toBeTruthy()
❌ Exception in target unit
Error: Some error
Test 2
❌ Exception in test
Error: Some error
```
### ❌ <a id="user-content-r0s1" href="#r0s1">__tests__\second.test.js</a>
```
❌ Timeout test
: Timeout - Async callback was not invoked within the 1 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 1 ms timeout specified by jest.setTimeout.Error:
✖️ Skipped test
```
Loading

0 comments on commit 690ec77

Please sign in to comment.