vstest icon indicating copy to clipboard operation
vstest copied to clipboard

Newly dsicovered tests does not run

Open kant2002 opened this issue 1 year ago • 3 comments

Description

Specifically find issue in F#, but maybe with other languages or adapters that would be the case too. I have test project, and when I type new test and run assembly it in TestExplorer newly created test discovered but does not run and I have to run tests again.

Steps to reproduce

  1. Create test project in F#
  2. Add new test
  3. Run Assembly in Test Explorere

Expected behavior

All previous tests + new test are run

Actual behavior

All previously existing tests run, but new test just marked as discovered and did not run.

Diagnostic logs

Environment

Version 17.7.0 Preview 6.0

kant2002 avatar Aug 06 '23 16:08 kant2002

@drognanar arthur please have a look if this is a new issue.

nohwnd avatar Aug 07 '23 08:08 nohwnd

this is to be expected given the current implementation

when you right click a project or a namespace or a class in test explorer, you're running the selected tests underneath. any newly discovered tests will not be run currently, as we're computing the selection at the time you click the run button.

on the other hand, right-clicking a test project in solution explorer, or right clicking a method in the editor is expected to run new tests

drognanar avatar Aug 07 '23 09:08 drognanar

I can understand why it happens when I run namespace or test class. But from what I know if you run assembly no need to specify individual tests and test explorer have

  • test container (assembly basically)
  • Namespace
  • Class
  • Method/test

Would be great if at least when I run tests in test container/assembly it will run all tests in that assembly.

Also if right click in F# was available that wout be great. Right now current design works only for Roslyn which discover tests on the fly somehow.

kant2002 avatar Aug 07 '23 11:08 kant2002

As described above this is by-design, if you don't agree please file an issue on VS, where Test Explorer resides, thank you. https://learn.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022

nohwnd avatar Jul 08 '24 08:07 nohwnd