Skip to content

[packages] Test infra: Skipping all tests for a package is considered a failure #191495

Closed
flutter/packages
#12574

Description

@elliette

Context: I'm trying to exclude the material_ui/tool/gen_defaults tests from running on web, because gen_defaults is a CLI utility.

I've trying using a @TestOn annotation and a dart_test.yaml file to exclude them. In both cases, although the tests are correctly skipped on web, they get reported as a failure.

See logs:

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8672917860016068481/+/u/Run_package_tests/Dart_unit_tests_-_web/stdout?format=raw

Expected behavior: if all tests for a package are skipped for a platform, it is not a failure
Actual behavior: if all tests for a package are skipped for a platform, it is a failure

Related: #191447

Activity

  1. stuartmorgan-g commented on Aug 24, 2026

    @stuartmorgan-g
    Contributor

    Hm, this should have worked. We've run into this exact scenario before, where we want to skip all tests just on web, but dart/flutter test itself returns a failure code when all tests are skipped. At the time at least I didn't see a way to disable that behavior, or to robustly detect it (i.e., a unique and documented return code that we could ignore). Instead I implemented a rudimentary parser for dart_test.yaml to identify tests that are intended to be web-only or non-web only, and then skip trying to run them.

    You could re-test locally with some logging added to that part of the tooling and see why it didn't work. Maybe we need to actually parse the yaml file as yaml, and implement better matching on the values?

  2. stuartmorgan-g commented on Aug 24, 2026

    @stuartmorgan-g
    Contributor

    Ugh, I see the problem. You used quotes on the value, and I didn't account for that.

    This is a classic case of:

    Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.

    If I'd just YAML-parsed this in the first place, this would have worked when you tried it. I'll fix the tool.

  3. github-actions commented on Sep 7, 2026

    @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 Sep 7, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions