[CFE] Make missing scripts easier to spot in the weekly run
With the move from test/fast/strong_suite.dart to test/strong_suite.dart
for instance the weekly test wasn't updated. This caused the weekly run
to fail (good - then we can fix it!), but it wasn't easy to find why it
failed in the long long log. This makes it more visible at the end,
making it more like if there had been any other failure.
Change-Id: I521bc4a5ef011c687eb7bbffb38d665e0108f760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395881
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
diff --git a/pkg/front_end/test/weekly_tester.dart b/pkg/front_end/test/weekly_tester.dart
index 97a8194..a66f9f3 100644
--- a/pkg/front_end/test/weekly_tester.dart
+++ b/pkg/front_end/test/weekly_tester.dart
@@ -4,7 +4,7 @@
import 'dart:async' show Future;
import 'dart:convert' show LineSplitter, utf8;
-import 'dart:io' show File, Platform, Process, exitCode;
+import 'dart:io' show File, Platform, Process;
Future<void> main(List<String> args) async {
// General idea: Launch - in separate processes - whatever we want to run
@@ -18,14 +18,18 @@
"\n\n");
List<WrappedProcess> startedProcesses = [];
+ List<String> missingScripts = [];
+ void noteMissingScript(String message) {
+ missingScripts.add(message);
+ print(message);
+ }
{
// Very slow: Leak-test.
Uri leakTester =
Platform.script.resolve("flutter_gallery_leak_tester.dart");
if (!new File.fromUri(leakTester).existsSync()) {
- exitCode = 1;
- print("Couldn't find $leakTester");
+ noteMissingScript("Couldn't find $leakTester");
} else {
// The tools/bots/flutter/compile_flutter.sh script passes `--path`
// --- we'll just pass everything along.
@@ -43,8 +47,7 @@
// Weak suite with fuzzing.
Uri weakSuite = Platform.script.resolve("weak_suite.dart");
if (!new File.fromUri(weakSuite).existsSync()) {
- exitCode = 1;
- print("Couldn't find $weakSuite");
+ noteMissingScript("Couldn't find $weakSuite");
} else {
startedProcesses.add(await run(
[
@@ -60,8 +63,7 @@
// Strong suite with fuzzing.
Uri strongSuite = Platform.script.resolve("strong_suite.dart");
if (!new File.fromUri(strongSuite).existsSync()) {
- exitCode = 1;
- print("Couldn't find $strongSuite");
+ noteMissingScript("Couldn't find $strongSuite");
} else {
startedProcesses.add(await run(
[
@@ -78,8 +80,7 @@
Uri incrementalLeakTest =
Platform.script.resolve("vm_service_for_leak_detection.dart");
if (!new File.fromUri(incrementalLeakTest).existsSync()) {
- exitCode = 1;
- print("Couldn't find $incrementalLeakTest");
+ noteMissingScript("Couldn't find $incrementalLeakTest");
} else {
startedProcesses.add(await run([
incrementalLeakTest.toString(),
@@ -90,11 +91,9 @@
{
// Expression suite with fuzzing.
- Uri expressionSuite =
- Platform.script.resolve("expression_suite.dart");
+ Uri expressionSuite = Platform.script.resolve("expression_suite.dart");
if (!new File.fromUri(expressionSuite).existsSync()) {
- exitCode = 1;
- print("Couldn't find $expressionSuite");
+ noteMissingScript("Couldn't find $expressionSuite");
} else {
startedProcesses.add(await run(
[
@@ -107,9 +106,11 @@
}
// Wait for everything to finish.
+ bool shouldThrow = false;
List<int> exitCodes =
await Future.wait(startedProcesses.map((e) => e.process.exitCode));
if (exitCodes.where((e) => e != 0).isNotEmpty) {
+ shouldThrow = true;
print("\n\nFound failures!:\n");
// At least one failed.
for (WrappedProcess p in startedProcesses) {
@@ -118,9 +119,15 @@
print("${p.id} failed with exist-code $pExitCode");
}
}
-
- throw "There were failures!";
}
+ if (missingScripts.isNotEmpty) {
+ print("\n\nThere were missing scripts!");
+ for (String message in missingScripts) {
+ print(" - $message");
+ }
+ shouldThrow = true;
+ }
+ if (shouldThrow) throw "There were failures!";
}
Future<WrappedProcess> run(List<String> args, String id) async {