[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
[flutter_plugin_tools] Remove xctest's --skip (#4022)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmorgan committed Jun 7, 2021
1 parent 464303f commit 04f8ef7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
4 changes: 4 additions & 0 deletions script/tool/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0

- Remove `xctest`'s `--skip`, which is redundant with `--ignore`.

## 0.1.4

- Add a `pubspec-check` command
Expand Down
4 changes: 2 additions & 2 deletions script/tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dart pub global run flutter_plugin_tools <args>
## Commands

Run with `--help` for a full list of commands and arguments, but the
following shows a number of common commands.
following shows a number of common commands being run for a specific plugin.

All examples assume running from source; see above for running the
published version instead.
Expand Down Expand Up @@ -79,7 +79,7 @@ dart run ./script/tool/lib/src/main.dart test --plugins plugin_name

```sh
cd <repository root>
dart run ./script/tool/lib/src/main.dart xctest --target RunnerUITests --skip <plugins_to_skip>
dart run ./script/tool/lib/src/main.dart xctest --plugins plugin_name
```

### Publish a Release
Expand Down
10 changes: 0 additions & 10 deletions script/tool/lib/src/xctest_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:path/path.dart' as p;
import 'common.dart';

const String _kiOSDestination = 'ios-destination';
const String _kSkip = 'skip';
const String _kXcodeBuildCommand = 'xcodebuild';
const String _kXCRunCommand = 'xcrun';
const String _kFoundNoSimulatorsMessage =
Expand All @@ -36,8 +35,6 @@ class XCTestCommand extends PluginCommand {
'this is passed to the `-destination` argument in xcodebuild command.\n'
'See https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-UNIT for details on how to specify the destination.',
);
argParser.addMultiOption(_kSkip,
help: 'Plugins to skip while running this command. \n');
}

@override
Expand All @@ -59,8 +56,6 @@ class XCTestCommand extends PluginCommand {
destination = 'id=$simulatorId';
}

final List<String> skipped = getStringListArg(_kSkip);

final List<String> failingPackages = <String>[];
await for (final Directory plugin in getPlugins()) {
// Start running for package.
Expand All @@ -72,11 +67,6 @@ class XCTestCommand extends PluginCommand {
print('\n\n');
continue;
}
if (skipped.contains(packageName)) {
print('$packageName was skipped with the --skip flag.');
print('\n\n');
continue;
}
for (final Directory example in getExamplesForPlugin(plugin)) {
// Running tests and static analyzer.
print('Running tests and analyzer for $packageName ...');
Expand Down
2 changes: 1 addition & 1 deletion script/tool/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_plugin_tools
description: Productivity utils for flutter/plugins and flutter/packages
repository: https://github.com/flutter/plugins/tree/master/script/tool
version: 0.1.4
version: 0.2.0

dependencies:
args: ^2.1.0
Expand Down
7 changes: 3 additions & 4 deletions script/tool/test/xctest_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ final Map<String, dynamic> _kDeviceListMap = <String, dynamic>{

void main() {
const String _kDestination = '--ios-destination';
const String _kSkip = '--skip';

group('test xctest_command', () {
FileSystem fileSystem;
Expand Down Expand Up @@ -121,7 +120,7 @@ void main() {
expect(processRunner.recordedCalls, orderedEquals(<ProcessCall>[]));
});

test('running with correct destination, skip 1 plugin', () async {
test('running with correct destination, exclude 1 plugin', () async {
final Directory pluginDirectory1 =
createFakePlugin('plugin1', packagesDir,
withExtraFiles: <List<String>>[
Expand Down Expand Up @@ -151,11 +150,11 @@ void main() {
'xctest',
_kDestination,
'foo_destination',
_kSkip,
'--exclude',
'plugin1'
]);

expect(output, contains('plugin1 was skipped with the --skip flag.'));
expect(output, isNot(contains('Successfully ran xctest for plugin1')));
expect(output, contains('Successfully ran xctest for plugin2'));

expect(
Expand Down

0 comments on commit 04f8ef7

Please sign in to comment.