Peter Osterdahl;18635 wrote:
IF you have picked "Show failing tests" in the Tests view (and maybe have some pinned test also).
When you right click the test project and select "Run selected tests in new task runner process" all tests in the project will run, not only the visible ones.
This is a little confusing since I didn't think that the invisible tests were choosen as well.
Correct. This is deliberate. The Tests Window itself is a configurable structured view over your tests, and it works independently from the commands to run those tests. When you select a project and choose to run, it passes the project identifier to the engine, which automatically queues all tests in the project regardless of how you've configured the Tests Window.
The correct button to use in your situation would be the one that runs all visible tests, though I accept this has limitations (in that it queues the whole visible lot, not just the ones inside a selected subset).
The behaviour above is not intuitive. It stems from the separation between the Tests Window and the engine itself. There are other similar problems like this, particularly relating to ignored tests and how they are handled hierarchically.
I do not believe there is a 'perfect' solution to the above. I could add more options, but this creates overload. I could adjust it so it only runs the visible tests, but then there's no way to broadly target the rest of them without adjusting the Tests Window view and adding ceremony to the whole process.
I will accept arguments in favour of ways that the above could be made better, but there is one very real constraint: The entire existing user base is already used to it, and the advantages gained from changing it will not likely be worth the disruption this would cause.