pester / vscode-adapter

Run PowerShell Pester Tests with Visual Studio Code
MIT License
58 stars 14 forks source link

Only some of first results showing in Test Explorer UI #267

Open PsychoData opened 3 months ago

PsychoData commented 3 months ago

I was trying to use some templates, and was having some issues. I sorted that out by hardcoding out with a HashTable for now, but still only part of my test cases are populating results image

Partial Workaround: I was able to get this to re-build the list by clearing all of the test results image And then reloading the VSCode Window to re-trigger the discovery on the file.

My only idea is that at one point previously I had Stopped it Early while troubleshooting the templates - which is why it only showed 103 tests in the first Screenshot - but then in the full run there were well over 1800 considered image

Wondering if it might have gotten to 103/103 tests and said "Well, that's it - I'm done!" even though the Pester scan was still running in the background, it just stopped processing the output from it

PsychoData commented 3 months ago

In fact, I just thought to check the Output > Pester window, and got some confirmation that it is missing the results here are 3 copies of it in the UI image

So, essentially - my belief is that since I stopped Test Discovery early, it was throwing away all the extra tests it hadn't finished discovering before I stopped early.

To Replicate, as best I can:

Wherever you were during discovery, the TestRun will be cancelled, and it will stop processing more results from after that point. This is what it looks like in the logs for me image

The Workaround above does still seem to work, though sometimes I found I had to rename the Tests.ps1 file to something else, then reload, then rename back again - or it would still keep displaying the partial list after a Clear Test Results and a Reload Window