Skip to content

Commit 3b21c27

Browse files
authored
Refactor android preview tool integration tests (#146518)
Android preview tool integration test refactoring Part of flutter/flutter#145482
1 parent ca17034 commit 3b21c27

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'dart:io';
6+
7+
import 'package:path/path.dart' as path;
8+
9+
import '../utils.dart';
10+
11+
Future<void> androidPreviewIntegrationToolTestsRunner() async {
12+
final String toolsPath = path.join(flutterRoot, 'packages', 'flutter_tools');
13+
14+
final List<String> allTests = Directory(path.join(toolsPath, 'test', 'android_preview_integration.shard'))
15+
.listSync(recursive: true).whereType<File>()
16+
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: toolsPath))
17+
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
18+
19+
await runDartTest(
20+
toolsPath,
21+
forceSingleCore: true,
22+
testPaths: selectIndexOfTotalSubshard<String>(allTests),
23+
collectMetrics: true,
24+
);
25+
}

dev/bots/test.dart

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import 'package:path/path.dart' as path;
6161
import 'run_command.dart';
6262
import 'suite_runners/run_add_to_app_life_cycle_tests.dart';
6363
import 'suite_runners/run_analyze_tests.dart';
64+
import 'suite_runners/run_android_preview_integration_tool_tests.dart';
6465
import 'suite_runners/run_customer_testing_tests.dart';
6566
import 'suite_runners/run_docs_tests.dart';
6667
import 'suite_runners/run_flutter_packages_tests.dart';
@@ -145,7 +146,7 @@ Future<void> main(List<String> args) async {
145146
'tool_tests': _runToolTests,
146147
'web_tool_tests': _runWebToolTests,
147148
'tool_integration_tests': _runIntegrationToolTests,
148-
'android_preview_tool_integration_tests': _runAndroidPreviewIntegrationToolTests,
149+
'android_preview_tool_integration_tests': androidPreviewIntegrationToolTestsRunner,
149150
'tool_host_cross_arch_tests': _runToolHostCrossArchTests,
150151
// All the unit/widget tests run using `flutter test --platform=chrome --web-renderer=html`
151152
'web_tests': webTestsSuite.runWebHtmlUnitTests,
@@ -388,20 +389,6 @@ Future<void> _runIntegrationToolTests() async {
388389
);
389390
}
390391

391-
Future<void> _runAndroidPreviewIntegrationToolTests() async {
392-
final List<String> allTests = Directory(path.join(_toolsPath, 'test', 'android_preview_integration.shard'))
393-
.listSync(recursive: true).whereType<File>()
394-
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
395-
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
396-
397-
await runDartTest(
398-
_toolsPath,
399-
forceSingleCore: true,
400-
testPaths: selectIndexOfTotalSubshard<String>(allTests),
401-
collectMetrics: true,
402-
);
403-
}
404-
405392
Future<void> _runToolTests() async {
406393
await selectSubshard(<String, ShardRunner>{
407394
'general': _runGeneralToolTests,

0 commit comments

Comments
 (0)