When executing tests with coverage collection in a child package of a workspace, the coverage is always empty.
Steps to Reproduce
- Create an empty dart package
- Create a child package below that package
- Set
resolution: workspace on the child package and add workspace: [ "packages/<package-name>" ] to the parent
- Run
dart pub get in the parent folder
- Run
dart test --coverage=coverage in the child folder
- Inspecting the created coverage files, you will see that they will all be empty like this:
{"type":"CodeCoverage","coverage":[]}
The same happens when using the new --coverage-path option.
Simply removing resolution: workspace and running dart pub get again will make it work again, but that is of course not a solution.
Sample project: cov_test_ws.zip
System Information
Dart version: 3.10.1
package:test Version: 1.25.6
Environments: Any. Happens in the CI and locally, for windows, macos and linux
When executing tests with coverage collection in a child package of a workspace, the coverage is always empty.
Steps to Reproduce
resolution: workspaceon the child package and addworkspace: [ "packages/<package-name>" ]to the parentdart pub getin the parent folderdart test --coverage=coveragein the child folder{"type":"CodeCoverage","coverage":[]}The same happens when using the new
--coverage-pathoption.Simply removing
resolution: workspaceand runningdart pub getagain will make it work again, but that is of course not a solution.Sample project: cov_test_ws.zip
System Information
Dart version: 3.10.1
package:test Version: 1.25.6
Environments: Any. Happens in the CI and locally, for windows, macos and linux