Skip to content

Commit 1df0537

Browse files
committed
log standard out on passing tests
1 parent cc8cb23 commit 1df0537

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

global.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"sdk": {
3-
"version": "8.0.100"
3+
"version": "8.0.100",
4+
"rollForward": "feature",
5+
"allowPrerelease": false
46
}
57
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
},
2828
"engines": {
2929
"node": ">=16.0.0"
30-
}
30+
},
31+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
3132
}

release/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ You find a version of this plugin pre-packaged with the FOSS debugger from Samsu
5959

6060
## How to Contribute
6161

62-
Ths project is hosted on [GitHub](https://github.com/ionide/ionide-vscode-fsharp) where you can [report issues](https://github.com/ionide/ionide-vscode-fsharp/issues), participate in [discussions](https://github.com/ionide/ionide-vscode-fsharp/discussions), fork
62+
This project is hosted on [GitHub](https://github.com/ionide/ionide-vscode-fsharp) where you can [report issues](https://github.com/ionide/ionide-vscode-fsharp/issues), participate in [discussions](https://github.com/ionide/ionide-vscode-fsharp/discussions), fork
6363
the project and submit pull requests.
6464

6565
### Building and Running

src/Components/TestExplorer.fs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ module TestFrameworkId =
240240
type TestResult =
241241
{ FullTestName: string
242242
Outcome: TestResultOutcome
243+
Output: string option
243244
ErrorMessage: string option
244245
ErrorStackTrace: string option
245246
Expected: string option
@@ -312,13 +313,12 @@ module TrxParser =
312313
{ Message: string option
313314
StackTrace: string option }
314315

315-
type Output = { ErrorInfo: ErrorInfo }
316-
317316
type UnitTestResult =
318317
{ ExecutionId: string
319318
Outcome: string
320319
Duration: TimeSpan
321-
Output: Output }
320+
Output: string option
321+
ErrorInfo: ErrorInfo }
322322

323323
type TestWithResult =
324324
{ UnitTest: UnitTest
@@ -376,6 +376,8 @@ module TrxParser =
376376

377377
let outcome = xpathSelector.SelectStringRelative(node, "@outcome")
378378

379+
let outputMessage = xpathSelector.TrySelectStringRelative(node, "t:Output/t:StdOut")
380+
379381
let errorInfoMessage =
380382
xpathSelector.TrySelectStringRelative(node, "t:Output/t:ErrorInfo/t:Message")
381383

@@ -387,14 +389,13 @@ module TrxParser =
387389
let success, ts = TimeSpan.TryParse(durationString)
388390
if success then ts else TimeSpan.Zero
389391

390-
391392
{ ExecutionId = executionId
392393
Outcome = outcome
393394
Duration = durationSpan
394-
Output =
395-
{ ErrorInfo =
396-
{ StackTrace = errorStackTrace
397-
Message = errorInfoMessage } } }
395+
Output = outputMessage
396+
ErrorInfo =
397+
{ StackTrace = errorStackTrace
398+
Message = errorInfoMessage } }
398399

399400
xpathSelector.SelectNodes "/t:TestRun/t:Results/t:UnitTestResult"
400401
|> Array.map extractRow
@@ -1237,7 +1238,12 @@ module Interactions =
12371238

12381239
match testResult.Outcome with
12391240
| TestResultOutcome.NotExecuted -> testRun.skipped testItem
1240-
| TestResultOutcome.Passed -> testRun.passed (testItem, testResult.Timing)
1241+
| TestResultOutcome.Passed ->
1242+
testResult.Output
1243+
|> Option.iter (TestRun.appendOutputLineForTest testRun testItem)
1244+
1245+
testRun.passed (testItem, testResult.Timing)
1246+
12411247
| TestResultOutcome.Failed ->
12421248
let fullErrorMessage =
12431249
match testResult.ErrorMessage with
@@ -1248,10 +1254,10 @@ module Interactions =
12481254
| None -> "No error reported"
12491255

12501256
let msg = vscode.TestMessage.Create(!^fullErrorMessage)
1251-
12521257
msg.location <- TestItem.tryGetLocation testItem
12531258
msg.expectedOutput <- testResult.Expected
12541259
msg.actualOutput <- testResult.Actual
1260+
12551261
TestRun.showFailure testRun testItem msg testResult.Timing
12561262

12571263
let mergeTestResultsToExplorer
@@ -1303,9 +1309,8 @@ module Interactions =
13031309
displayTestResultInExplorer testRun (treeItem, additionalResult))
13041310

13051311
let private trxResultToTestResult (trxResult: TrxParser.TestWithResult) =
1306-
// Q: can I get these parameters down to just trxResult?
13071312
let expected, actual =
1308-
match trxResult.UnitTestResult.Output.ErrorInfo.Message with
1313+
match trxResult.UnitTestResult.ErrorInfo.Message with
13091314
| None -> None, None
13101315
| Some message ->
13111316
let lines =
@@ -1320,8 +1325,9 @@ module Interactions =
13201325

13211326
{ FullTestName = trxResult.UnitTest.FullName
13221327
Outcome = !!trxResult.UnitTestResult.Outcome
1323-
ErrorMessage = trxResult.UnitTestResult.Output.ErrorInfo.Message
1324-
ErrorStackTrace = trxResult.UnitTestResult.Output.ErrorInfo.StackTrace
1328+
Output = trxResult.UnitTestResult.Output
1329+
ErrorMessage = trxResult.UnitTestResult.ErrorInfo.Message
1330+
ErrorStackTrace = trxResult.UnitTestResult.ErrorInfo.StackTrace
13251331
Expected = expected
13261332
Actual = actual
13271333
Timing = trxResult.UnitTestResult.Duration.Milliseconds

0 commit comments

Comments
 (0)