Skip to content

Commit

Permalink
[ci] Enable LUCI Dart unit tests (#4378)
Browse files Browse the repository at this point in the history
Enables the new LUCI Dart unit tests.

There is no corresponding Cirrus removal because that test was
accidentally removed early in
#4352.

Part of flutter/flutter#114373
  • Loading branch information
stuartmorgan authored Jul 6, 2023
1 parent 14d9a21 commit 771ec9b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
12 changes: 4 additions & 8 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,29 +93,28 @@ 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
cores: "32"
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
cores: "32"
package_sharding: "--shardIndex 1 --shardCount 2"

- name: Linux dart_unit_test_shard_1 stable
bringup: true # New target
recipe: packages/packages
timeout: 60
properties:
Expand All @@ -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:
Expand All @@ -137,29 +135,28 @@ 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
cores: "32"
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
cores: "32"
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:
Expand All @@ -170,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:
Expand Down
4 changes: 3 additions & 1 deletion script/tool/lib/src/dart_test_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
18 changes: 18 additions & 0 deletions script/tool/test/dart_test_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: <String>['test/empty_test.dart'],
);

await runCapturingPrint(runner, <String>['dart-test', '--platform=vm']);

expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(getFlutterCommand(mockPlatform),
const <String>['test', '--color'], plugin.path),
]),
);
});

test('runs in Chrome when requested for Flutter package', () async {
final RepositoryPackage package = createFakePackage(
'a_package',
Expand Down

0 comments on commit 771ec9b

Please sign in to comment.