Unverified Commit 5ec56207 authored by Jesse's avatar Jesse Committed by GitHub

Refactor skp_generator_tests (#145871)

Refactor skp_generator_tests suite in order to reduce testing logic in test.dart and allow for later implementing package:test onto the existing skp_generator_tests tests

Part of https://github.com/flutter/flutter/issues/145482
parent 67271f69
// 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 '../run_command.dart';
import '../utils.dart';
/// Runs the skp_generator from the flutter/tests repo.
///
/// See also the customer_tests shard.
///
/// Generated SKPs are ditched, this just verifies that it can run without failure.
Future<void> skpGeneratorTestsRunner() async {
printProgress('${green}Running skp_generator from flutter/tests$reset');
final Directory checkout = Directory.systemTemp.createTempSync('flutter_skp_generator.');
await runCommand(
'git',
<String>[
'-c',
'core.longPaths=true',
'clone',
'https://github.com/flutter/tests.git',
'.',
],
workingDirectory: checkout.path,
);
await runCommand(
'./build.sh',
const <String>[],
workingDirectory: path.join(checkout.path, 'skp_generator'),
);
}
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:core' as system show print; import 'dart:core' as system show print;
import 'dart:core' hide print; import 'dart:core' hide print;
import 'dart:io' as io;
import 'dart:io' as system show exit; import 'dart:io' as system show exit;
import 'dart:io' hide exit; import 'dart:io' hide exit;
import 'dart:io' as io;
import 'dart:math' as math; import 'dart:math' as math;
import 'dart:typed_data'; import 'dart:typed_data';
...@@ -65,6 +65,7 @@ import 'package:process/process.dart'; ...@@ -65,6 +65,7 @@ import 'package:process/process.dart';
import 'run_command.dart'; import 'run_command.dart';
import 'suite_runners/run_add_to_app_life_cycle_tests.dart'; import 'suite_runners/run_add_to_app_life_cycle_tests.dart';
import 'suite_runners/run_skp_generator_tests.dart';
import 'suite_runners/run_web_long_running_tests.dart'; import 'suite_runners/run_web_long_running_tests.dart';
import 'tool_subsharding.dart'; import 'tool_subsharding.dart';
import 'utils.dart'; import 'utils.dart';
...@@ -248,7 +249,7 @@ Future<void> main(List<String> args) async { ...@@ -248,7 +249,7 @@ Future<void> main(List<String> args) async {
// All web integration tests // All web integration tests
'web_long_running_tests': () => webLongRunningTestsRunner(flutterRoot), 'web_long_running_tests': () => webLongRunningTestsRunner(flutterRoot),
'flutter_plugins': _runFlutterPackagesTests, 'flutter_plugins': _runFlutterPackagesTests,
'skp_generator': _runSkpGeneratorTests, 'skp_generator': skpGeneratorTestsRunner,
'realm_checker': _runRealmCheckerTest, 'realm_checker': _runRealmCheckerTest,
'customer_testing': _runCustomerTesting, 'customer_testing': _runCustomerTesting,
'analyze': _runAnalyze, 'analyze': _runAnalyze,
...@@ -1735,32 +1736,6 @@ Future<bool> hasExpectedEntitlements( ...@@ -1735,32 +1736,6 @@ Future<bool> hasExpectedEntitlements(
return passes; return passes;
} }
/// Runs the skp_generator from the flutter/tests repo.
///
/// See also the customer_tests shard.
///
/// Generated SKPs are ditched, this just verifies that it can run without failure.
Future<void> _runSkpGeneratorTests() async {
printProgress('${green}Running skp_generator from flutter/tests$reset');
final Directory checkout = Directory.systemTemp.createTempSync('flutter_skp_generator.');
await runCommand(
'git',
<String>[
'-c',
'core.longPaths=true',
'clone',
'https://github.com/flutter/tests.git',
'.',
],
workingDirectory: checkout.path,
);
await runCommand(
'./build.sh',
<String>[ ],
workingDirectory: path.join(checkout.path, 'skp_generator'),
);
}
Future<void> _runRealmCheckerTest() async { Future<void> _runRealmCheckerTest() async {
final String engineRealm = File(engineRealmFile).readAsStringSync().trim(); final String engineRealm = File(engineRealmFile).readAsStringSync().trim();
if (engineRealm.isNotEmpty) { if (engineRealm.isNotEmpty) {
......
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