ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

Text explorer: Test host process crashes if test method name contains certain characters

Open Martin521 opened this issue 1 year ago • 4 comments

Describe the bug

When running the full set of FSharp.Compiler.ComponentTests from the Ionide Test Explorer in a dev container, the tests abort with message "Test host crashed".

Results File: /root/.vscode-server/data/User/workspaceStorage/8d7df8f636deedebbc1783f0238cf654/Ionide.Ionide-fsharp/TestResults/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.trx



Passed!  - Failed:     0, Passed:   183, Skipped:     0, Total:   183, Duration: 35 s - FSharp.Compiler.ComponentTests.dll (net8.0)
The active test run was aborted. Reason: Test host process crashed

Test Run Aborted.

❌ Error running tests: 
    project: /workspaces/fsharp/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj 

    error:
        An item with the same key has already been added. Key: Language.FixedBindings.Legacy.Pin naked Tuple

In a terminal, dotnet test runs all 3180 tests without crash.

Steps to reproduce

Dev Containers: Clone repository dotnet/fsharp F# test explorer: discover test => this works fine Run tests => crash as above

Link to sample reproduction

https://github.com/dotnet/fsharp/

Expected behaviour

All 3180 tests should run

Machine info

  • OS: Windows 11 with Docker
  • .NET SDK version: in the container: 8.0.100
  • Ionide version: 7.15.2

Martin521 avatar Nov 16 '23 21:11 Martin521

I found that test method names that contain (for example) '+' or '.' create this issue.

Martin521 avatar Nov 24 '23 16:11 Martin521

Possibly a duplicate of #1956

Martin521 avatar Nov 24 '23 16:11 Martin521

I think it is happening here. But I also don't see an easy solution. If we use dotnet test -t for discovery and method names contain dots, how can we know what is a path separator and what is part of the method name?

Martin521 avatar Dec 01 '23 08:12 Martin521

I was thinking of weeding out such test names. It seems, though, that other test explorers handle them well, and xUnit actually recommends such tests.

Martin521 avatar Jan 20 '24 14:01 Martin521