New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation about known issue regarding xunit tests when targeting .NET Full Framework #371
Comments
@AdmiringWorm is this still an issue? |
I think it is, but haven't really tested it since I created the issue. |
Just added .NET Framework to the .NET Core unit tests, and it seems to be still an issue. At the very least xUnit fails for .NET Framework, and it looks like there is something wrong for NUnit tests as well (although no failure here). |
Doh! 😢 |
On a positive note though, MSTest unit tests seems to work out-of-the-box 😄 |
Woot! 🎉 |
By doing some different testing regarding this issue, I found that there isn't much we can/should do in cake.recipe itself. But I believe this is an issue we would need/want to document (maybe in a known issues section?). Now onto what the issue actually is: The issue seems to only be related to the xunit testing framework when targeting a .NET Full Framework version and running on Unix (not confirmed if it is just Linux, or if macosx is also affected, but I believe so). <PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="16.6.1" Condition="$(TargetFramework.StartsWith('net4')) AND '$(OS)' == 'Unix'" /> The above package reference version should also match the package reference version of The error text that a user gets without this package reference may look similar to:
|
(GH-371) Added known issues section
(GH-371) Add info about known Xunit issue
When trying to run unit test on Linux, and you have either is using multiple target frameworks, or is just targeting a Full .NET Framework, then the .NET Core test utility is unable to actually find/run the unit tests (It will still run unit tests for .NET Core and .NET Standard).
I know this is a known problem in the .NET Core repository, and the reason why this happen can be different between different linux distros (in some it may actually succeed as well). In my case, it is because the testhost adapter that .NET Core tries to run, don't exist anywhere (and no way of getting a hold of it).
As such, I suggest that when running on a Unix platform, run only .NET Core targeted frameworks using
dotnet test
. But run the correct unit test executable for frameworks targeting the full .NET Framework (like what is done when running a normal MSBuild).The text was updated successfully, but these errors were encountered: