OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Compares the test log of a build step with previous builds. | 5 /// Compares the test log of a build step with previous builds. |
6 /// | 6 /// |
7 /// Use this to detect flakiness of failures, especially timeouts. | 7 /// Use this to detect flakiness of failures, especially timeouts. |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 | 10 |
11 import 'package:args/args.dart'; | 11 import 'package:args/args.dart'; |
12 import 'package:expect/expect.dart'; | 12 import 'package:expect/expect.dart'; |
13 import 'package:gardening/src/bot.dart'; | 13 import 'package:gardening/src/bot.dart'; |
14 import 'package:gardening/src/buildbot_structures.dart'; | 14 import 'package:gardening/src/buildbot_structures.dart'; |
15 import 'package:gardening/src/client.dart'; | 15 import 'package:gardening/src/client.dart'; |
16 import 'package:gardening/src/compare_failures_impl.dart'; | 16 import 'package:gardening/src/compare_failures_impl.dart'; |
17 import 'package:gardening/src/util.dart'; | 17 import 'package:gardening/src/util.dart'; |
18 | 18 |
19 import 'test_client.dart'; | 19 import 'test_client.dart'; |
20 | 20 |
21 // TODO(johnniwinther): Use 'package:testing' to run all tests. | |
22 main(List<String> args) async { | 21 main(List<String> args) async { |
23 ArgParser argParser = createArgParser(); | 22 ArgParser argParser = createArgParser(); |
24 argParser.addFlag('force', abbr: 'f'); | 23 argParser.addFlag('force', abbr: 'f'); |
25 ArgResults argResults = argParser.parse(args); | 24 ArgResults argResults = argParser.parse(args); |
26 processArgResults(argResults); | 25 processArgResults(argResults); |
27 | 26 |
28 await runSingleTests(argResults); | 27 await runSingleTests(argResults); |
29 await runGroupTests(argResults); | 28 await runGroupTests(argResults); |
30 } | 29 } |
31 | 30 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 print('Testing single compare-failures: $testUri runCount=$runCount'); | 113 print('Testing single compare-failures: $testUri runCount=$runCount'); |
115 Map<BuildUri, List<BuildResult>> buildResults = | 114 Map<BuildUri, List<BuildResult>> buildResults = |
116 await loadBuildResults(bot, [testUri], runCount: runCount); | 115 await loadBuildResults(bot, [testUri], runCount: runCount); |
117 print('- checking results for ${buildResults.keys}'); | 116 print('- checking results for ${buildResults.keys}'); |
118 if (LOG) { | 117 if (LOG) { |
119 printBuildResultsSummary(buildResults, [testUri]); | 118 printBuildResultsSummary(buildResults, [testUri]); |
120 } | 119 } |
121 Expect.equals(1, buildResults.length); | 120 Expect.equals(1, buildResults.length); |
122 testSingleResults(expectedResult, buildResults.values.first); | 121 testSingleResults(expectedResult, buildResults.values.first); |
123 } | 122 } |
OLD | NEW |