microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.71k stars 29.08k forks source link

[Testing API Feature] Add a new api in TestRun to reset test item to its initial state (unknown, not run) #206139

Open connectdotz opened 8 months ago

connectdotz commented 8 months ago

Currently, there doesn't seem to be a way to "reset" a test item's state once it is set to something.

I have tried deleting the child items then recreating them; marking the items with TestController.invalidateTestResults(). None of these methods seem to reset the test items to the initial state; they continue to display the last run states from the cache.

I may be missing something. Otherwise, please consider adding an unknown() or reset() method to the TestRun class that reset the item to its initial state.

connectdotz commented 7 months ago

@connor4312, is there any reason we don't want to offer an API to clear or rest a test item's state to "unknown"?