-
Notifications
You must be signed in to change notification settings - Fork 323
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
Custom XUnit test bits aren't used/run by the test runner #291
Comments
Debugged through our code and we're setting skip conditions appropriately. Just doesn't look like it's handled by the VStest infrastructure. |
This is likely an issue with xunit adapter (https://github.com/xunit/visualstudio.xunit). I don't see any exception in host logs. Xunit adapter discovers the tests correctly, execution is incorrect. Will debug thru the xunit adapter and update. |
During execution, xunit is unable to deserialize SkipReasonTestCase. It fails with following stack trace:
Because of this only Test2 is run and Test1 is ignored. Adding a parameterless constructor goes further, but fails in SkipReasonTestCase.Deserialize since _wrappedTestCase is not available. SkipReasonTestCase requires a fix. May be it could inherit from XunitTestCase, and override RunAsync to provide a choice over test case runner based on |
@codito |
Found the reason as to why it worked in the old world. We weren't required to serialize/deserialize stuff so we didn't see that it was broken. Digging a little deeper to find the fix. |
TestMethodTestCase may help, it implements serialization for data required during execution. |
- With CSproj based test runners test cases are passed across application boundaries which require test cases to be serializable. microsoft/vstest#291
Found a fix and have a PR out on our end. Closing this. Thanks for the investigation @codito! |
- With CSproj based test runners test cases are passed across application boundaries which require test cases to be serializable. microsoft/vstest#291
Description
Us on the ASP.NET team are attempting to use the new VSTest infrastructure and have found that it doesn’t respect custom test attributes. In particular we have a ConditionalFactAttribute that we look for to enable custom skip conditions when running tests cross platform.
What I've noticed is that the Test Explorer in VS 2017 picks up the existence of the Test but cannot run the test (even when trying to forcefully run it). Also, attempting to run tests at command line via
dotnet test
results in the tests not being run (don't exist in pass, fail or skip).Steps to reproduce
dotnet restore
dotnet test
Expected behavior
2 test failures.
Actual behavior
Environment
/cc @Eilon @muratg @DamianEdwards
The text was updated successfully, but these errors were encountered: