pester / vscode-adapter

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

Selecting 'Continuous Run' on the Test Explorer bar results in 'undefined' run #272

Open cliffchapmanrbx opened 3 days ago

cliffchapmanrbx commented 3 days ago

The short version:

Clicking on the Start Continuous Run button on the Test Explorer pane causes [info] Continuous run enabled for undefined to show in logs, and no test are executed. When in List View I cannot start a file-level continuous run.

The workaround is to:

  1. Switch to the Tree View
  2. Start the continuous run on the file instead of on the Test Explorer panel.
  3. Switch to the List View

The long version

The Test Explorer window has two ways to display test results: Tree and List. You can select which one you want via the three-dot menu on the 'Test Explorer' panel.

When in tree view you have two ways to start a continuous run. The Test Explorer only allows one continuous run at a time.

  1. At the Test Explorer level at the very top of the pane.
  2. Somewhere in the hierarchy of tests, such as at the top file level or deeper within the tree.

image

Option 2 works great and I love it. Sometimes I want to view my tests by list instead, and in that view I can only start a continuous run for individual tests.

image

I would like to be able to use Option 1 in this situation. When I click the Test Explorer continuous run button nothing appears to happen. In the output for the extension I see

[info] Continuous run enabled for undefined
[info] Continuous run was disabled for undefined

Toggling it at the file level I see

[info] Continuous run enabled for C:\GIT\TERRAFORM-ACTIONS\SRC\TERRAFORMWRAPPER.TESTS.PS1
[info] Continuous run was disabled for C:\GIT\TERRAFORM-ACTIONS\SRC\TERRAFORMWRAPPER.TESTS.PS1

Toggling it at the individual test level I see

[info] Continuous run enabled for C:\GIT\TERRAFORM-ACTIONS\SRC\TERRAFORMWRAPPER.TESTS.PS1>>GET-TFCOMMANDNAME>>WITH WRAPPER>>ASKS FOR AND GETS THE WRAPPER
[info] Continuous run was disabled for C:\GIT\TERRAFORM-ACTIONS\SRC\TERRAFORMWRAPPER.TESTS.PS1>>GET-TFCOMMANDNAME>>WITH WRAPPER>>ASKS FOR AND GETS THE WRAPPER

Other test extensions such as vitest seem to support this, so maybe this is just a matter of passing the right value through?

Possibly related to #163 maybe?

Priority

This is absolutely not urgent as I have a trivial workaround, just wanted to document it. Thank you for maintaining such a useful extension!

JustinGrote commented 3 days ago

Thanks for your submission and the detail! Probably just a missing null check somewhere, I'll investigate after I complete some rework in the lifetime of a test that is causing some dangling cleanup not to occur.