| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Classes and methods for executing tests. | 6 * Classes and methods for executing tests. |
| 7 * | 7 * |
| 8 * This module includes: | 8 * This module includes: |
| 9 * - Managing parallel execution of tests, including timeout checks. | 9 * - Managing parallel execution of tests, including timeout checks. |
| 10 * - Evaluating the output of each test as pass/fail/crash/timeout. | 10 * - Evaluating the output of each test as pass/fail/crash/timeout. |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 time, | 887 time, |
| 888 compilationSkipped) : | 888 compilationSkipped) : |
| 889 super(command, | 889 super(command, |
| 890 exitCode, | 890 exitCode, |
| 891 timedOut, | 891 timedOut, |
| 892 stdout, | 892 stdout, |
| 893 stderr, | 893 stderr, |
| 894 time, | 894 time, |
| 895 compilationSkipped); | 895 compilationSkipped); |
| 896 | 896 |
| 897 bool didFail(TestCase testCase) { |
| 898 return _getOutcome() != Expectation.PASS; |
| 899 } |
| 900 |
| 901 |
| 897 bool get _browserTestFailure { | 902 bool get _browserTestFailure { |
| 898 // We should not need to convert back and forward. | 903 // We should not need to convert back and forward. |
| 899 var output = decodeUtf8(super.stdout); | 904 var output = decodeUtf8(super.stdout); |
| 900 if (output.contains("FAIL")) return true; | 905 if (output.contains("FAIL")) return true; |
| 901 return !output.contains("PASS"); | 906 return !output.contains("PASS"); |
| 902 } | 907 } |
| 903 } | 908 } |
| 904 | 909 |
| 905 | 910 |
| 906 // The static analyzer does not actually execute code, so | 911 // The static analyzer does not actually execute code, so |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 // "xvfb-run" issue 7564, try re-running the test. | 2114 // "xvfb-run" issue 7564, try re-running the test. |
| 2110 bool containsFailureMsg(String line) { | 2115 bool containsFailureMsg(String line) { |
| 2111 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || | 2116 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || |
| 2112 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND); | 2117 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND); |
| 2113 } | 2118 } |
| 2114 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) { | 2119 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) { |
| 2115 return true; | 2120 return true; |
| 2116 } | 2121 } |
| 2117 } | 2122 } |
| 2118 | 2123 |
| 2119 if (command is BrowserTestCommand) { | 2124 // Selenium tests can be flaky. Try re-running. |
| 2120 // We do not re-run tests on the new browser controller, since it should | 2125 if (command is SeleniumTestCommand) { |
| 2121 // not be as flaky as selenium. | 2126 return true; |
| 2122 return false; | 2127 } |
| 2123 } else if (command is SeleniumTestCommand) { | 2128 |
| 2124 // Selenium tests can be flaky. Try re-running. | 2129 // We currently rerun dartium tests, see issue 14074 |
| 2130 if (command is BrowserTestCommand && command.displayName == 'dartium') { |
| 2125 return true; | 2131 return true; |
| 2126 } | 2132 } |
| 2127 } | 2133 } |
| 2128 return false; | 2134 return false; |
| 2129 } | 2135 } |
| 2130 | 2136 |
| 2131 /* | 2137 /* |
| 2132 * [TestCaseCompleter] will listen for | 2138 * [TestCaseCompleter] will listen for |
| 2133 * NodeState.Processing -> NodeState.{Successfull,Failed} state changes and | 2139 * NodeState.Processing -> NodeState.{Successfull,Failed} state changes and |
| 2134 * will complete a TestCase if it is finished. | 2140 * will complete a TestCase if it is finished. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2316 } | 2322 } |
| 2317 } | 2323 } |
| 2318 | 2324 |
| 2319 void eventAllTestsDone() { | 2325 void eventAllTestsDone() { |
| 2320 for (var listener in _eventListener) { | 2326 for (var listener in _eventListener) { |
| 2321 listener.allDone(); | 2327 listener.allDone(); |
| 2322 } | 2328 } |
| 2323 _allDone(); | 2329 _allDone(); |
| 2324 } | 2330 } |
| 2325 } | 2331 } |
| OLD | NEW |