Update recipes python tests.

For: http://shortn/_j5mixA1Mjr

Change-Id: I7ac4471fbb1e0629d59263266b3470e372d03a19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4368938
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
changes/38/4368938/3
Joanna Wang 2 years ago committed by LUCI CQ
parent c799f76f30
commit d04720454a

@ -122,10 +122,8 @@ def GenTests(api):
},
))
)
yield (
api.test('unrecognized_commit_repo') +
ci_build(git_repo='https://unrecognized/repo')
)
yield (api.test('unrecognized_commit_repo', status="INFRA_FAILURE") +
ci_build(git_repo='https://unrecognized/repo'))
yield (
api.test('bot_update_failure') +
ci_build() +
@ -165,28 +163,20 @@ def GenTests(api):
api.test('refs') +
api.properties(refs=['+refs/change/1/2/333'])
)
yield (
api.test('tryjob_fail') +
try_build() +
api.step_data('bot_update', api.json.invalid(None), retcode=1)
)
yield (
api.test('tryjob_fail_patch') +
try_build() +
api.properties(fail_patch='apply') +
api.step_data('bot_update', retcode=88)
)
yield (
api.test('tryjob_fail_patch_download') +
try_build() +
api.properties(fail_patch='download') +
api.step_data('bot_update', retcode=87)
)
yield (api.test('tryjob_fail_missing_bot_update_json') + try_build() +
api.override_step_data('bot_update', retcode=1) +
api.post_process(post_process.ResultReasonRE, 'Infra Failure.*') +
api.post_process(post_process.StatusException) +
api.post_process(post_process.DropExpectation))
yield (api.test('tryjob_fail', status="INFRA_FAILURE") + try_build() +
api.step_data('bot_update', api.json.invalid(None), retcode=1))
yield (api.test('tryjob_fail_patch', status="FAILURE") + try_build() +
api.properties(fail_patch='apply') +
api.step_data('bot_update', retcode=88))
yield (api.test('tryjob_fail_patch_download', status="INFRA_FAILURE") +
try_build() + api.properties(fail_patch='download') +
api.step_data('bot_update', retcode=87))
yield (
api.test('tryjob_fail_missing_bot_update_json', status="INFRA_FAILURE") +
try_build() + api.override_step_data('bot_update', retcode=1) +
api.post_process(post_process.ResultReasonRE, 'Infra Failure.*') +
api.post_process(post_process.StatusException) +
api.post_process(post_process.DropExpectation))
yield (
api.test('clobber') +
api.properties(clobber=1)

@ -20,18 +20,10 @@ def RunSteps(api):
def GenTests(api):
yield (
api.test('basic') +
api.post_process(post_process.StatusSuccess) +
api.post_process(post_process.DropExpectation)
)
yield (
api.test('failure') +
api.override_step_data(
'bot_update',
api.json.output({'did_run': True}),
retcode=1) +
api.post_process(post_process.StatusAnyFailure) +
api.post_process(post_process.DropExpectation)
)
yield (api.test('basic') + api.post_process(post_process.StatusSuccess) +
api.post_process(post_process.DropExpectation))
yield (api.test('failure', status="INFRA_FAILURE") + api.override_step_data(
'bot_update', api.json.output({'did_run': True}), retcode=1) +
api.post_process(post_process.StatusAnyFailure) +
api.post_process(post_process.DropExpectation))

@ -26,12 +26,7 @@ def GenTests(api):
api.post_process(post_process.DropExpectation)
)
yield (
api.test('failure') +
api.override_step_data(
'bot_update',
api.json.output({'did_run': True}),
retcode=1) +
api.post_process(post_process.StatusAnyFailure) +
api.post_process(post_process.DropExpectation)
)
yield (api.test('failure', status="INFRA_FAILURE") + api.override_step_data(
'bot_update', api.json.output({'did_run': True}), retcode=1) +
api.post_process(post_process.StatusAnyFailure) +
api.post_process(post_process.DropExpectation))

@ -73,7 +73,7 @@ def GenTests(api):
"Uncaught Exception: DepsDiffException('Unexpected result: autoroll "
"diff found 0 files changed')"),
api.post_process(DropExpectation),
)
status="INFRA_FAILURE")
yield api.test(
'dont have revision yet',
@ -89,7 +89,7 @@ def GenTests(api):
"Uncaught Exception: DepsDiffException('Couldn't checkout previous "
"ref: fatal: bad object abcdef1234567890')"),
api.post_process(DropExpectation),
)
status="INFRA_FAILURE")
yield api.test(
'windows',

@ -22,5 +22,5 @@ def GenTests(api):
api.override_step_data('gclient sync', retcode=1),
# Should not fail with uncaught exception
api.post_process(post_process.ResultReasonRE, r'^(?!Uncaught Exception)'),
api.post_process(post_process.DropExpectation)
)
api.post_process(post_process.DropExpectation),
status="INFRA_FAILURE")

@ -94,7 +94,7 @@ def RunSteps(api):
def GenTests(api):
yield (api.test('basic') +
yield (api.test('basic', status="INFRA_FAILURE") +
api.step_data('gerrit create_gerrit_branch (v8/v8 test)',
api.gerrit.make_gerrit_create_branch_response_data()) +
api.step_data('gerrit create_gerrit_tag (v8/v8 1.0)',

@ -120,10 +120,8 @@ def GenTests(api):
api.buildbucket.ci_build(git_ref='refs/foo/bar')
)
yield (
api.test('can_fail_build') +
api.step_data('git status can_fail_build', retcode=1)
)
yield (api.test('can_fail_build', status="INFRA_FAILURE") +
api.step_data('git status can_fail_build', retcode=1))
yield (
api.test('cannot_fail_build') +
@ -135,10 +133,8 @@ def GenTests(api):
api.properties(set_got_revision=True)
)
yield (
api.test('rebase_failed') +
api.step_data('my repo rebase', retcode=1)
)
yield (api.test('rebase_failed', status="INFRA_FAILURE") +
api.step_data('my repo rebase', retcode=1))
yield api.test('remote_not_origin') + api.properties(remote_name='not_origin')
@ -156,12 +152,12 @@ def GenTests(api):
'count-objects',
stdout=api.raw_io.output(api.git.count_objects_output('xxx'))))
yield (
api.test('count-objects_with_bad_output_fails_build') +
api.step_data(
'count-objects',
stdout=api.raw_io.output(api.git.count_objects_output('xxx'))) +
api.properties(count_objects_can_fail_build=True))
yield (api.test('count-objects_with_bad_output_fails_build',
status="INFRA_FAILURE") +
api.step_data('count-objects',
stdout=api.raw_io.output(
api.git.count_objects_output('xxx'))) +
api.properties(count_objects_can_fail_build=True))
yield (
api.test('cat-file_test') +
api.step_data('git cat-file abcdef12345:TestFile',
@ -173,6 +169,6 @@ def GenTests(api):
api.test('git-cache-checkout') +
api.properties(use_git_cache=True))
yield (api.test('new_branch_failed') +
yield (api.test('new_branch_failed', status="INFRA_FAILURE") +
api.properties(set_both_upstream_and_upstream_current=True) +
api.expect_exception('ValueError'))

@ -78,7 +78,8 @@ def GenTests(api):
api.post_process(post_process.DropExpectation))
yield (
api.test('timeout') + api.runtime(is_experimental=False) +
api.test('timeout', status="FAILURE") +
api.runtime(is_experimental=False) +
api.buildbucket.try_build(project='infra') +
api.presubmit(timeout_s=600) + api.step_data(
'presubmit',
@ -96,7 +97,8 @@ def GenTests(api):
api.post_process(post_process.DropExpectation))
yield (
api.test('failure') + api.runtime(is_experimental=False) +
api.test('failure', status="FAILURE") +
api.runtime(is_experimental=False) +
api.buildbucket.try_build(project='infra') + api.step_data(
'presubmit',
api.json.output(
@ -146,7 +148,8 @@ def GenTests(api):
#### To see notifications and warnings, look at the stdout of the presubmit step.
''').strip()) + api.post_process(post_process.DropExpectation))
yield (
api.test('failure py3') + api.runtime(is_experimental=False) +
api.test('failure py3', status="FAILURE") +
api.runtime(is_experimental=False) +
api.buildbucket.try_build(project='infra') + api.step_data(
'presubmit py3',
api.json.output(
@ -198,7 +201,8 @@ def GenTests(api):
long_message = (u'Here are some suggested OWNERS:' +
u'\nreallyLongFakeAccountNameEmail@chromium.org' * 10)
yield (api.test('failure-long-message') + api.runtime(is_experimental=False) +
yield (api.test('failure-long-message', status="FAILURE") +
api.runtime(is_experimental=False) +
api.buildbucket.try_build(project='infra') + api.step_data(
'presubmit',
api.json.output(
@ -237,7 +241,8 @@ def GenTests(api):
**The complete output can be found at the bottom of the presubmit stdout.**
''').strip()) + api.post_process(post_process.DropExpectation))
yield (api.test('infra-failure') + api.runtime(is_experimental=False) +
yield (api.test('infra-failure', status="INFRA_FAILURE") +
api.runtime(is_experimental=False) +
api.buildbucket.try_build(project='infra') + api.step_data(
'presubmit',
api.json.output(
@ -271,14 +276,15 @@ def GenTests(api):
'/p/chromium/issues/entry?components='
'Infra%3EClient%3EChrome&status=Untriaged)'
)
yield (api.test('failure-no-json') + api.runtime(is_experimental=False) +
yield (api.test('failure-no-json', status="INFRA_FAILURE") +
api.runtime(is_experimental=False) +
api.buildbucket.try_build(project='infra') +
api.step_data('presubmit', api.json.output(None, retcode=1)) +
api.post_process(post_process.StatusException) +
api.post_process(post_process.ResultReason, bug_msg) +
api.post_process(post_process.DropExpectation))
yield (api.test('infra-failure-no-json') +
yield (api.test('infra-failure-no-json', status="INFRA_FAILURE") +
api.runtime(is_experimental=False) +
api.buildbucket.try_build(project='infra') +
api.step_data('presubmit', api.json.output(None, retcode=2)) +

@ -19,13 +19,15 @@ 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.tryserver.gerrit_change_target_ref('refs/heads/main')
+ 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', status="INFRA_FAILURE") +
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/main') +
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))

@ -33,6 +33,7 @@ def GenTests(api):
api.post_check(post_process.StatusException),
api.post_check(post_process.StepException, 'not a tryjob'),
api.post_process(post_process.DropExpectation),
status="INFRA_FAILURE",
)
yield api.test(
@ -40,19 +41,19 @@ def GenTests(api):
api.properties(
**{
'$recipe_engine/led':
led_properties_pb.InputProperties(
led_run_id='fake-run-id',
rbe_cas_input=swarming_pb.CASReference(
cas_instance=(
'projects/example/instances/default_instance'),
digest=swarming_pb.Digest(
hash='examplehash',
size_bytes=71,
),
led_properties_pb.InputProperties(
led_run_id='fake-run-id',
rbe_cas_input=swarming_pb.CASReference(
cas_instance=(
'projects/example/instances/default_instance'),
digest=swarming_pb.Digest(
hash='examplehash',
size_bytes=71,
),
),
),
}),
api.post_check(post_process.StatusFailure),
api.post_check(post_process.StepFailure, 'not a tryjob'),
api.post_process(post_process.DropExpectation),
)
status="FAILURE")

Loading…
Cancel
Save