mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
Pass --run-skipped through to package:test (#76133)
This commit is contained in:
parent
815976a8e4
commit
74b6ce9abb
|
@ -63,6 +63,10 @@ class TestCommand extends FlutterCommand {
|
|||
'Instructions for connecting with a debugger are printed to the '
|
||||
'console once the test has started.',
|
||||
)
|
||||
..addFlag('run-skipped',
|
||||
defaultsTo: false,
|
||||
help: 'Run skipped tests instead of skipping them.',
|
||||
)
|
||||
..addFlag('disable-service-auth-codes',
|
||||
defaultsTo: false,
|
||||
negatable: false,
|
||||
|
@ -309,6 +313,7 @@ class TestCommand extends FlutterCommand {
|
|||
randomSeed: stringArg('test-randomize-ordering-seed'),
|
||||
reporter: stringArg('reporter'),
|
||||
timeout: stringArg('timeout'),
|
||||
runSkipped: boolArg('run-skipped'),
|
||||
);
|
||||
|
||||
if (collector != null) {
|
||||
|
|
|
@ -50,6 +50,7 @@ abstract class FlutterTestRunner {
|
|||
String randomSeed,
|
||||
String reporter,
|
||||
String timeout,
|
||||
bool runSkipped = false,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -81,6 +82,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
|
|||
String randomSeed,
|
||||
String reporter,
|
||||
String timeout,
|
||||
bool runSkipped = false,
|
||||
}) async {
|
||||
// Configure package:test to use the Flutter engine for child processes.
|
||||
final String shellPath = globals.artifacts.getArtifactPath(Artifact.flutterTester);
|
||||
|
@ -108,6 +110,8 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
|
|||
...<String>['--tags', tags],
|
||||
if (excludeTags != null)
|
||||
...<String>['--exclude-tags', excludeTags],
|
||||
if (runSkipped)
|
||||
'--run-skipped',
|
||||
];
|
||||
if (web) {
|
||||
final String tempBuildDir = globals.fs.systemTempDirectory
|
||||
|
|
|
@ -106,6 +106,31 @@ void main() {
|
|||
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 {
|
||||
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
|
||||
|
||||
|
@ -190,6 +215,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
|
|||
@override List<String> extraFrontEndOptions,
|
||||
String reporter,
|
||||
String timeout,
|
||||
bool runSkipped = false,
|
||||
}) async {
|
||||
lastEnableObservatoryValue = enableObservatory;
|
||||
return exitCode;
|
||||
|
|
Loading…
Reference in a new issue