Skip to content

When using workspaces the code coverage is broken #159390

@rekire

Description

@rekire

Steps to reproduce

  1. Create a project with at least one test e.g. in <root>/demo/test/test.dart
  2. Run cd demo && flutter test --coverage
  3. The generated <root>/demo/coverage/lcov.info is not empty
  4. Now add a workspace
  5. Run flutter test demo/test --coverage
  6. The generated <root>/coverage/lcov.info is empty

Expected results

I expect coverage data when I run the tests

Actual results

The coverage report file is empty

Code sample

See my autologin_plugin commit. I have right now no minimal sample. Check the CI output

Logs

Logs
$ flutter test autologin/test --coverage       
00:01 +3: All tests passed!
$ du -k coverage/lcov.info
0       coverage/lcov.info

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.5, on macOS 15.1.1 24B91 darwin-arm64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Community Edition (version 2024.3)
[✓] VS Code (version 1.92.2)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsfound in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions