Skip to content

Commit 9c97dae

Browse files
committed
Rediscover tests after a test run
Test projects without code analysis updates (i.e C# projects or projects using Microsoft.Testing.Platform.VSTestBridge) will show new tests if you run a group of tests that changed, but those new tests will not have code locations. The lack of code locations in this limited case is very confusing and degrades the experience significantly. I looked at several options to fill in these locations. - VSTest does not return test locations on test runs, so mapping a location from results doesn't work - Running discovery before a test run caused test runs to feel sluggish. Especially when trying to run individual tests, which is a core workflow. I tried project-specific discovery and parallel discovery/test run, but still had an average ~1s delay. However, test discovery, even with thousands of tests, only takes a few seconds. That feels sluggish before the test run, but is inconsequential after the test run. The discovery is generally finished before the user has evaluated the test results. This pattern also has some precedent. Visual Studio will generally discover new tests in a group only after you run the group. Thanks for coming to my ted talk.
1 parent 6713384 commit 9c97dae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Components/TestExplorer.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,11 +1993,12 @@ module Interactions =
19931993
successfullyBuiltRequests
19941994
|> (Promise.executeWithMaxParallel maxParallelTestProjects runTestProject)
19951995

1996-
()
1996+
testRun.``end`` ()
19971997
else
19981998
do! runTests_WithLanguageServer mergeTestResultsToExplorer testController.items req testRun
1999+
testRun.``end`` ()
2000+
do! discoverTests_WithLangaugeServer testItemFactory testController.items tryGetLocation
19992001

2000-
testRun.``end`` ()
20012002
}
20022003
|> (Promise.toThenable >> (!^))
20032004

0 commit comments

Comments
 (0)