Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"sdk": {
"version": "8.0.100"
"version": "8.0.100",
"rollForward": "feature",
"allowPrerelease": false
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
},
"engines": {
"node": ">=16.0.0"
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You find a version of this plugin pre-packaged with the FOSS debugger from Samsu

## How to Contribute

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
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
the project and submit pull requests.

### Building and Running
Expand Down
34 changes: 20 additions & 14 deletions src/Components/TestExplorer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ module TestFrameworkId =
type TestResult =
{ FullTestName: string
Outcome: TestResultOutcome
Output: string option
ErrorMessage: string option
ErrorStackTrace: string option
Expected: string option
Expand Down Expand Up @@ -312,13 +313,12 @@ module TrxParser =
{ Message: string option
StackTrace: string option }

type Output = { ErrorInfo: ErrorInfo }

type UnitTestResult =
{ ExecutionId: string
Outcome: string
Duration: TimeSpan
Output: Output }
Output: string option
ErrorInfo: ErrorInfo }

type TestWithResult =
{ UnitTest: UnitTest
Expand Down Expand Up @@ -376,6 +376,8 @@ module TrxParser =

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

let outputMessage = xpathSelector.TrySelectStringRelative(node, "t:Output/t:StdOut")

let errorInfoMessage =
xpathSelector.TrySelectStringRelative(node, "t:Output/t:ErrorInfo/t:Message")

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


{ ExecutionId = executionId
Outcome = outcome
Duration = durationSpan
Output =
{ ErrorInfo =
{ StackTrace = errorStackTrace
Message = errorInfoMessage } } }
Output = outputMessage
ErrorInfo =
{ StackTrace = errorStackTrace
Message = errorInfoMessage } }

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

match testResult.Outcome with
| TestResultOutcome.NotExecuted -> testRun.skipped testItem
| TestResultOutcome.Passed -> testRun.passed (testItem, testResult.Timing)
| TestResultOutcome.Passed ->
testResult.Output
|> Option.iter (TestRun.appendOutputLineForTest testRun testItem)

testRun.passed (testItem, testResult.Timing)

| TestResultOutcome.Failed ->
let fullErrorMessage =
match testResult.ErrorMessage with
Expand All @@ -1248,10 +1254,10 @@ module Interactions =
| None -> "No error reported"

let msg = vscode.TestMessage.Create(!^fullErrorMessage)

msg.location <- TestItem.tryGetLocation testItem
msg.expectedOutput <- testResult.Expected
msg.actualOutput <- testResult.Actual

TestRun.showFailure testRun testItem msg testResult.Timing

let mergeTestResultsToExplorer
Expand Down Expand Up @@ -1303,9 +1309,8 @@ module Interactions =
displayTestResultInExplorer testRun (treeItem, additionalResult))

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

{ FullTestName = trxResult.UnitTest.FullName
Outcome = !!trxResult.UnitTestResult.Outcome
ErrorMessage = trxResult.UnitTestResult.Output.ErrorInfo.Message
ErrorStackTrace = trxResult.UnitTestResult.Output.ErrorInfo.StackTrace
Output = trxResult.UnitTestResult.Output
ErrorMessage = trxResult.UnitTestResult.ErrorInfo.Message
ErrorStackTrace = trxResult.UnitTestResult.ErrorInfo.StackTrace
Expected = expected
Actual = actual
Timing = trxResult.UnitTestResult.Duration.Milliseconds
Expand Down