MB: Add a way to run tests on swarming without using gtest-parallel.

Adds a new test_type 'raw' to run tests on swarming without wrapping it
on gtest-parallel.

This will be used to run webrtc_perf_tests directly.

Bug: chromium:755660
Change-Id: I8558faadf242d1db1ad3e13083941886c92b1bd9
Reviewed-on: https://webrtc-review.googlesource.com/49360
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21962}
This commit is contained in:
Edward Lemur
2018-02-07 18:09:44 +01:00
committed by Commit Bot
parent 8e545eee1e
commit 2b67f5c65f
2 changed files with 69 additions and 32 deletions

View File

@ -457,8 +457,8 @@ class UnitTest(unittest.TestCase):
'--gtest_color=no',
'--timeout=500',
'--retry_failed=3',
'./base_unittests',
'--workers=1',
'./base_unittests',
'--',
'--asan=0',
'--lsan=0',
@ -501,6 +501,43 @@ class UnitTest(unittest.TestCase):
'../../base/base_unittests_script.py',
])
def test_gn_gen_raw(self):
test_files = {
'/tmp/swarming_targets': 'base_unittests\n',
'/fake_src/testing/buildbot/gn_isolate_map.pyl': (
"{'base_unittests': {"
" 'label': '//base:base_unittests',"
" 'type': 'raw',"
"}}\n"
),
'/fake_src/out/Default/base_unittests.runtime_deps': (
"base_unittests\n"
),
}
mbw = self.check(['gen', '-c', 'gn_debug_goma', '//out/Default',
'--swarming-targets-file', '/tmp/swarming_targets',
'--isolate-map-file',
'/fake_src/testing/buildbot/gn_isolate_map.pyl'],
files=test_files, ret=0)
isolate_file = mbw.files['/fake_src/out/Default/base_unittests.isolate']
isolate_file_contents = ast.literal_eval(isolate_file)
files = isolate_file_contents['variables']['files']
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../testing/test_env.py',
'base_unittests',
])
self.assertEqual(command, [
'../../testing/test_env.py',
'./base_unittests',
'--asan=0',
'--lsan=0',
'--msan=0',
'--tsan=0',
])
def test_gn_gen_non_parallel_console_test_launcher(self):
test_files = {
'/tmp/swarming_targets': 'base_unittests\n',
@ -539,8 +576,8 @@ class UnitTest(unittest.TestCase):
'--gtest_color=no',
'--timeout=900',
'--retry_failed=3',
'./base_unittests',
'--workers=1',
'./base_unittests',
'--',
'--asan=0',
'--lsan=0',