Added parsing test output for interrupted builds.
If tests run is interrupted(e.g. lost connection to testservice,
test was stuck and no output for 3 mins and was killed then),
xcodebuild_runner needs to parse test_output, collect passed tests
and re-run test_bundle by filtering already passed tests
(e.g. https://chromium-swarm.appspot.com/task?id=45c892feae862110).
Removed _make_cmd_list_for_failed_tests because now tests
will filter by passed tests for both cases
when tests were interrupted and not.
At the end of run also add a check whether all tests from test-bundle
were executed and if not add 'not executed tests' record.
Created the radar
'After primaryInstrumentsServerWithError xcodebuild did not finish its execution'
https://feedbackassistant.apple.com/feedback/6476415
Bug: 979267
Change-Id: I596945e10bd8382c41487633456a3c80a3569419
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1680973
Reviewed-by: Rohit Rao <[email protected]>
Reviewed-by: John Budorick <[email protected]>
Commit-Queue: Maksym Onufriienko <[email protected]>
Cr-Commit-Position: refs/heads/master@{#675844}
diff --git a/ios/build/bots/scripts/test_runner_test.py b/ios/build/bots/scripts/test_runner_test.py
index dce3dc8..f468dc9 100755
--- a/ios/build/bots/scripts/test_runner_test.py
+++ b/ios/build/bots/scripts/test_runner_test.py
@@ -8,6 +8,7 @@
import collections
import glob
import logging
+import mock
import os
import subprocess
import unittest
@@ -604,6 +605,37 @@
['a', 'b', 'c', 'd']
)
+ @mock.patch('subprocess.check_output', autospec=True)
+ def test_get_test_names(self, mock_subprocess):
+ otool_output = (
+ 'imp 0x102492020 -[BrowserViewControllerTestCase testJavaScript]'
+ 'name 0x105ee8b84 testFixForCrbug801165'
+ 'types 0x105f0c842 v16 @ 0:8'
+ 'name 0x105ee8b9a testOpenURLFromNTP'
+ 'types 0x105f0c842 v16 @ 0:8'
+ 'imp 0x102493b30 -[BrowserViewControllerTestCase testOpenURLFromNTP]'
+ 'name 0x105ee8bad testOpenURLFromTab'
+ 'types 0x105f0c842 v16 @ 0:8'
+ 'imp 0x102494180 -[BrowserViewControllerTestCase testOpenURLFromTab]'
+ 'name 0x105ee8bc0 testOpenURLFromTabSwitcher'
+ 'types 0x105f0c842 v16 @ 0:8'
+ 'imp 0x102494f70 -[BrowserViewControllerTestCase testTabSwitch]'
+ 'types 0x105f0c842 v16 @ 0:8'
+ 'imp 0x102494f70 -[BrowserViewControllerTestCase helper]'
+ 'imp 0x102494f70 -[BrowserViewControllerTestCCCCCCCCC testMethod]'
+ )
+ mock_subprocess.return_value = otool_output
+ tests = test_runner.get_test_names('')
+ self.assertEqual(
+ [
+ ('BrowserViewControllerTestCase', 'testJavaScript'),
+ ('BrowserViewControllerTestCase', 'testOpenURLFromNTP'),
+ ('BrowserViewControllerTestCase', 'testOpenURLFromTab'),
+ ('BrowserViewControllerTestCase', 'testTabSwitch')
+ ],
+ tests
+ )
+
if __name__ == '__main__':
logging.basicConfig(format='[%(asctime)s:%(levelname)s] %(message)s',