From 3b21c27c086310b6c0eb75305bce71c47726a33a Mon Sep 17 00:00:00 2001 From: Jesse <103135467+sealesj@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:05:33 -0400 Subject: [PATCH] Refactor android preview tool integration tests (#146518) Android preview tool integration test refactoring Part of https://github.com/flutter/flutter/issues/145482 --- ...ndroid_preview_integration_tool_tests.dart | 25 +++++++++++++++++++ dev/bots/test.dart | 17 ++----------- 2 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 dev/bots/suite_runners/run_android_preview_integration_tool_tests.dart diff --git a/dev/bots/suite_runners/run_android_preview_integration_tool_tests.dart b/dev/bots/suite_runners/run_android_preview_integration_tool_tests.dart new file mode 100644 index 0000000000..ff719d8ecf --- /dev/null +++ b/dev/bots/suite_runners/run_android_preview_integration_tool_tests.dart @@ -0,0 +1,25 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:io'; + +import 'package:path/path.dart' as path; + +import '../utils.dart'; + +Future androidPreviewIntegrationToolTestsRunner() async { + final String toolsPath = path.join(flutterRoot, 'packages', 'flutter_tools'); + + final List allTests = Directory(path.join(toolsPath, 'test', 'android_preview_integration.shard')) + .listSync(recursive: true).whereType() + .map((FileSystemEntity entry) => path.relative(entry.path, from: toolsPath)) + .where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList(); + + await runDartTest( + toolsPath, + forceSingleCore: true, + testPaths: selectIndexOfTotalSubshard(allTests), + collectMetrics: true, + ); +} diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 709b7c3b49..3d185103da 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -61,6 +61,7 @@ import 'package:path/path.dart' as path; import 'run_command.dart'; import 'suite_runners/run_add_to_app_life_cycle_tests.dart'; import 'suite_runners/run_analyze_tests.dart'; +import 'suite_runners/run_android_preview_integration_tool_tests.dart'; import 'suite_runners/run_customer_testing_tests.dart'; import 'suite_runners/run_docs_tests.dart'; import 'suite_runners/run_flutter_packages_tests.dart'; @@ -145,7 +146,7 @@ Future main(List args) async { 'tool_tests': _runToolTests, 'web_tool_tests': _runWebToolTests, 'tool_integration_tests': _runIntegrationToolTests, - 'android_preview_tool_integration_tests': _runAndroidPreviewIntegrationToolTests, + 'android_preview_tool_integration_tests': androidPreviewIntegrationToolTestsRunner, 'tool_host_cross_arch_tests': _runToolHostCrossArchTests, // All the unit/widget tests run using `flutter test --platform=chrome --web-renderer=html` 'web_tests': webTestsSuite.runWebHtmlUnitTests, @@ -388,20 +389,6 @@ Future _runIntegrationToolTests() async { ); } -Future _runAndroidPreviewIntegrationToolTests() async { - final List allTests = Directory(path.join(_toolsPath, 'test', 'android_preview_integration.shard')) - .listSync(recursive: true).whereType() - .map((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath)) - .where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList(); - - await runDartTest( - _toolsPath, - forceSingleCore: true, - testPaths: selectIndexOfTotalSubshard(allTests), - collectMetrics: true, - ); -} - Future _runToolTests() async { await selectSubshard({ 'general': _runGeneralToolTests,