ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
849 stars 276 forks source link

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

Open Martin521 opened 7 months ago

Martin521 commented 7 months ago

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

Martin521 commented 7 months ago

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

Martin521 commented 7 months ago

Possibly a duplicate of #1956

Martin521 commented 7 months ago

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 commented 5 months ago

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.