Skip to content

[packages] Add file-based test filtering #136394

Closed
flutter/packages
#8928

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.

Activity

  1. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    p: toolingAffects the flutter_plugin_tools package
    packageflutter/packages repository. See also p: labels.
    P2Important issues not at the top of the work list
    fyi-ecosystemFor the attention of Ecosystem team
    on Oct 11, 2023
  2. flutter-triage-bot commented on Oct 13, 2023

    @flutter-triage-bot

    The fyi-ecosystem label is redundant with the team-ecosystem label.

  3. github-actions commented on May 2, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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