Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: tools/mb/mb_unittest.py

Issue 2507263003: Revert of MB: Run test with gtest-parallel on swarming. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/mb/mb.py ('k') | webrtc/build/gn_isolate_map.pyl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 # 3 #
4 # Use of this source code is governed by a BSD-style license 4 # Use of this source code is governed by a BSD-style license
5 # that can be found in the LICENSE file in the root of the source 5 # that can be found in the LICENSE file in the root of the source
6 # tree. An additional intellectual property rights grant can be found 6 # tree. An additional intellectual property rights grant can be found
7 # in the file PATENTS. All contributing project authors may 7 # in the file PATENTS. All contributing project authors may
8 # be found in the AUTHORS file in the root of the source tree. 8 # be found in the AUTHORS file in the root of the source tree.
9 9
10 """Tests for mb.py.""" 10 """Tests for mb.py."""
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 'import("//build/args/bots/fake_master/fake_gn_args_bot.gn")\n') 340 'import("//build/args/bots/fake_master/fake_gn_args_bot.gn")\n')
341 341
342 342
343 def test_gn_gen_fails(self): 343 def test_gn_gen_fails(self):
344 mbw = self.fake_mbw() 344 mbw = self.fake_mbw()
345 mbw.Call = lambda cmd, env=None, buffer_output=True: (1, '', '') 345 mbw.Call = lambda cmd, env=None, buffer_output=True: (1, '', '')
346 self.check(['gen', '-c', 'gn_debug_goma', '//out/Default'], mbw=mbw, ret=1) 346 self.check(['gen', '-c', 'gn_debug_goma', '//out/Default'], mbw=mbw, ret=1)
347 347
348 def test_gn_gen_swarming(self): 348 def test_gn_gen_swarming(self):
349 files = { 349 files = {
350 '/tmp/swarming_targets': 'base_unittests\n',
351 '/fake_src/testing/buildbot/gn_isolate_map.pyl': (
352 "{'base_unittests': {"
353 " 'label': '//base:base_unittests',"
354 " 'type': 'raw',"
355 " 'args': [],"
356 "}}\n"
357 ),
358 '/fake_src/out/Default/base_unittests.runtime_deps': (
359 "base_unittests\n"
360 ),
361 }
362 mbw = self.fake_mbw(files)
363 self.check(['gen',
364 '-c', 'gn_debug_goma',
365 '--swarming-targets-file', '/tmp/swarming_targets',
366 '//out/Default'], mbw=mbw, ret=0)
367 self.assertIn('/fake_src/out/Default/base_unittests.isolate',
368 mbw.files)
369 self.assertIn('/fake_src/out/Default/base_unittests.isolated.gen.json',
370 mbw.files)
371
372 def test_gn_gen_swarming_script(self):
373 files = {
350 '/tmp/swarming_targets': 'cc_perftests\n', 374 '/tmp/swarming_targets': 'cc_perftests\n',
351 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( 375 '/fake_src/testing/buildbot/gn_isolate_map.pyl': (
352 "{'cc_perftests': {" 376 "{'cc_perftests': {"
353 " 'label': '//cc:cc_perftests'," 377 " 'label': '//cc:cc_perftests',"
354 " 'type': 'console_test_launcher'," 378 " 'type': 'script',"
379 " 'script': '/fake_src/out/Default/test_script.py',"
380 " 'args': [],"
355 "}}\n" 381 "}}\n"
356 ), 382 ),
357 'c:\\fake_src\out\Default\cc_perftests.exe.runtime_deps': ( 383 'c:\\fake_src\out\Default\cc_perftests.exe.runtime_deps': (
358 "cc_perftests\n" 384 "cc_perftests\n"
359 ), 385 ),
360 } 386 }
361 mbw = self.fake_mbw(files=files, win32=True) 387 mbw = self.fake_mbw(files=files, win32=True)
362 self.check(['gen', 388 self.check(['gen',
363 '-c', 'gn_debug_goma', 389 '-c', 'gn_debug_goma',
364 '--swarming-targets-file', '/tmp/swarming_targets', 390 '--swarming-targets-file', '/tmp/swarming_targets',
365 '--isolate-map-file', 391 '--isolate-map-file',
366 '/fake_src/testing/buildbot/gn_isolate_map.pyl', 392 '/fake_src/testing/buildbot/gn_isolate_map.pyl',
367 '//out/Default'], mbw=mbw, ret=0) 393 '//out/Default'], mbw=mbw, ret=0)
368 self.assertIn('c:\\fake_src\\out\\Default\\cc_perftests.isolate', 394 self.assertIn('c:\\fake_src\\out\\Default\\cc_perftests.isolate',
369 mbw.files) 395 mbw.files)
370 self.assertIn('c:\\fake_src\\out\\Default\\cc_perftests.isolated.gen.json', 396 self.assertIn('c:\\fake_src\\out\\Default\\cc_perftests.isolated.gen.json',
371 mbw.files) 397 mbw.files)
372 398
373 399
374 def test_gn_isolate(self): 400 def test_gn_isolate(self):
375 files = { 401 files = {
376 '/fake_src/out/Default/toolchain.ninja': "", 402 '/fake_src/out/Default/toolchain.ninja': "",
377 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( 403 '/fake_src/testing/buildbot/gn_isolate_map.pyl': (
378 "{'base_unittests': {" 404 "{'base_unittests': {"
379 " 'label': '//base:base_unittests'," 405 " 'label': '//base:base_unittests',"
380 " 'type': 'non_parallel_console_test_launcher'," 406 " 'type': 'raw',"
381 " 'args': []," 407 " 'args': [],"
382 "}}\n" 408 "}}\n"
383 ), 409 ),
384 '/fake_src/out/Default/base_unittests.runtime_deps': ( 410 '/fake_src/out/Default/base_unittests.runtime_deps': (
385 "base_unittests\n" 411 "base_unittests\n"
386 ), 412 ),
387 } 413 }
388 self.check(['isolate', '-c', 'gn_debug_goma', '//out/Default', 414 self.check(['isolate', '-c', 'gn_debug_goma', '//out/Default',
389 'base_unittests'], files=files, ret=0) 415 'base_unittests'], files=files, ret=0)
390 416
391 # test running isolate on an existing build_dir 417 # test running isolate on an existing build_dir
392 files['/fake_src/out/Default/args.gn'] = 'is_debug = True\n' 418 files['/fake_src/out/Default/args.gn'] = 'is_debug = True\n'
393 self.check(['isolate', '//out/Default', 'base_unittests'], 419 self.check(['isolate', '//out/Default', 'base_unittests'],
394 files=files, ret=0) 420 files=files, ret=0)
395 421
396 files['/fake_src/out/Default/mb_type'] = 'gn\n' 422 files['/fake_src/out/Default/mb_type'] = 'gn\n'
397 self.check(['isolate', '//out/Default', 'base_unittests'], 423 self.check(['isolate', '//out/Default', 'base_unittests'],
398 files=files, ret=0) 424 files=files, ret=0)
399 425
400 def test_gn_run(self): 426 def test_gn_run(self):
401 files = { 427 files = {
402 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( 428 '/fake_src/testing/buildbot/gn_isolate_map.pyl': (
403 "{'base_unittests': {" 429 "{'base_unittests': {"
404 " 'label': '//base:base_unittests'," 430 " 'label': '//base:base_unittests',"
405 " 'type': 'windowed_test_launcher'," 431 " 'type': 'raw',"
406 " 'args': []," 432 " 'args': [],"
407 "}}\n" 433 "}}\n"
408 ), 434 ),
409 '/fake_src/out/Default/base_unittests.runtime_deps': ( 435 '/fake_src/out/Default/base_unittests.runtime_deps': (
410 "base_unittests\n" 436 "base_unittests\n"
411 ), 437 ),
412 } 438 }
413 self.check(['run', '-c', 'gn_debug_goma', '//out/Default', 439 self.check(['run', '-c', 'gn_debug_goma', '//out/Default',
414 'base_unittests'], files=files, ret=0) 440 'base_unittests'], files=files, ret=0)
415 441
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, 558 self.check(['lookup', '-c', 'fake_config'], mbw=mbw,
533 ret=0, 559 ret=0,
534 out=("GYP_DEFINES='foo=bar baz=1'\n" 560 out=("GYP_DEFINES='foo=bar baz=1'\n"
535 "GYP_LINK_CONCURRENCY=1\n" 561 "GYP_LINK_CONCURRENCY=1\n"
536 "LLVM_FORCE_HEAD_REVISION=1\n" 562 "LLVM_FORCE_HEAD_REVISION=1\n"
537 "python build/gyp_chromium -G output_dir=_path_\n")) 563 "python build/gyp_chromium -G output_dir=_path_\n"))
538 564
539 565
540 if __name__ == '__main__': 566 if __name__ == '__main__':
541 unittest.main() 567 unittest.main()
OLDNEW
« no previous file with comments | « tools/mb/mb.py ('k') | webrtc/build/gn_isolate_map.pyl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698