Unverified Commit 74b6ce9a authored by Danny Tuppeny's avatar Danny Tuppeny Committed by GitHub

Pass --run-skipped through to package:test (#76133)

parent 815976a8
...@@ -63,6 +63,10 @@ class TestCommand extends FlutterCommand { ...@@ -63,6 +63,10 @@ class TestCommand extends FlutterCommand {
'Instructions for connecting with a debugger are printed to the ' 'Instructions for connecting with a debugger are printed to the '
'console once the test has started.', 'console once the test has started.',
) )
..addFlag('run-skipped',
defaultsTo: false,
help: 'Run skipped tests instead of skipping them.',
)
..addFlag('disable-service-auth-codes', ..addFlag('disable-service-auth-codes',
defaultsTo: false, defaultsTo: false,
negatable: false, negatable: false,
...@@ -309,6 +313,7 @@ class TestCommand extends FlutterCommand { ...@@ -309,6 +313,7 @@ class TestCommand extends FlutterCommand {
randomSeed: stringArg('test-randomize-ordering-seed'), randomSeed: stringArg('test-randomize-ordering-seed'),
reporter: stringArg('reporter'), reporter: stringArg('reporter'),
timeout: stringArg('timeout'), timeout: stringArg('timeout'),
runSkipped: boolArg('run-skipped'),
); );
if (collector != null) { if (collector != null) {
......
...@@ -50,6 +50,7 @@ abstract class FlutterTestRunner { ...@@ -50,6 +50,7 @@ abstract class FlutterTestRunner {
String randomSeed, String randomSeed,
String reporter, String reporter,
String timeout, String timeout,
bool runSkipped = false,
}); });
} }
...@@ -81,6 +82,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner { ...@@ -81,6 +82,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
String randomSeed, String randomSeed,
String reporter, String reporter,
String timeout, String timeout,
bool runSkipped = false,
}) async { }) async {
// Configure package:test to use the Flutter engine for child processes. // Configure package:test to use the Flutter engine for child processes.
final String shellPath = globals.artifacts.getArtifactPath(Artifact.flutterTester); final String shellPath = globals.artifacts.getArtifactPath(Artifact.flutterTester);
...@@ -108,6 +110,8 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner { ...@@ -108,6 +110,8 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
...<String>['--tags', tags], ...<String>['--tags', tags],
if (excludeTags != null) if (excludeTags != null)
...<String>['--exclude-tags', excludeTags], ...<String>['--exclude-tags', excludeTags],
if (runSkipped)
'--run-skipped',
]; ];
if (web) { if (web) {
final String tempBuildDir = globals.fs.systemTempDirectory final String tempBuildDir = globals.fs.systemTempDirectory
......
...@@ -106,6 +106,31 @@ void main() { ...@@ -106,6 +106,31 @@ void main() {
Cache: () => FakeCache(), Cache: () => FakeCache(),
}); });
testUsingContext('Pipes run-skipped to package:test',
() async {
final FakePackageTest fakePackageTest = FakePackageTest();
final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest);
final CommandRunner<void> commandRunner =
createTestCommandRunner(testCommand);
await commandRunner.run(const <String>[
'test',
'--no-pub',
'--run-skipped',
'--',
'test/fake_test.dart',
]);
expect(
fakePackageTest.lastArgs,
contains('--run-skipped'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
Cache: () => FakeCache(),
});
testUsingContext('Pipes enable-observatory', () async { testUsingContext('Pipes enable-observatory', () async {
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
...@@ -190,6 +215,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner { ...@@ -190,6 +215,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
@override List<String> extraFrontEndOptions, @override List<String> extraFrontEndOptions,
String reporter, String reporter,
String timeout, String timeout,
bool runSkipped = false,
}) async { }) async {
lastEnableObservatoryValue = enableObservatory; lastEnableObservatoryValue = enableObservatory;
return exitCode; return exitCode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment