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

Unified Diff: scripts/slave/recipe_modules/auto_bisect/old_example.old

Issue 2247373002: Refactor stages 1, 2 and test_api overhaul. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/auto_bisect/old_example.old
diff --git a/scripts/slave/recipe_modules/auto_bisect/example.py b/scripts/slave/recipe_modules/auto_bisect/old_example.old
similarity index 93%
copy from scripts/slave/recipe_modules/auto_bisect/example.py
copy to scripts/slave/recipe_modules/auto_bisect/old_example.old
index fc65a1b41d385dcd3e888dd34c64ec2af4f618a7..cf239531d267beeaf3acaa31af2538f0e1f33761 100644
--- a/scripts/slave/recipe_modules/auto_bisect/example.py
+++ b/scripts/slave/recipe_modules/auto_bisect/old_example.old
@@ -7,6 +7,7 @@ import json
DEPS = [
'auto_bisect',
'chromium_tests',
+ 'depot_tools/gclient',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
@@ -21,24 +22,35 @@ For more information about recipes, see: https://goo.gl/xKnjz6
def RunSteps(api):
+ mastername = api.properties.get('mastername')
+ buildername = api.properties.get('buildername')
+ bot_config = api.chromium_tests.create_bot_config_object(mastername,
+ buildername)
+ api.chromium_tests.configure_build(bot_config)
+ api.gclient.apply_config('perf')
+ update_step, bot_db = api.chromium_tests.prepare_checkout(bot_config)
+
+ api.auto_bisect.bot_db = bot_db
+
fake_checkout_path = api.path.mkdtemp('fake_checkout')
api.path['checkout'] = fake_checkout_path
+ api.path.c.dynamic_paths['catapult'] = api.path['slave_build'].join(
+ 'catapult')
bisector = api.auto_bisect.create_bisector(api.properties['bisect_config'],
do_not_nest_wait_for_revision=True)
- # Request builds and tests for initial range and wait.
bisector.good_rev.start_job()
- bisector.bad_rev.start_job()
- bisector.wait_for_all([bisector.good_rev, bisector.bad_rev])
+ if bisector.good_rev.failed:
+ return
- if bisector.good_rev.failed or bisector.bad_rev.failed:
+ bisector.bad_rev.start_job()
+ if bisector.bad_rev.failed:
return
assert bisector.check_improvement_direction()
assert bisector.check_initial_confidence()
revision_to_check = bisector.get_revision_to_eval()
revision_to_check.start_job()
- bisector.wait_for(revision_to_check)
bisector.check_bisect_finished(revision_to_check)
# Evaluate inserted DEPS-modified revisions.
@@ -65,6 +77,7 @@ def RunSteps(api):
bot_config = api.chromium_tests.create_bot_config_object(
mastername, buildername)
api.chromium_tests.configure_build(bot_config)
+ api.gclient.c.got_revision_mapping.pop('catapult', None)
api.chromium_tests.prepare_checkout(bot_config)
kwargs = {
'extra_src': 'dummy_extra_src',
@@ -76,14 +89,60 @@ def RunSteps(api):
def GenTests(api):
dummy_gs_location = ('gs://chrome-perf/bisect-results/'
'a6298e4afedbf2cd461755ea6f45b0ad64222222-test.results')
+ bisect_script_test = _make_test(
+ api, _get_basic_test_data(), 'basic_bisect_script')
+
+ bisect_script_test += api.properties(mastername='tryserver.chromium.perf',
+ buildername='linux_perf_bisect',
+ slavename='dummyslave')
+ yield bisect_script_test
+
basic_test = _make_test(api, _get_basic_test_data(), 'basic')
yield basic_test
+ yield _make_test(api, _get_reversed_basic_test_data(), 'reversed_basic')
+
invalid_config_test = api.test('invalid_config')
invalid_config_test += api.properties(
bisect_config=_get_config({'good_revision': 'not a valid revision'}))
yield invalid_config_test
+ missing_metric_test = _make_test(
+ api, _get_ref_range_only_missing_metric_test_data(),
+ 'missing_metric_test')
+ yield missing_metric_test
+
+ windows_test = _make_test(
+ api, _get_basic_test_data(), 'windows_bisector', platform='windows')
+ yield windows_test
+
+ winx64_test = _make_test(
+ api, _get_basic_test_data(), 'windows_x64_bisector', platform='win_x64')
+ yield winx64_test
+
+ mac_test = _make_test(
+ api, _get_basic_test_data(), 'mac_bisector', platform='mac')
+ yield mac_test
+
+ android_test = _make_test(
+ api, _get_basic_test_data(), 'android_bisector', platform='android')
+ yield android_test
+
+ android_arm64_test = _make_test(
+ api, _get_basic_test_data(), 'android_arm64_bisector',
+ platform='android_arm64')
+ yield android_arm64_test
+
+ failed_data = _get_basic_test_data()
+ failed_data[0].pop('DEPS')
+ failed_data[1]['test_results']['results']['errors'] = ['Dummy error.']
+ failed_data[1].pop('DEPS_change')
+ failed_data[1].pop('DEPS')
+ failed_data[1].pop('DEPS_interval')
+ failed_data[0].pop('git_diff')
+ failed_data[0].pop('cl_info')
+ yield _make_test(api, failed_data, 'failed_test')
+
failed_build_test = _make_test(
api, _get_ref_range_only_test_data(), 'failed_build_test',
extra_config={'dummy_builds': None})
@@ -103,7 +162,6 @@ def GenTests(api):
})))
yield failed_build_test
-
delayed_build_test = _make_test(
api, _get_ref_range_only_test_data(), 'delayed_build_test',
extra_config={'dummy_builds': None})
@@ -136,52 +194,6 @@ def GenTests(api):
})))
yield delayed_build_test
- missing_metric_test = _make_test(
- api, _get_ref_range_only_missing_metric_test_data(),
- 'missing_metric_test')
- yield missing_metric_test
-
- windows_test = _make_test(
- api, _get_basic_test_data(), 'windows_bisector', platform='windows')
- yield windows_test
-
- winx64_test = _make_test(
- api, _get_basic_test_data(), 'windows_x64_bisector', platform='win_x64')
- yield winx64_test
-
- mac_test = _make_test(
- api, _get_basic_test_data(), 'mac_bisector', platform='mac')
- yield mac_test
-
- android_test = _make_test(
- api, _get_basic_test_data(), 'android_bisector', platform='android')
- yield android_test
-
- android_arm64_test = _make_test(
- api, _get_basic_test_data(), 'android_arm64_bisector',
- platform='android_arm64')
- yield android_arm64_test
-
- failed_data = _get_basic_test_data()
- failed_data[0].pop('DEPS')
- failed_data[1]['test_results']['results']['errors'] = ['Dummy error.']
- failed_data[1].pop('DEPS_change')
- failed_data[1].pop('DEPS')
- failed_data[1].pop('DEPS_interval')
- failed_data[0].pop('git_diff')
- failed_data[0].pop('cl_info')
- yield _make_test(api, failed_data, 'failed_test')
-
- yield _make_test(api, _get_reversed_basic_test_data(), 'reversed_basic')
-
- bad_git_hash_data = _get_basic_test_data()
- bad_git_hash_data[1]['interned_hashes'] = {'003': '12345', '002': 'Bad Hash'}
-
- bisect_script_test = _make_test(
- api, _get_basic_test_data(), 'basic_bisect_script')
-
- yield bisect_script_test
-
def _get_ref_range_only_test_data():
return [
@@ -345,6 +357,7 @@ def _make_test(api, test_data, test_name, platform='linux', extra_config=None):
basic_test += api.properties(mastername='tryserver.chromium.perf',
buildername='linux_perf_bisect',
slavename='dummyslave')
+ basic_test += api.auto_bisect()
basic_test += _get_revision_range_step_data(api, test_data)
for revision_data in test_data:
for step_data in _get_step_data_for_revision(api, revision_data):
@@ -444,6 +457,9 @@ def _get_step_data_for_revision(api, revision_data, include_build_steps=True):
step_name = 'Generating patch for %s:DEPS to %s'
step_name %= (commit_hash, deps_rev)
yield api.step_data(step_name, stdout=api.raw_io.output(diff_file))
+ if deps_rev == '003':
+ step_name = ('gsutil Get test results for build %s') % deps_rev
+ yield api.step_data(step_name, stdout=api.json.output(test_results))
if 'DEPS_change' in revision_data:
step_name = 'Checking DEPS for ' + commit_hash

Powered by Google App Engine
This is Rietveld 408576698