Add tryserver test_api method
Updates the tryserver recipe module's test_api to support overriding get_footers data. Bug: angleproject:7985 Change-Id: Ie571bc8d1c77cbb1cd4f18955b50d56e377ca903 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4278466 Reviewed-by: Robbie Iannucci <iannucci@chromium.org> Auto-Submit: Brian Sheedy <bsheedy@chromium.org> Commit-Queue: Robbie Iannucci <iannucci@chromium.org> Commit-Queue: Brian Sheedy <bsheedy@chromium.org>changes/66/4278466/4
parent
0e503522b9
commit
4756d7c420
@ -0,0 +1,65 @@
|
||||
# Copyright 2023 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
|
||||
|
||||
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
|
||||
|
||||
DEPS = [
|
||||
'tryserver',
|
||||
'recipe_engine/assertions',
|
||||
'recipe_engine/buildbucket',
|
||||
'recipe_engine/path',
|
||||
'recipe_engine/platform',
|
||||
'recipe_engine/properties',
|
||||
]
|
||||
|
||||
|
||||
def RunSteps(api):
|
||||
footers = api.tryserver.get_footers()
|
||||
api.assertions.assertCountEqual(footers, api.properties['expected_footers'])
|
||||
|
||||
|
||||
def GenTests(api):
|
||||
yield api.test(
|
||||
'no-footers',
|
||||
api.buildbucket.try_build(
|
||||
'chromium',
|
||||
'linux',
|
||||
),
|
||||
api.properties(expected_footers={}),
|
||||
api.tryserver.get_footers({}),
|
||||
api.post_check(post_process.StatusSuccess),
|
||||
api.post_process(post_process.DropExpectation),
|
||||
)
|
||||
|
||||
yield api.test(
|
||||
'single-footer',
|
||||
api.buildbucket.try_build(
|
||||
'chromium',
|
||||
'linux',
|
||||
),
|
||||
api.properties(expected_footers={'Some-Footer': ['True']}),
|
||||
api.tryserver.get_footers({'Some-Footer': ['True']}),
|
||||
api.post_check(post_process.StatusSuccess),
|
||||
api.post_process(post_process.DropExpectation),
|
||||
)
|
||||
|
||||
yield api.test(
|
||||
'multiple-footers',
|
||||
api.buildbucket.try_build(
|
||||
'chromium',
|
||||
'linux',
|
||||
),
|
||||
api.properties(expected_footers={
|
||||
'Some-Footer': ['True'],
|
||||
'Another-Footer': ['Foo', 'Bar']
|
||||
}),
|
||||
api.tryserver.get_footers({
|
||||
'Some-Footer': ['True'],
|
||||
'Another-Footer': ['Foo', 'Bar']
|
||||
}),
|
||||
api.post_check(post_process.StatusSuccess),
|
||||
api.post_process(post_process.DropExpectation),
|
||||
)
|
Loading…
Reference in New Issue