Skip to content

Supporting tags when running dart path/to/my_package/test/my_test.dart #2531

@dcharkes

Description

@dcharkes

In https://github.com/dart-lang/native, we use package:test. But these tests also roll into the Dart SDK and run there with the Dart SDKs test.py.

We can only run a subset of tests on the Dart SDK CI, due to having no cross compilation tools available. We run the full set of tests on the GitHub CI. The compilers on the GitHub CI and Dart SDK CI are not the same, so we want to run in both places for coverage.

Now, we've been managing the set of tests that runs on the Dart CI via status files in the Dart CI, but this requires updating those files on rolls.

Instead, we'd like to use tags. So we'd tag all our cross compilation tests with cross-compilation for example.

However, since test.py is not package:tests bin/ runner, there's no way to pass --exclude-tags.

An idea on how to make this work:

  • Put the exclude tags in environment variables. And one of the the following:
    • make test/group read those env variables if not run via package:test
    • enable setupAll to set tags, so that all the test and group calls after it in the file respect those tags instead
    • add a new configureTestRunner(...) method that can set all the variables that would be usually set via the package:test command-line arguments.

Doing something in this direction would also enable configuring what to run in a test file when running it from source in the debugger.

@natebosch @jakemac53 Any thoughts or ideas? Is there already a way to do this?

cc @goderbauer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions