-
Notifications
You must be signed in to change notification settings - Fork 106
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
Tests with dynamic/random parameters are never run #97
Comments
Good analysis of the problem. It's also described in nunit/nunit-vs-adapter#15, which we had decided to defer to NUnit 3.0 because it's a fairly major change. We'll use this issue to track it for 3.0 adapter. |
Thanks @CharliePoole. I swear I search for pre-existing issues before reporting, but I'm 0 for 2 so far! |
No problem, you saved us copying that issue here from the nunit-vs-adapter repo. |
It would be nice to fix this for 3.0. The simplest possibility seems to be saving the random seed from discovery and re-using it in execution. Where to save it is the key question. However, saving the random seed would not help us with other instances of the same problem. Random data is only the most obvious place where the use of two completely separate processes for discovery and execution can trip us up. Ideally, we would prefer to save the already-loaded tests somewhere as a tree and just run them when it came to execution time. If somebody with in-depth knowledge of VS architecture can help with ideas, they would be welcome. |
Hi, I have a similar situation, though probably more complex. Using AutoFixture and NSubstitute, I can declare tests as such:
This works with xUnit and also with NUnit console runners. The VS test runner shows it always inconclusive. Test output shows:
More details are available on SO. Thanks, Rob |
@RobajZ It's certainly possible, but we would have to know a lot more about the internals of AutoSubstitute to be sure. If the generated data is random, then fixing this issue is probably a necessary but not necessarily sufficient condition for fixing the AutoSubstitute problem. |
Thanks @CharliePoole , I've created a new issue #188, thus. |
Consider the following test:
This test appears in the adapter as:
When I then attempt to run these tests (right-click, Run Selected Tests), neither are run at all and become grayed out. I assume this is because it generates test names twice; once when lists the tests, and then again when attempting to run the tests. Since a different random number is generated each time, the adapter can't find the test that was selected and so skips it.
The console runner does not have this problem:
The text was updated successfully, but these errors were encountered: