mirror of
https://github.com/flutter/flutter
synced 2024-09-12 21:01:59 +00:00
Refactor android preview tool integration tests (#146518)
Android preview tool integration test refactoring Part of https://github.com/flutter/flutter/issues/145482
This commit is contained in:
parent
ca170341c3
commit
3b21c27c08
|
@ -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<void> androidPreviewIntegrationToolTestsRunner() async {
|
||||
final String toolsPath = path.join(flutterRoot, 'packages', 'flutter_tools');
|
||||
|
||||
final List<String> allTests = Directory(path.join(toolsPath, 'test', 'android_preview_integration.shard'))
|
||||
.listSync(recursive: true).whereType<File>()
|
||||
.map<String>((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<String>(allTests),
|
||||
collectMetrics: true,
|
||||
);
|
||||
}
|
|
@ -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<void> main(List<String> 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<void> _runIntegrationToolTests() async {
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> _runAndroidPreviewIntegrationToolTests() async {
|
||||
final List<String> allTests = Directory(path.join(_toolsPath, 'test', 'android_preview_integration.shard'))
|
||||
.listSync(recursive: true).whereType<File>()
|
||||
.map<String>((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<String>(allTests),
|
||||
collectMetrics: true,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _runToolTests() async {
|
||||
await selectSubshard(<String, ShardRunner>{
|
||||
'general': _runGeneralToolTests,
|
||||
|
|
Loading…
Reference in a new issue