Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ task:
memory: 12G
matrix:
### Android tasks ###
- name: build-apks+java-test+firebase-test-lab
- name: build-apks+android-unit+firebase-test-lab
env:
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
Expand All @@ -144,13 +144,15 @@ task:
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/tool_runner.sh build-examples --apk
java_test_script:
native_unit_test_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/tool_runner.sh java-test # must come after apk build
# Native integration tests are handled by firebase-test-lab below, so
# only run unit tests.
- ./script/tool_runner.sh native-test --android --no-integration # must come after apk build
firebase_test_lab_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
Expand Down Expand Up @@ -223,12 +225,12 @@ task:
- ./script/tool_runner.sh build-examples --ios
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --ios
xctest_script:
- ./script/tool_runner.sh xctest --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
native_test_script:
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
drive_script:
# `drive-examples` contains integration tests, which changes the UI of the application.
# This UI change sometimes affects `xctest`.
# So we run `drive-examples` after `xctest`, changing the order will result ci failure.
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
- ./script/tool_runner.sh drive-examples --ios --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
### macOS desktop tasks ###
- name: build_all_plugins_macos
Expand All @@ -253,7 +255,7 @@ task:
- ./script/tool_runner.sh build-examples --macos
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --macos
xctest_script:
- ./script/tool_runner.sh xctest --macos --exclude $PLUGINS_TO_EXCLUDE_MACOS_XCTESTS
native_test_script:
- ./script/tool_runner.sh native-test --macos --exclude $PLUGINS_TO_EXCLUDE_MACOS_XCTESTS
drive_script:
- ./script/tool_runner.sh drive-examples --macos
10 changes: 9 additions & 1 deletion script/tool/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

- Added an `xctest` flag to select specific test targets, to allow running only
unit tests or integration tests.
- Split Xcode analysis out of `xctest` and into a new `xcode-analyze` command.
- **Breaking change**: Split Xcode analysis out of `xctest` and into a new
`xcode-analyze` command.
- **Breaking change**: Replaced `xctest` with a new `native-test` command that
will eventually be able to run native unit and integration tests for all
platforms.
- Adds the ability to disable test types via `--no-unit` or
`--no-integration`.
- **Breaking change**: Replaced `java-test` with Android unit test support for
the new `native-test` command.

## 0.4.1

Expand Down
4 changes: 2 additions & 2 deletions script/tool/lib/src/common/package_looping_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ abstract class PackageLoopingCommand extends PluginCommand {
final List<String> components = p.posix.split(packageName);
// For the common federated plugin pattern of `foo/foo_subpackage`, drop
// the first part since it's not useful.
if (components.length == 2 &&
if (components.length >= 2 &&
components[1].startsWith('${components[0]}_')) {
packageName = components[1];
packageName = p.posix.joinAll(components.sublist(1));
}
return packageName;
}
Expand Down
78 changes: 0 additions & 78 deletions script/tool/lib/src/java_test_command.dart

This file was deleted.

8 changes: 3 additions & 5 deletions script/tool/lib/src/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ import 'create_all_plugins_app_command.dart';
import 'drive_examples_command.dart';
import 'firebase_test_lab_command.dart';
import 'format_command.dart';
import 'java_test_command.dart';
import 'license_check_command.dart';
import 'lint_podspecs_command.dart';
import 'list_command.dart';
import 'native_test_command.dart';
import 'publish_check_command.dart';
import 'publish_plugin_command.dart';
import 'pubspec_check_command.dart';
import 'test_command.dart';
import 'version_check_command.dart';
import 'xcode_analyze_command.dart';
import 'xctest_command.dart';

void main(List<String> args) {
const FileSystem fileSystem = LocalFileSystem();
Expand All @@ -51,17 +50,16 @@ void main(List<String> args) {
..addCommand(DriveExamplesCommand(packagesDir))
..addCommand(FirebaseTestLabCommand(packagesDir))
..addCommand(FormatCommand(packagesDir))
..addCommand(JavaTestCommand(packagesDir))
..addCommand(LicenseCheckCommand(packagesDir))
..addCommand(LintPodspecsCommand(packagesDir))
..addCommand(ListCommand(packagesDir))
..addCommand(NativeTestCommand(packagesDir))
..addCommand(PublishCheckCommand(packagesDir))
..addCommand(PublishPluginCommand(packagesDir))
..addCommand(PubspecCheckCommand(packagesDir))
..addCommand(TestCommand(packagesDir))
..addCommand(VersionCheckCommand(packagesDir))
..addCommand(XcodeAnalyzeCommand(packagesDir))
..addCommand(XCTestCommand(packagesDir));
..addCommand(XcodeAnalyzeCommand(packagesDir));

commandRunner.run(args).catchError((Object e) {
final ToolExit toolExit = e as ToolExit;
Expand Down
Loading