Skip to content

[packages] Add file-based test filtering #136394

@stuartmorgan-g

Description

@stuartmorgan-g

Currently all of the CI test filtering is based on packages changed. This helps a lot, but there are categories of changes within a package where we run a lot of tests that we could easily determine to be unnecessary. It would be useful to add a generic utility to the command system in the repo tooling where commands could explicitly list files that cannot affect their output (the reverse would be simpler, but would be much more likely to accidentally not run tests, and we want to minimize the possibility of that).

Some obvious examples:

  • README.md changes can only affect README validations.
  • CHANGELOG.md changes can only affect changelog/version validations.
  • pubspec.yaml changes that only affect the version line (we'll need to special-case this, but if we don't the whole system would be pretty pointless since almost all changes bump the version) only affect version and pubspec validations.
  • test/*.dart test changes can't affect integration tests or native tests.
  • integration_test/*.dart changes can't affect native unit tests or Dart unit tests

The generic support would take a list from the command and validate it against every changed file, and then skip tests for any package where everything matched.

We could skip expensive tests like integration tests for all of those cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.p: toolingAffects the flutter_plugin_tools packagepackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions