Skip to content

Commit 30b0a80

Browse files
jensjohaCommit Queue
authored andcommitted
[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 <[email protected]> Commit-Queue: Jens Johansen <[email protected]>
1 parent 35887d1 commit 30b0a80

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

pkg/front_end/test/weekly_tester.dart

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'dart:async' show Future;
66
import 'dart:convert' show LineSplitter, utf8;
7-
import 'dart:io' show File, Platform, Process, exitCode;
7+
import 'dart:io' show File, Platform, Process;
88

99
Future<void> main(List<String> args) async {
1010
// General idea: Launch - in separate processes - whatever we want to run
@@ -18,14 +18,18 @@ Future<void> main(List<String> args) async {
1818
"\n\n");
1919

2020
List<WrappedProcess> startedProcesses = [];
21+
List<String> missingScripts = [];
22+
void noteMissingScript(String message) {
23+
missingScripts.add(message);
24+
print(message);
25+
}
2126

2227
{
2328
// Very slow: Leak-test.
2429
Uri leakTester =
2530
Platform.script.resolve("flutter_gallery_leak_tester.dart");
2631
if (!new File.fromUri(leakTester).existsSync()) {
27-
exitCode = 1;
28-
print("Couldn't find $leakTester");
32+
noteMissingScript("Couldn't find $leakTester");
2933
} else {
3034
// The tools/bots/flutter/compile_flutter.sh script passes `--path`
3135
// --- we'll just pass everything along.
@@ -43,8 +47,7 @@ Future<void> main(List<String> args) async {
4347
// Weak suite with fuzzing.
4448
Uri weakSuite = Platform.script.resolve("weak_suite.dart");
4549
if (!new File.fromUri(weakSuite).existsSync()) {
46-
exitCode = 1;
47-
print("Couldn't find $weakSuite");
50+
noteMissingScript("Couldn't find $weakSuite");
4851
} else {
4952
startedProcesses.add(await run(
5053
[
@@ -60,8 +63,7 @@ Future<void> main(List<String> args) async {
6063
// Strong suite with fuzzing.
6164
Uri strongSuite = Platform.script.resolve("strong_suite.dart");
6265
if (!new File.fromUri(strongSuite).existsSync()) {
63-
exitCode = 1;
64-
print("Couldn't find $strongSuite");
66+
noteMissingScript("Couldn't find $strongSuite");
6567
} else {
6668
startedProcesses.add(await run(
6769
[
@@ -78,8 +80,7 @@ Future<void> main(List<String> args) async {
7880
Uri incrementalLeakTest =
7981
Platform.script.resolve("vm_service_for_leak_detection.dart");
8082
if (!new File.fromUri(incrementalLeakTest).existsSync()) {
81-
exitCode = 1;
82-
print("Couldn't find $incrementalLeakTest");
83+
noteMissingScript("Couldn't find $incrementalLeakTest");
8384
} else {
8485
startedProcesses.add(await run([
8586
incrementalLeakTest.toString(),
@@ -90,11 +91,9 @@ Future<void> main(List<String> args) async {
9091

9192
{
9293
// Expression suite with fuzzing.
93-
Uri expressionSuite =
94-
Platform.script.resolve("expression_suite.dart");
94+
Uri expressionSuite = Platform.script.resolve("expression_suite.dart");
9595
if (!new File.fromUri(expressionSuite).existsSync()) {
96-
exitCode = 1;
97-
print("Couldn't find $expressionSuite");
96+
noteMissingScript("Couldn't find $expressionSuite");
9897
} else {
9998
startedProcesses.add(await run(
10099
[
@@ -107,9 +106,11 @@ Future<void> main(List<String> args) async {
107106
}
108107

109108
// Wait for everything to finish.
109+
bool shouldThrow = false;
110110
List<int> exitCodes =
111111
await Future.wait(startedProcesses.map((e) => e.process.exitCode));
112112
if (exitCodes.where((e) => e != 0).isNotEmpty) {
113+
shouldThrow = true;
113114
print("\n\nFound failures!:\n");
114115
// At least one failed.
115116
for (WrappedProcess p in startedProcesses) {
@@ -118,9 +119,15 @@ Future<void> main(List<String> args) async {
118119
print("${p.id} failed with exist-code $pExitCode");
119120
}
120121
}
121-
122-
throw "There were failures!";
123122
}
123+
if (missingScripts.isNotEmpty) {
124+
print("\n\nThere were missing scripts!");
125+
for (String message in missingScripts) {
126+
print(" - $message");
127+
}
128+
shouldThrow = true;
129+
}
130+
if (shouldThrow) throw "There were failures!";
124131
}
125132

126133
Future<WrappedProcess> run(List<String> args, String id) async {

0 commit comments

Comments
 (0)