Closed rschnekenbu closed 1 week ago
@rschnekenbu I have a couple of remarks from testing:
I moved the preferences to right place. That is now under Features section. I removed the openWithTestExplorer, as the option (copied from vs code) is not really obvious given the comment on the d.ts file and in the description of the preference. Now, the 2 options are 'do nothing' or 'open Test Results View'. I kept however the enum choice if we want to expand later the choices to other views. I also removed unused code left from previous implementation.
A small detail about the test of this feature: Running the tests from the UI should preserve the focus in any case, and not open any views. Only triggering from the extension, with the 'preserveFocus:false' version should open the view if the preference is set for this.
@rschnekenbu for me revealing the test explorer does not work in this scenario:
openOnTestStart
.🤷
@rschnekenbu for me revealing the test explorer does not work in this scenario:
- Set the preference to
openOnTestStart
.- Make sure the file explorer view is visible
- Invoke `Trigger Test (preserveFocus: false)
- Observe: the test explorer view is not revealed.
🤷
The Test Results View shall open, not the Test Explorer. Is that not the case?
The Test Results View shall open, not the Test Explorer. Is that not the case?
No, the file explorer still is visible.
Cleared this up: The "Test Result View" is the one that shows up in the lower right corner where the terminals, etc. are.
What it does
Add a progress service for tests to support activation of views Support vscode API to listen for test run request preserveFocus:
fixes #13759
contributed on behalf of STMicroelectronics
How to test
Start the theia browser example on master and install the following extension (derived from vscode sample extension test-provider-sample):
When starting extensions from Test UI, nothing should happen (as preserveFocus is always true in this case)
With the PR and the extensions, 2 additional commands are available with the markdown tests: Test Sample: Trigger Tests (preserveFocus: true/false). With the one with true, nothing shall happen also. The Test Result view shall activate when using the command with the false preserve Focus.
Follow-ups
The current implementation may be extended later based on preferences and test results status. In VS Code, when tests are started or failing, the Test Result view or the Test Explorer view can be activated based on user preferences (see https://github.com/microsoft/vscode/blob/f9238dd94a8b54dc3adb274927c7871e7c215300/src/vs/workbench/contrib/testing/browser/testingProgressUiService.ts#L49)
Review checklist
Reminder for reviewers