xunit / visualstudio.xunit

VSTest runner for xUnit.net (for Visual Studio Test Explorer and dotnet test)
https://xunit.net/
Other
146 stars 81 forks source link

`dotnet watch test` no longer outputs test results in .NET 8 SDK #393

Closed onionhammer closed 11 months ago

onionhammer commented 11 months ago

Prior to installing .net 8 SDK, I was able to run dotnet watch test --filter ... and I would see updated test results whenever I updated a file, now I have to re-run dotnet test, and dotnet watch test just returns

dotnet watch πŸš€ Started
dotnet watch ⌚ Exited
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...
dotnet watch πŸš€ Started
dotnet watch ⌚ Exited
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...

csproj:

    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
    <PackageReference Include="xunit" Version="2.6.2" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="coverlet.collector" Version="6.0.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
bradwilson commented 11 months ago

If this is new to .NET 8 and still works with an older SDK, did you open an issue with the .NET team?

bradwilson commented 11 months ago

This looks like dotnet watch is broken in .NET 8 SDK.

Compare the .NET 6 SDK:

image

To the .NET 8 SDK:

image

Clearly the latter is just trying to run the DLL rather than run the test command, which is why it's immediately exiting with failure.

bradwilson commented 11 months ago

Someone has already reported this at https://github.com/dotnet/sdk/issues/34949 so closing this issue.

onionhammer commented 11 months ago

@bradwilson you may want to keep something open as a known tracking issue so others don't report it, it's an issue with a dependency on an external team to fix