-
Notifications
You must be signed in to change notification settings - Fork 80
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
xunit.runner.visualstudio 2.8.1 fails to discover .Net 4.7.2 Unit Tests #409
Comments
I suspect your hunch is correct, in which case the bug is in VSTest and not with us, because we don't control that directory-based adapter discovery logic. I don't see much that changed between 2.5.0 and 2.5.1 that looks "suspect"; it was mostly pulling newer versions of |
I'm currently looking into a similar issue I think, but with dotnet test. Here's the source PR with the changes: dotnet/SqlClient#2980 I've tried --test-adapter-path with no luck though. @onur-ozguzel did you open any issue in the VSTest repo? |
We were able to resolve this it seems by removing these from the test project(s):
Thanks to dotnet/runtime#94183 which pointed me into the right direction it seems. |
This in particular is the problem, due to version conflicts:
Why do you have this linked? |
It's from the https://github.com/dotnet/SqlClient repo. I have no idea why this is linked there, I was just trying to update XUnit |
I didn't create any issue. We've started to consume the way I described above and forget about it. But I am happy you solved your problem. |
The good news is that
|
Hello,
For a long time, we were using xunit.runner.visualstudio 2.4.5. vstest.console.exe was able to detect both our .NET 6.0 and .NET Framework 4.7.2 unit tests with these parameters:
After we upgraded to xunit.runner.visualstudio 2.8.1, our .NET Framework unit test discoveries stopped working.
We tested all the new versions, the results were the same except 2.5.0. So discovery were not working correctly for 2.8.1 - 2.8.0 - 2.5.8 - 2.5.7 - 2.5.6 - 2.5.5 - 2.5.4 - 2.5.3 - 2.5.1.
The error message we were getting was:
For discovery to work again for .NET 4.7.2 Unit Tests, we had to change TestAdapterPath like below:
We have our project in C:\a\2\s folder. Meaning inside this folder, we have both .NET 6.0 and .NET Framework 4.7.2 Unit Tests and Test adapter assemblies. Our hunch is, after xunit.runner.visualstudio 2.4.5 and 2.5.0, vstest.console.exe started to find the wrong test adapter for .NET Framework 4.7.2 tests if we provide the base path, and because of that it failed to discover them.
In the newer versions of xunit.runner.visualstudio, can we provide the base path of the TestAdapterPath and make it work just like it was working in 2.4.5 and 2.5.0?
PS: For .NET 6.0 unit test, it is still able to discover tests by providing the base path to the TestAdapterPath like below:
The text was updated successfully, but these errors were encountered: