From fc8865efb10025d04b4bd858e8ed084faec2a665 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Fri, 30 Jun 2023 07:10:47 -0400 Subject: [PATCH 1/4] [ci] Switch Dart unit tests to LUCI Enables the new LUCI Dart unit tests, and removes the Cirrus version. Part of https://github.com/flutter/flutter/issues/114373 --- .ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 5183c8800b3..6524401b9c1 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -93,10 +93,10 @@ targets: version_file: flutter_master.version - name: Linux dart_unit_test_shard_1 master - bringup: true # New target recipe: packages/packages timeout: 60 properties: + add_recipes_cq: "true" target_file: dart_unit_tests.yaml channel: master version_file: flutter_master.version @@ -104,10 +104,10 @@ targets: package_sharding: "--shardIndex 0 --shardCount 2" - name: Linux dart_unit_test_shard_2 master - bringup: true # New target recipe: packages/packages timeout: 60 properties: + add_recipes_cq: "true" target_file: dart_unit_tests.yaml channel: master version_file: flutter_master.version @@ -115,7 +115,6 @@ targets: package_sharding: "--shardIndex 1 --shardCount 2" - name: Linux dart_unit_test_shard_1 stable - bringup: true # New target recipe: packages/packages timeout: 60 properties: @@ -126,7 +125,6 @@ targets: package_sharding: "--shardIndex 0 --shardCount 2" - name: Linux dart_unit_test_shard_2 stable - bringup: true # New target recipe: packages/packages timeout: 60 properties: From f8daed8d49cb202bc8cd169c28a50bb3a8d43678 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Fri, 30 Jun 2023 07:11:52 -0400 Subject: [PATCH 2/4] Remove Cirrus version --- .cirrus.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 77b9903ed04..97490d59375 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -158,22 +158,6 @@ task: memory: 16G matrix: ### Platform-agnostic tasks ### - - name: dart_unit_tests - env: - matrix: - PACKAGE_SHARDING: "--shardIndex 0 --shardCount 2" - PACKAGE_SHARDING: "--shardIndex 1 --shardCount 2" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - unit_test_script: - - ./script/tool_runner.sh dart-test --exclude=script/configs/dart_unit_tests_exceptions.yaml - pathified_unit_test_script: - # Run tests with path-based dependencies to ensure that publishing - # the changes won't break tests of other packages in the repository - # that depend on it. - - ./script/tool_runner.sh make-deps-path-based --target-dependencies-with-non-breaking-updates - - $PLUGIN_TOOL_COMMAND dart-test --run-on-dirty-packages --exclude=script/configs/dart_unit_tests_exceptions.yaml - name: linux-custom_package_tests env: PATH: $PATH:/usr/local/bin From 67067449ed5178454e5c3a5a7b4e38aa3f1f8d9e Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 5 Jul 2023 11:58:18 -0400 Subject: [PATCH 3/4] Enable web --- .ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 40405201569..5b13aad2622 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -135,10 +135,10 @@ targets: package_sharding: "--shardIndex 1 --shardCount 2" - name: Linux_web web_dart_unit_test_shard_1 master - bringup: true # New target recipe: packages/packages timeout: 60 properties: + add_recipes_cq: "true" target_file: web_dart_unit_tests.yaml channel: master version_file: flutter_master.version @@ -146,10 +146,10 @@ targets: package_sharding: "--shardIndex 0 --shardCount 2" - name: Linux_web web_dart_unit_test_shard_2 master - bringup: true # New target recipe: packages/packages timeout: 60 properties: + add_recipes_cq: "true" target_file: web_dart_unit_tests.yaml channel: master version_file: flutter_master.version @@ -157,7 +157,6 @@ targets: package_sharding: "--shardIndex 1 --shardCount 2" - name: Linux_web web_dart_unit_test_shard_1 stable - bringup: true # New target recipe: packages/packages timeout: 60 properties: @@ -168,7 +167,6 @@ targets: package_sharding: "--shardIndex 0 --shardCount 2" - name: Linux_web web_dart_unit_test_shard_2 stable - bringup: true # New target recipe: packages/packages timeout: 60 properties: From 9d8c383e07aef3dfa77b87821d7760645540104a Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 5 Jul 2023 12:41:36 -0400 Subject: [PATCH 4/4] Fix invocation of flutter test for VM mode --- script/tool/lib/src/dart_test_command.dart | 4 +++- script/tool/test/dart_test_command_test.dart | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/script/tool/lib/src/dart_test_command.dart b/script/tool/lib/src/dart_test_command.dart index 5c997b39a91..cd564a84060 100644 --- a/script/tool/lib/src/dart_test_command.dart +++ b/script/tool/lib/src/dart_test_command.dart @@ -118,7 +118,9 @@ class DartTestCommand extends PackageLoopingCommand { 'test', '--color', if (experiment.isNotEmpty) '--enable-experiment=$experiment', - if (platform != null) '--platform=$platform', + // Flutter defaults to VM mode (under a different name) and explicitly + // setting it is deprecated, so pass nothing in that case. + if (platform != null && platform != 'vm') '--platform=$platform', ], workingDir: package.directory, ); diff --git a/script/tool/test/dart_test_command_test.dart b/script/tool/test/dart_test_command_test.dart index e8643f34823..5752d7439eb 100644 --- a/script/tool/test/dart_test_command_test.dart +++ b/script/tool/test/dart_test_command_test.dart @@ -231,6 +231,24 @@ void main() { ])); }); + test('converts --platform=vm to no argument for flutter test', () async { + final RepositoryPackage plugin = createFakePlugin( + 'some_plugin', + packagesDir, + extraFiles: ['test/empty_test.dart'], + ); + + await runCapturingPrint(runner, ['dart-test', '--platform=vm']); + + expect( + processRunner.recordedCalls, + orderedEquals([ + ProcessCall(getFlutterCommand(mockPlatform), + const ['test', '--color'], plugin.path), + ]), + ); + }); + test('runs in Chrome when requested for Flutter package', () async { final RepositoryPackage package = createFakePackage( 'a_package',