Skip to content

enable coverage collection for nested packages in a monorepo #101486

@uditrugman

Description

@uditrugman

Use case

I have a monorepo with several flutter / dart packages.

some of the tests are written in a client package as that helps to test more use cases.

the problem is that when running tests in a client package, code coverage does not collect code that runs in nested packages.

i could for example write additional tests in nested packages and merge their coverage into a single report. but running tests in a nested package does not always give enough context for the test.

consider an app with two packages: app1, app2, flutter_commons

now some of the tests in app1 use (indirectly) code that is located in "flutter_commons". but, when running with --coverage, that code is not covered and therefore is considered as not used.

the ability to collect code from flutter_commons when running tests in app1 would help...

Proposal

it should be possible to specify in the command line which nested packages should be collected.

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: tests"flutter test", flutter_test, or one of our testsc: proposalA detailed proposal for a change to Flutterdependency: dartDart team may need to help usr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-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