-
Notifications
You must be signed in to change notification settings - Fork 742
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
nunit Framework tests do not run with "dotnet test" nor inside VS2019 (Windows) #3867
Comments
I found some time to look into this today. The NUnit3DriverFactory.IsSupportedTestFramework explicitly tests on version 3 of the framework:
Note that this class is in the nunit-console repository. The current master branch has version 4. Locally if have tried a version with the one-token change ( Note that this involves changes in 3 repositories:
But they not all pass!
That failure is in when calling Note that the above failures also occur in the Are they supposed to be compatible? |
I am fixing this now for the embedded engine in the adapter, which is based off the 3.15.X branches. I will release a 4.5 alpha release of the adapter on nuget so it can be tested in the nunit framework repo. |
@manfred-brands @stevenaw @rprouse Further, as can be seen in the image above, the net462 is not displayed, and there is a warning about that, And there is only one place where the adapter is added, and that is the framework.test project. This Issue 3937 in the vstest repo is the only place I have found that refers to the same error messages, and the gist of it is that it looks like mixing framework DLLs in the same bin folder can cause this. Not sure which these can be, but I do see that all projects build to the same bin folder. It should be per framework, but that would not apply for dependencies. |
Thanks for taking a look at this @OsirisTerje and experimenting with an alpha release of the adapter. I'll also try to take a second look at this when I am able. From my recollection this issue appears to only affect the |
Do you know if the binary outputs have been changed? Link to alpha: https://www.nuget.org/packages/NUnit3TestAdapter/4.5.0-alpha.3 |
70 tests out of 5600 tests fails. Not the framework462 though, those tests do not appear, but that must be something else. However, the source code links from the tests in the test explorer to the source code doesn't work, it doesn't find the source code links.
|
Thanks @OsirisTerje ! |
@stevenaw No, the build output directory have been like that since 2017. But I seem to remember that the last time I worked with the framework (a few months back though), these things did work. Not sure though. |
@jnm2 Any idea why the loading of the assemblies using dynamic loading of the AssemblyLoadContext would fail? |
Added System.RunTime.Loader nuget package to get hold of the AssemblyLoadContext, and it works. See latest in the PR. |
Expected: as per the NUnit documentation here, I should be able to run the unit tests from the command line using
dotnet test
Actual: No tests are ever found
Environment
Dell XPS 15, 32BG ram
Running
clrver
outputs.Net 5.0 SDK has been installed manually
Steps to reproduce
build --target=Test --configuration=Release
dotnet test nunit.framework.tests.dll --framework:net5.0
dotnet test nunit.framework.tests.dll /TestAdapterPath:C:\Users\frank\Documents\Professional\Source\nunit-VS2019-2\bin\Release\net5.0 --framework:net5.0
dotnet test nunit.framework.tests.dll /TestAdapterPath:C:\Users\frank\Documents\Professional\Source\nunit-VS2019-2\bin\Release\net5.0 --framework:net5.0
nb. I've tried the above steps for the net4.5 build output to the same effect
Commentary
I believe the inability to find / execute the tests using
dotnet test
may explain why I cannot get unit tests to execute within Visual Studio 2019 (with or without Resharper) on Windows and also JetBrains Rider (on either Windows 10 and Debian Linux) - see attached log outputVS2019 test output log.txt
Related Issues
#3008
#2973
Related Discussions
#3861
Additional Information
I ran the following command from the bin\Release\net5.0 directory,
dotnet test nunit.framework.tests.dll --list-tests --framework:net5.0 --diag dotnet_test_log.txt --logger "console;verbosity=detailed"
The following logs were generated:
dotnet_test_log.host.21-06-01_20-09-24_22867_6.txt and dotnet_test_log.txt
The text was updated successfully, but these errors were encountered: