Skip to content

flutter test --coverage and flutter test --watch #4719

Description

@Hixie
  • flutter test --coverage should write:
    • two identical files, a base file and a coverage file,
    • plus a file that lists the last modification times of all the test files.
  • flutter test --watch should watch the file system of the current package.
    • If a file under lib/ changes, it should rerun all the tests and create a new base file and timestamp file.
    • If a file under 'test/' changes, it should rerun all the tests with timestamps that indicate the file changed since the base file was written.
    • after flutter test --watch runs some tests, it should merge the new coverage with the base file and overwrite the coverage file.
  • We should document the caveats here:
    • Tests that have expectations or that depend on non-test files won't be run when those files change.
    • Reducing coverage won't be noticed.
    • Coverage is per-line and hitting any expression on the line counts as covering the line.

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: new featureNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions