Unverified Commit 2832611d authored by Jesse's avatar Jesse Committed by GitHub

Refactor add_to_app_life_cycle_tests (#145546)

Refactor add_to_app_life_cycle_tests in order to reduce testing logic in test.dart, create a suite_runners directory and allow for later implementing package:test onto add_to_app_life_cycle_tests

Part of https://github.com/flutter/flutter/issues/145482
parent b05937d3
// 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' show Platform;
import 'package:path/path.dart' as path;
import '../run_command.dart';
import '../utils.dart';
Future<void> addToAppLifeCycleRunner(String flutterRoot) async {
if (Platform.isMacOS) {
printProgress('${green}Running add-to-app life cycle iOS integration tests$reset...');
final String addToAppDir = path.join(flutterRoot, 'dev', 'integration_tests', 'ios_add2app_life_cycle');
await runCommand('./build_and_test.sh',
<String>[],
workingDirectory: addToAppDir,
);
} else {
throw Exception('Only iOS has add-to-add lifecycle tests at this time.');
}
}
......@@ -66,6 +66,7 @@ import 'package:process/process.dart';
import 'browser.dart';
import 'run_command.dart';
import 'service_worker_test.dart';
import 'suite_runners/run_add_to_app_life_cycle_tests.dart';
import 'tool_subsharding.dart';
import 'utils.dart';
......@@ -230,7 +231,7 @@ Future<void> main(List<String> args) async {
printProgress('Running task: ${Platform.environment[CIRRUS_TASK_NAME]}');
}
await selectShard(<String, ShardRunner>{
'add_to_app_life_cycle_tests': _runAddToAppLifeCycleTests,
'add_to_app_life_cycle_tests': () => addToAppLifeCycleRunner(flutterRoot),
'build_tests': _runBuildTests,
'framework_coverage': _runFrameworkCoverage,
'framework_tests': _runFrameworkTests,
......@@ -790,19 +791,6 @@ Future<void> _flutterBuildDart2js(String relativePathToApplication, String targe
);
}
Future<void> _runAddToAppLifeCycleTests() async {
if (Platform.isMacOS) {
printProgress('${green}Running add-to-app life cycle iOS integration tests$reset...');
final String addToAppDir = path.join(flutterRoot, 'dev', 'integration_tests', 'ios_add2app_life_cycle');
await runCommand('./build_and_test.sh',
<String>[],
workingDirectory: addToAppDir,
);
} else {
printProgress('${yellow}Skipped on this platform (only iOS has add-to-add lifecycle tests at this time).$reset');
}
}
Future<void> _runFrameworkTests() async {
final List<String> trackWidgetCreationAlternatives = <String>['--track-widget-creation', '--no-track-widget-creation'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment