Commit 4d2824af authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by LUCI CQ

Improve tests for api.tryserver.

R=yiwzhang

Bug: 1056725
Change-Id: Id09e1a243e7071b5dc5715d156063e4b08230e84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2080764Reviewed-by: 's avatarYiwei Zhang <yiwzhang@google.com>
Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
parent 94bafe03
......@@ -41,7 +41,8 @@
* [presubmit:tests/execute](#recipes-presubmit_tests_execute)
* [presubmit:tests/prepare](#recipes-presubmit_tests_prepare)
* [tryserver:examples/full](#recipes-tryserver_examples_full)
* [tryserver:tests/gerrit_change_fetch_ref](#recipes-tryserver_tests_gerrit_change_fetch_ref)
* [tryserver:tests/gerrit_change_fetch_ref_timeout](#recipes-tryserver_tests_gerrit_change_fetch_ref_timeout)
* [tryserver:tests/gerrit_change_target_ref](#recipes-tryserver_tests_gerrit_change_target_ref)
* [windows_sdk:examples/full](#recipes-windows_sdk_examples_full)
## Recipe Modules
......@@ -1046,11 +1047,16 @@ Move things around in a loop!
[DEPS](/recipes/recipe_modules/tryserver/examples/full.py#5): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/json][recipe_engine/recipe_modules/json], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/python][recipe_engine/recipe_modules/python], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]
&mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/examples/full.py#19)(api):**
### *recipes* / [tryserver:tests/gerrit\_change\_fetch\_ref](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref.py)
### *recipes* / [tryserver:tests/gerrit\_change\_fetch\_ref\_timeout](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py)
[DEPS](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref.py#7): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/properties][recipe_engine/recipe_modules/properties]
[DEPS](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py#7): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/properties][recipe_engine/recipe_modules/properties]
&mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref.py#15)(api):**
&mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py#15)(api):**
### *recipes* / [tryserver:tests/gerrit\_change\_target\_ref](/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py)
[DEPS](/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py#7): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
&mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py#16)(api):**
### *recipes* / [windows\_sdk:examples/full](/recipes/recipe_modules/windows_sdk/examples/full.py)
[DEPS](/recipes/recipe_modules/windows_sdk/examples/full.py#5): [windows\_sdk](#recipe_modules-windows_sdk), [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
......
......@@ -5,10 +5,10 @@
from recipe_engine import post_process
DEPS = [
'gerrit',
'recipe_engine/buildbucket',
'recipe_engine/properties',
'tryserver',
'gerrit',
'recipe_engine/buildbucket',
'recipe_engine/properties',
'tryserver',
]
......@@ -17,18 +17,13 @@ def RunSteps(api):
def GenTests(api):
yield (
api.test('timeout') +
api.buildbucket.try_build(
'chromium',
'linux',
git_repo='https://chromium.googlesource.com/chromium/src',
change_number=91827,
patch_set=1) +
api.properties(target_ref='refs/heads/master') +
api.tryserver.gerrit_change_target_ref('refs/heads/master') +
api.override_step_data('gerrit fetch current CL info',
times_out_after=1200) +
api.post_process(post_process.StatusException) +
api.post_process(post_process.DropExpectation)
)
yield (api.test('timeout') + api.buildbucket.try_build(
'chromium',
'linux',
git_repo='https://chromium.googlesource.com/chromium/src',
change_number=91827,
patch_set=1) + api.tryserver.gerrit_change_target_ref('refs/heads/master')
+ api.override_step_data(
'gerrit fetch current CL info', times_out_after=1200) +
api.post_process(post_process.StatusException) + api.post_process(
post_process.DropExpectation))
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine import post_process
DEPS = [
'gerrit',
'recipe_engine/buildbucket',
'recipe_engine/properties',
'recipe_engine/step',
'tryserver',
]
def RunSteps(api):
api.step(name=api.tryserver.gerrit_change_target_ref or 'None!', cmd=None)
def GenTests(api):
yield api.test(
'works',
api.buildbucket.try_build(
'chromium',
'linux',
git_repo='https://chromium.googlesource.com/chromium/src',
change_number=91827,
patch_set=1),
api.tryserver.gerrit_change_target_ref('refs/branch-heads/custom'),
api.post_check(
lambda check, steps: check('refs/branch-heads/custom' in steps)),
api.post_process(post_process.DropExpectation))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment