forked from firka/flutter
Add retry flag to flutter_test (#125851)
Closes https://github.com/flutter/flutter/issues/125920 I will add tests, polish code, etc, if this change looks generally OK!
This commit is contained in:
@@ -185,8 +185,8 @@ void test(
|
||||
/// should explain why the group is skipped; this reason will be printed instead
|
||||
/// of running the group's tests.
|
||||
@isTestGroup
|
||||
void group(Object description, void Function() body, { dynamic skip }) {
|
||||
_declarer.group(description.toString(), body, skip: skip);
|
||||
void group(Object description, void Function() body, { dynamic skip, int? retry }) {
|
||||
_declarer.group(description.toString(), body, skip: skip, retry: retry);
|
||||
}
|
||||
|
||||
/// Registers a function to be run before tests.
|
||||
|
||||
@@ -130,6 +130,7 @@ void testWidgets(
|
||||
bool semanticsEnabled = true,
|
||||
TestVariant<Object?> variant = const DefaultTestVariant(),
|
||||
dynamic tags,
|
||||
int? retry,
|
||||
}) {
|
||||
assert(variant.values.isNotEmpty, 'There must be at least one value to test in the testing variant.');
|
||||
final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -174,6 +175,7 @@ void testWidgets(
|
||||
skip: skip,
|
||||
timeout: timeout ?? binding.defaultTestTimeout,
|
||||
tags: tags,
|
||||
retry: retry,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user