OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library test_progress; | 5 library test_progress; |
6 | 6 |
7 import "dart:async"; | 7 import "dart:async"; |
8 import "dart:io"; | 8 import "dart:io"; |
9 import "dart:io" as io; | 9 import "dart:io" as io; |
10 import "dart:convert" show JSON; | 10 import "dart:convert" show JSON; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 } | 167 } |
168 | 168 |
169 class ExitCodeSetter extends EventListener { | 169 class ExitCodeSetter extends EventListener { |
170 void done(TestCase test) { | 170 void done(TestCase test) { |
171 if (test.unexpectedOutput) { | 171 if (test.unexpectedOutput) { |
172 io.exitCode = 1; | 172 io.exitCode = 1; |
173 } | 173 } |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 class IgnoredTestMonitor extends EventListener { | |
178 static final int maxIgnored = 5; | |
179 | |
180 int countIgnored = 0; | |
181 | |
182 void done(TestCase test) { | |
183 if (test.lastCommandOutput?.result(test) == Expectation.IGNORE) { | |
kustermann
2016/06/24 13:36:44
Why the "?" ? There should be at least one command
Bill Hesse
2016/06/27 12:43:15
I wasn't sure.
Done.
| |
184 countIgnored++; | |
185 if (countIgnored > maxIgnored) { | |
186 print("/nMore than $maxIgnored tests were ignored due to flakes in"); | |
187 print("the test infrastructure. Output of the last ignored test was:"); | |
kustermann
2016/06/24 13:36:44
You should probably add a comment about notifying
Bill Hesse
2016/06/27 12:43:15
Done.
| |
188 print(_buildFailureOutput(test)); | |
189 exit(1); | |
190 } | |
191 } | |
192 } | |
193 | |
194 void allDone() { | |
195 if (countIgnored > 0) { | |
196 print("Ignored $countIgnored tests due to flaky infrastructure"); | |
197 } | |
198 } | |
199 } | |
200 | |
177 class FlakyLogWriter extends EventListener { | 201 class FlakyLogWriter extends EventListener { |
178 void done(TestCase test) { | 202 void done(TestCase test) { |
179 if (test.isFlaky && test.result != Expectation.PASS) { | 203 if (test.isFlaky && test.result != Expectation.PASS) { |
180 var buf = new StringBuffer(); | 204 var buf = new StringBuffer(); |
181 for (var l in _buildFailureOutput(test)) { | 205 for (var l in _buildFailureOutput(test)) { |
182 buf.write("$l\n"); | 206 buf.write("$l\n"); |
183 } | 207 } |
184 _appendToFlakyFile(buf.toString()); | 208 _appendToFlakyFile(buf.toString()); |
185 } | 209 } |
186 } | 210 } |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
664 return new VerboseProgressIndicator(startTime); | 688 return new VerboseProgressIndicator(startTime); |
665 case 'status': | 689 case 'status': |
666 return new ProgressIndicator(startTime); | 690 return new ProgressIndicator(startTime); |
667 case 'buildbot': | 691 case 'buildbot': |
668 return new BuildbotProgressIndicator(startTime); | 692 return new BuildbotProgressIndicator(startTime); |
669 default: | 693 default: |
670 assert(false); | 694 assert(false); |
671 break; | 695 break; |
672 } | 696 } |
673 } | 697 } |
OLD | NEW |