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

Side by Side Diff: scripts/slave/recipes/findit/chromium/test.py

Issue 1565113003: Add concept of bot config and test spec database (BotConfigAndTestDB). (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Rebased. (Probably unnecessary.) Created 4 years, 11 months 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 | « scripts/slave/recipes/findit/chromium/compile.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 6
7 from recipe_engine.config import Dict 7 from recipe_engine.config import Dict
8 from recipe_engine.recipe_api import Property 8 from recipe_engine.recipe_api import Property
9 9
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 SKIPPED = 'skipped' # A commit doesn't impact the test. 55 SKIPPED = 'skipped' # A commit doesn't impact the test.
56 PASSED = 'passed' # The compile or test passed. 56 PASSED = 'passed' # The compile or test passed.
57 FAILED = 'failed' # The compile or test failed. 57 FAILED = 'failed' # The compile or test failed.
58 58
59 59
60 def _compile_and_test_at_revision(api, target_mastername, target_buildername, 60 def _compile_and_test_at_revision(api, target_mastername, target_buildername,
61 target_testername, revision, requested_tests): 61 target_testername, revision, requested_tests):
62 results = {} 62 results = {}
63 with api.step.nest('test %s' % str(revision)): 63 with api.step.nest('test %s' % str(revision)):
64 # Checkout code at the given revision to recompile. 64 # Checkout code at the given revision to recompile.
65 bot_update_step, master_dict, _ = \ 65 bot_update_step, bot_db = \
66 api.chromium_tests.prepare_checkout( 66 api.chromium_tests.prepare_checkout(
67 target_mastername, 67 target_mastername,
68 target_buildername, 68 target_buildername,
69 root_solution_revision=revision) 69 root_solution_revision=revision)
70 70
71 # Figure out which test steps to run. 71 # Figure out which test steps to run.
72 all_tests = api.chromium_tests.tests_for_builder( 72 all_tests = api.chromium_tests.tests_for_builder(
73 target_mastername, 73 target_mastername,
74 target_testername, # If not tester, this is same as target_buildername. 74 target_testername, # If not tester, this is same as target_buildername.
75 bot_update_step, 75 bot_update_step,
76 master_dict, 76 bot_db,
77 override_bot_type='builder_tester') 77 override_bot_type='builder_tester')
78 78
79 tests_to_run = [test for test in all_tests if test.name in requested_tests] 79 tests_to_run = [test for test in all_tests if test.name in requested_tests]
80 80
81 # Figure out which targets to compile. 81 # Figure out which targets to compile.
82 compile_targets = [] 82 compile_targets = []
83 for test in tests_to_run: 83 for test in tests_to_run:
84 compile_targets.extend(test.compile_targets(api)) 84 compile_targets.extend(test.compile_targets(api))
85 compile_targets = sorted(set(compile_targets)) 85 compile_targets = sorted(set(compile_targets))
86 86
87 if compile_targets: 87 if compile_targets:
88 api.chromium_tests.compile_specific_targets( 88 api.chromium_tests.compile_specific_targets(
89 target_mastername, 89 target_mastername,
90 target_buildername, 90 target_buildername,
91 bot_update_step, 91 bot_update_step,
92 master_dict, 92 bot_db,
93 compile_targets, 93 compile_targets,
94 tests_including_triggered=tests_to_run, 94 tests_including_triggered=tests_to_run,
95 mb_mastername=target_mastername, 95 mb_mastername=target_mastername,
96 mb_buildername=target_buildername, 96 mb_buildername=target_buildername,
97 override_bot_type='builder_tester') 97 override_bot_type='builder_tester')
98 98
99 # Run the tests. 99 # Run the tests.
100 with api.chromium_tests.wrap_chromium_tests( 100 with api.chromium_tests.wrap_chromium_tests(
101 target_mastername, tests_to_run): 101 target_mastername, tests_to_run):
102 failed_tests = api.test_utils.run_tests( 102 failed_tests = api.test_utils.run_tests(
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 ], 331 ],
332 }, 332 },
333 })) + 333 })) +
334 api.override_step_data( 334 api.override_step_data(
335 'test r1.gl_tests (r1)', 335 'test r1.gl_tests (r1)',
336 simulated_gtest_output( 336 simulated_gtest_output(
337 failed_test_names=['Test.One', 'Test.Two'], 337 failed_test_names=['Test.One', 'Test.Two'],
338 passed_test_names=['Test.Three']) 338 passed_test_names=['Test.Three'])
339 ) 339 )
340 ) 340 )
OLDNEW
« no previous file with comments | « scripts/slave/recipes/findit/chromium/compile.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698