You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we integrate our extension, vscode-jest, with the newly available Testing Coverage API, we've identified some issues that notably impact usability. Below, I provide some video demonstrations from our development environment, followed by descriptions of each issue.
Issue 1: Incomplete Coverage Trigger in Monorepo Projects
In monorepo projects with multiple testControllers, initiating a top-level coverage run does not trigger all registered controllers. The coverage run is activated only for the first controller.
Screen.Recording.2024-04-16.at.5.58.05.PM.mov
video description:
In our setup with 'jest snapshot' and 'jest ts' controllers, initiating coverage from the top-level menu only triggered the "jest snapshot" controller's runHandler.
Issue 2: Non-Accumulative Coverage Display
The test coverage display currently does not accumulate data across test runs. This is a concern because generating coverage information usually requires significant resources, and users could execute partial coverage runs. Without cumulative coverage, historical data is not preserved, which can reduce the feature's usability. Ideally, test coverage could mirror the behavior of test run status, which consistently updates and maintains the latest information, regardless of the test run sequence.
Screen.Recording.2024-04-16.at.6.14.36.PM.mov
video description:
Run coverage for "jest snapshot" => coverage info correctly displayed as expected.
Run coverage for "jest ts" => The "jest snapshot" coverage was replaced by the "jest ts" coverage in the panel. desired: both coverage info should be visible in the panel.
Run a regular test in "jest snapshot" => The coverage panel disappeared. desired: The coverage panel should still be visible.
Run "Test: Open Coverage" command didn't bring back the latest coverage panel either. desired: The command should bring back the latest coverage panel
VS Code version: Code 1.88.1 (e170252, 2024-04-10T17:42:52.765Z)
OS version: Darwin x64 23.4.0
Modes:
System Info
Item
Value
CPUs
Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz (12 x 3200)
The text was updated successfully, but these errors were encountered:
connectdotz
changed the title
[Testing/Coverage] top-level run coverage not working in monorepo projects and others
[Testing/Coverage] top-level run coverage not working in monorepo projects
Apr 16, 2024
connectdotz
changed the title
[Testing/Coverage] top-level run coverage not working in monorepo projects
[Testing] testing coverage API integration issues
Apr 16, 2024
I'm not sure this is safe to do. For test items we can do that since the state of a test item is inherently tied to its existence in the tree. That's not true for coverage: I could have a test run that generates coverage for a certain file, and if I move/rename/delete that file, the old coverage for the file would be "stuck" unless I cleared all previous coverage data. This could also confusingly influence coverage statistics if a user runs their entire test suite with coverage and their coverage numbers are influenced by data for files that no longer exist.
@connor4312, thank you for your insights on this matter. Here are a few thoughts in response:
I could have a test run that generates coverage for a certain file, and if I move/rename/delete that file, the old coverage for the file would be "stuck" unless I cleared all previous coverage data.
Considering that each FileCoverage corresponds to a source file, it seems feasible for the provider—or perhaps even the Test Explorer itself—to manage these through life-cycle events. For instance, coverage could be automatically removed or reset when files are moved, renamed, or deleted, assuming there's an API to communicate such changes back to VSCode.
This could also confusingly influence coverage statistics if a user runs their entire test suite with coverage and their coverage numbers are influenced by data for files that no longer exist.
Allowing providers to opt-in to maintaining FileCoverage integrity as described above could mitigate this concern. Additionally, it might be beneficial to implement a "reset" function or possibly use a collection like TestItemCollection to manage the coverage tree comprehensively.
At a minimum, I believe the coverage panel should maintain separate coverage information for each controller. Initiating a coverage run in one controller should not result in the loss of coverage data from another controller.
Thank you once again for considering these suggestions. I look forward to your thoughts on these potential improvements.
Type: Bug
As we integrate our extension, vscode-jest, with the newly available Testing Coverage API, we've identified some issues that notably impact usability. Below, I provide some video demonstrations from our development environment, followed by descriptions of each issue.
Issue 1: Incomplete Coverage Trigger in Monorepo Projects
In monorepo projects with multiple testControllers, initiating a top-level coverage run does not trigger all registered controllers. The coverage run is activated only for the first controller.
Screen.Recording.2024-04-16.at.5.58.05.PM.mov
video description:
In our setup with 'jest snapshot' and 'jest ts' controllers, initiating coverage from the top-level menu only triggered the "jest snapshot" controller's runHandler.
Issue 2: Non-Accumulative Coverage Display
The test coverage display currently does not accumulate data across test runs. This is a concern because generating coverage information usually requires significant resources, and users could execute partial coverage runs. Without cumulative coverage, historical data is not preserved, which can reduce the feature's usability. Ideally, test coverage could mirror the behavior of test run status, which consistently updates and maintains the latest information, regardless of the test run sequence.
Screen.Recording.2024-04-16.at.6.14.36.PM.mov
video description:
desired: both coverage info should be visible in the panel.
desired: The coverage panel should still be visible.
desired: The command should bring back the latest coverage panel
VS Code version: Code 1.88.1 (e170252, 2024-04-10T17:42:52.765Z)
OS version: Darwin x64 23.4.0
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Extensions (48)
(1 theme extensions excluded)
The text was updated successfully, but these errors were encountered: