-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Description
Both dart test
and flutter test
support a --run-skipped
, which is intended to mean "run tests otherwise that would be skipped". Ideally it would be used to temporarily (either locally or on a bringup: true
task) run tests that are flaking or failing for reasons that we don't want to affect the mainline tree or development experience.
For example:
cd flutter/packages/flutter_tools
dart test test/general.shard --run-skipped
However, sometimes we use skip to mean the test can't run in this configuration, such as:
test('...', () {
// ...
}, skip: !Platform.isWindows ? 'Test only runs on windows' : false);
In that case, --run-skipped
not only can never work, but now the feature cannot be used across the codebase.
For Dart (dart test
-instrumented) tests, we could use @TestOn
instead:
@TestOn('windows')
library;
// ...
void main() {
test('...', () {
});
}
However, my understanding is this feature does not work in flutter test
, so it would not work everywhere/we would diverge.
It would be awesome to have some instruction, outside of commenting code in/out, how we could run skipped tests but also not run tests that are never intended to run in a given configuration or platform. Ideally (to me) that would mean using --run-skipped
and perhaps using/supporting @TestOn
broadly, but that is obviously more work.