Skip to content

Coverage Generation is broken for workspace packages #2570

@Skycoder42

Description

@Skycoder42

When executing tests with coverage collection in a child package of a workspace, the coverage is always empty.

Steps to Reproduce

  1. Create an empty dart package
  2. Create a child package below that package
  3. Set resolution: workspace on the child package and add workspace: [ "packages/<package-name>" ] to the parent
  4. Run dart pub get in the parent folder
  5. Run dart test --coverage=coverage in the child folder
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions