Improve tests for api.tryserver.
R=yiwzhang Bug: 1056725 Change-Id: Id09e1a243e7071b5dc5715d156063e4b08230e84 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2080764 Reviewed-by: Yiwei Zhang <yiwzhang@google.com> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org> Commit-Queue: Andrii Shyshkalov <tandrii@google.com> Auto-Submit: Andrii Shyshkalov <tandrii@google.com>changes/64/2080764/4
parent
94bafe03c8
commit
4d2824af52
@ -1,34 +0,0 @@
|
||||
# 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',
|
||||
'tryserver',
|
||||
]
|
||||
|
||||
|
||||
def RunSteps(api):
|
||||
api.tryserver.gerrit_change_fetch_ref
|
||||
|
||||
|
||||
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)
|
||||
)
|
@ -0,0 +1,29 @@
|
||||
# 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',
|
||||
'tryserver',
|
||||
]
|
||||
|
||||
|
||||
def RunSteps(api):
|
||||
api.tryserver.gerrit_change_fetch_ref
|
||||
|
||||
|
||||
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.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))
|
@ -0,0 +1,32 @@
|
||||
# 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))
|
Loading…
Reference in New Issue