You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've excluded when test names contain variables (since that's more tricky), but for the most common case we'll know show a warning at the end of a test run if we expected only a single test to run (that is, you're not running a group, there is exactly one test name, and it does not contain a $) but multiple did:
changed the title
if more than one test has the same name clicking on the debug or run link always executes the one further up
Warn if multiple tests run when trying to run a single test by name
Dec 8, 2020
(Re-opening as I haven't landed the change yet, but it'll close when I do :-))
what happens if you click run on one of the tests that have a brother with the same name?
I'm not sure what you mean - isn't this the same case described above? Or do you mean a non-sibling test? That should work as expected, as the "test name" we construct when running from code lens is actually a full name of all of the groups prefixed to it. It's only if the complete name matches that this will trigger. This is similar to how if you have two tests named "foo" in different groups, running one of them doesn't run the other today already.
It shouldn't be - we should always run the test that you wanted, but if there is another test with the exact same name, that may run too. All we do now is count how many tests ran, and if it's > 1 but we had run in a way that we expected only one (eg. a single test name) we'll show the warning.