-
Notifications
You must be signed in to change notification settings - Fork 269
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
Running a single test case of a parameterized test in IDE #5294
Comments
@drognanar For MTP, is it guaranteed that discovery and execution happen in the same process? |
Isn't that up to the framework? If I get a discovery request, I do discovery. If I get a run request, I do discovery and execution. (because without discovery I won't have any test objects populated into memory) |
@thomhurst My question was more like for the discovery request and execution request. But I'm now thinking that even they are done in the same process, that's not a behavior that a test framework should depend on and it's up to the frameworks how they can recognize the test cases. I'm moving the area to be on MSTest side actually. |
It is definitely up to the test framework! It could be interesting to brainstorm across test frameworks as we all face a similar problem: with .NET there is no good way to consistently uniquely identify a "data" without asking the user. Let's assume the user is creating a "data source" returning a |
I agree and I think the problem needs to left to the data provider to "solve". DataRow data provider can reasonably assume that the attribute data can be serialized to some string. And matched later, even if the test case moves in order. Database source can ask the user to provider unique key for data, which they hopefully have. The biggest problem are just normal objects that are created in process via DynamicData source, there we don't have a good way to relate instance created in one process to instance that was created in subsequent run, in a totally new process. We have only serialization which assumes that the object can be fully and uniquely serialized. Or that the object can provide some stable unique identifier, which such objects often don't have. Then there is one more aspect which is preferring a replay of the test, or prefer re-run of the test. For example if I make an edit in code like this:
And then tell TE to run TestMethod("a") should it:
Imho the first behavior is what XUnit does because it serializes whole test case to data, and uses that as source for the test run. For me the second behavior is more accurate, because I get more up-to-date data. Another aspect is how aware the IDE should be about the fact that the data under the tests can change. When we say RunAll tests, TE is currently sending all test cases to be run. Instead of sending a command that says "run all tests in this assembly", similar approach can be applied to running tests in class or on method. To me this is not great, because I as user want to know if the system is working against the current set of data, and current set of tests, and not against set of tests I discovered 20 minutes ago. |
I didn't try to repro with VSTest, but at least with MTP, this appears to be problematic.
We get TestNodeUidListFilter from Test Explorer, but that doesn't have any info regarding which test case is actually being executed.
With VSTest, I think we send
TestCase
to VS and we serialize the test method arguments, which is already very problematic.The text was updated successfully, but these errors were encountered: