Skip to content

Commit 18430db

Browse files
authored
Merge pull request #615 from dboriichuk/trx-stack-trace-summary
Add stack trace from trx to summary
2 parents a1ac327 + ae8bd19 commit 18430db

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

__tests__/__outputs__/dotnet-trx-only-failed.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,24 @@
1111
```
1212
❌ Exception_In_TargetTest
1313
System.DivideByZeroException : Attempted to divide by zero.
14+
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
15+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_TargetTest() in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 33
1416
❌ Exception_In_Test
1517
System.Exception : Test
18+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_Test() in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 39
1619
❌ Failing_Test
1720
Assert.Equal() Failure
1821
Expected: 3
1922
Actual: 2
23+
at DotnetTests.XUnitTests.CalculatorTests.Failing_Test() in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 27
2024
❌ Is_Even_Number(i: 3)
2125
Assert.True() Failure
2226
Expected: True
2327
Actual: False
28+
at DotnetTests.XUnitTests.CalculatorTests.Is_Even_Number(Int32 i) in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 59
2429
❌ Should be even number(i: 3)
2530
Assert.True() Failure
2631
Expected: True
2732
Actual: False
33+
at DotnetTests.XUnitTests.CalculatorTests.Theory_With_Custom_Name(Int32 i) in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 67
2834
```

__tests__/__outputs__/dotnet-trx.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,29 @@
1212
✅ Custom Name
1313
❌ Exception_In_TargetTest
1414
System.DivideByZeroException : Attempted to divide by zero.
15+
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
16+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_TargetTest() in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 33
1517
❌ Exception_In_Test
1618
System.Exception : Test
19+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_Test() in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 39
1720
❌ Failing_Test
1821
Assert.Equal() Failure
1922
Expected: 3
2023
Actual: 2
24+
at DotnetTests.XUnitTests.CalculatorTests.Failing_Test() in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 27
2125
✅ Is_Even_Number(i: 2)
2226
❌ Is_Even_Number(i: 3)
2327
Assert.True() Failure
2428
Expected: True
2529
Actual: False
30+
at DotnetTests.XUnitTests.CalculatorTests.Is_Even_Number(Int32 i) in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 59
2631
✅ Passing_Test
2732
✅ Should be even number(i: 2)
2833
❌ Should be even number(i: 3)
2934
Assert.True() Failure
3035
Expected: True
3136
Actual: False
37+
at DotnetTests.XUnitTests.CalculatorTests.Theory_With_Custom_Name(Int32 i) in C:\Users\Michal\Workspace\dorny\test-reporter\reports\dotnet\DotnetTests.XUnitTests\CalculatorTests.cs:line 67
3238
⚪ Skipped_Test
3339
✅ Timeout_Test
3440
```

__tests__/__snapshots__/dotnet-trx.test.ts.snap

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ TestRunResult {
2121
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
2222
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_TargetTest() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 33",
2323
"line": 9,
24-
"message": "System.DivideByZeroException : Attempted to divide by zero.",
24+
"message": "System.DivideByZeroException : Attempted to divide by zero.
25+
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
26+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_TargetTest() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 33",
2527
"path": "DotnetTests.Unit/Calculator.cs",
2628
},
2729
"name": "Exception_In_TargetTest",
@@ -33,7 +35,8 @@ TestRunResult {
3335
"details": "System.Exception : Test
3436
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 39",
3537
"line": 39,
36-
"message": "System.Exception : Test",
38+
"message": "System.Exception : Test
39+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 39",
3740
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
3841
},
3942
"name": "Exception_In_Test",
@@ -49,7 +52,8 @@ Actual: 2
4952
"line": 27,
5053
"message": "Assert.Equal() Failure
5154
Expected: 3
52-
Actual: 2",
55+
Actual: 2
56+
at DotnetTests.XUnitTests.CalculatorTests.Failing_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 27",
5357
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
5458
},
5559
"name": "Failing_Test",
@@ -71,7 +75,8 @@ Actual: False
7175
"line": 59,
7276
"message": "Assert.True() Failure
7377
Expected: True
74-
Actual: False",
78+
Actual: False
79+
at DotnetTests.XUnitTests.CalculatorTests.Is_Even_Number(Int32 i) in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 59",
7580
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
7681
},
7782
"name": "Is_Even_Number(i: 3)",
@@ -99,7 +104,8 @@ Actual: False
99104
"line": 67,
100105
"message": "Assert.True() Failure
101106
Expected: True
102-
Actual: False",
107+
Actual: False
108+
at DotnetTests.XUnitTests.CalculatorTests.Theory_With_Custom_Name(Int32 i) in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 67",
103109
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
104110
},
105111
"name": "Should be even number(i: 3)",
@@ -150,7 +156,9 @@ TestRunResult {
150156
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
151157
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_TargetTest() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 33",
152158
"line": 9,
153-
"message": "System.DivideByZeroException : Attempted to divide by zero.",
159+
"message": "System.DivideByZeroException : Attempted to divide by zero.
160+
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
161+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_TargetTest() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 33",
154162
"path": "DotnetTests.Unit/Calculator.cs",
155163
},
156164
"name": "Exception_In_TargetTest",
@@ -162,7 +170,8 @@ TestRunResult {
162170
"details": "System.Exception : Test
163171
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 39",
164172
"line": 39,
165-
"message": "System.Exception : Test",
173+
"message": "System.Exception : Test
174+
at DotnetTests.XUnitTests.CalculatorTests.Exception_In_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 39",
166175
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
167176
},
168177
"name": "Exception_In_Test",
@@ -178,7 +187,8 @@ Actual: 2
178187
"line": 27,
179188
"message": "Assert.Equal() Failure
180189
Expected: 3
181-
Actual: 2",
190+
Actual: 2
191+
at DotnetTests.XUnitTests.CalculatorTests.Failing_Test() in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 27",
182192
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
183193
},
184194
"name": "Failing_Test",
@@ -200,7 +210,8 @@ Actual: False
200210
"line": 59,
201211
"message": "Assert.True() Failure
202212
Expected: True
203-
Actual: False",
213+
Actual: False
214+
at DotnetTests.XUnitTests.CalculatorTests.Is_Even_Number(Int32 i) in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 59",
204215
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
205216
},
206217
"name": "Is_Even_Number(i: 3)",
@@ -228,7 +239,8 @@ Actual: False
228239
"line": 67,
229240
"message": "Assert.True() Failure
230241
Expected: True
231-
Actual: False",
242+
Actual: False
243+
at DotnetTests.XUnitTests.CalculatorTests.Theory_With_Custom_Name(Int32 i) in C:\\Users\\Michal\\Workspace\\dorny\\test-reporter\\reports\\dotnet\\DotnetTests.XUnitTests\\CalculatorTests.cs:line 67",
232244
"path": "DotnetTests.XUnitTests/CalculatorTests.cs",
233245
},
234246
"name": "Should be even number(i: 3)",

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parsers/dotnet-trx/dotnet-trx-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ export class DotnetTrxParser implements TestParser {
146146
return undefined
147147
}
148148

149-
const message = test.error.Message[0]
150149
const stackTrace = test.error.StackTrace[0]
150+
const message = `${test.error.Message[0]}\n${stackTrace}`
151151
let path
152152
let line
153153

@@ -161,7 +161,7 @@ export class DotnetTrxParser implements TestParser {
161161
path,
162162
line,
163163
message,
164-
details: `${message}\n${stackTrace}`
164+
details: `${message}`
165165
}
166166
}
167167

0 commit comments

Comments
 (0)