|
|
|
@ -68,11 +68,12 @@ def GenTests(api):
|
|
|
|
|
['--skip_canned', 'CheckOwners']) +
|
|
|
|
|
api.post_process(post_process.DropExpectation))
|
|
|
|
|
|
|
|
|
|
yield (
|
|
|
|
|
api.test('timeout', status="FAILURE") +
|
|
|
|
|
api.runtime(is_experimental=False) +
|
|
|
|
|
api.buildbucket.try_build(project='infra') +
|
|
|
|
|
api.presubmit(timeout_s=600) + api.step_data(
|
|
|
|
|
yield api.test(
|
|
|
|
|
'timeout',
|
|
|
|
|
api.runtime(is_experimental=False),
|
|
|
|
|
api.buildbucket.try_build(project='infra'),
|
|
|
|
|
api.presubmit(timeout_s=600),
|
|
|
|
|
api.step_data(
|
|
|
|
|
'presubmit',
|
|
|
|
|
api.json.output({
|
|
|
|
|
'errors': [],
|
|
|
|
@ -80,16 +81,20 @@ def GenTests(api):
|
|
|
|
|
'warnings': []
|
|
|
|
|
}),
|
|
|
|
|
times_out_after=1200,
|
|
|
|
|
) + api.post_process(post_process.StatusFailure) + api.post_process(
|
|
|
|
|
post_process.ResultReason,
|
|
|
|
|
),
|
|
|
|
|
api.post_process(post_process.StatusFailure),
|
|
|
|
|
api.post_process(
|
|
|
|
|
post_process.SummaryMarkdown,
|
|
|
|
|
(u'#### There are 0 error(s), 0 warning(s), and 0 notifications(s).'
|
|
|
|
|
'\n\nTimeout occurred during presubmit step.')) +
|
|
|
|
|
api.post_process(post_process.DropExpectation))
|
|
|
|
|
'\n\nTimeout occurred during presubmit step.')),
|
|
|
|
|
api.post_process(post_process.DropExpectation),
|
|
|
|
|
status="FAILURE")
|
|
|
|
|
|
|
|
|
|
yield (
|
|
|
|
|
api.test('failure', status="FAILURE") +
|
|
|
|
|
api.runtime(is_experimental=False) +
|
|
|
|
|
api.buildbucket.try_build(project='infra') + api.step_data(
|
|
|
|
|
yield api.test(
|
|
|
|
|
'failure',
|
|
|
|
|
api.runtime(is_experimental=False),
|
|
|
|
|
api.buildbucket.try_build(project='infra'),
|
|
|
|
|
api.step_data(
|
|
|
|
|
'presubmit',
|
|
|
|
|
api.json.output(
|
|
|
|
|
{
|
|
|
|
@ -117,9 +122,10 @@ def GenTests(api):
|
|
|
|
|
'fatal': False
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
retcode=1)) + api.post_process(post_process.StatusFailure) +
|
|
|
|
|
retcode=1)),
|
|
|
|
|
api.post_process(post_process.StatusFailure),
|
|
|
|
|
api.post_process(
|
|
|
|
|
post_process.ResultReason,
|
|
|
|
|
post_process.SummaryMarkdown,
|
|
|
|
|
textwrap.dedent(u'''
|
|
|
|
|
#### There are 2 error(s), 1 warning(s), and 1 notifications(s).
|
|
|
|
|
|
|
|
|
@ -136,29 +142,34 @@ def GenTests(api):
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### To see notifications and warnings, look at the stdout of the presubmit step.
|
|
|
|
|
''').strip()) + api.post_process(post_process.DropExpectation))
|
|
|
|
|
''').strip()),
|
|
|
|
|
api.post_process(post_process.DropExpectation),
|
|
|
|
|
status="FAILURE")
|
|
|
|
|
|
|
|
|
|
long_message = (u'Here are some suggested OWNERS:' +
|
|
|
|
|
u'\nreallyLongFakeAccountNameEmail@chromium.org' * 10)
|
|
|
|
|
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(
|
|
|
|
|
{
|
|
|
|
|
'errors': [{
|
|
|
|
|
'message': 'Missing LGTM',
|
|
|
|
|
'long_text': long_message,
|
|
|
|
|
'items': [],
|
|
|
|
|
'fatal': True
|
|
|
|
|
}],
|
|
|
|
|
'notifications': [],
|
|
|
|
|
'warnings': []
|
|
|
|
|
},
|
|
|
|
|
retcode=1)) + api.post_process(post_process.StatusFailure) +
|
|
|
|
|
api.post_process(
|
|
|
|
|
post_process.ResultReason,
|
|
|
|
|
textwrap.dedent('''
|
|
|
|
|
yield api.test(
|
|
|
|
|
'failure-long-message',
|
|
|
|
|
api.runtime(is_experimental=False),
|
|
|
|
|
api.buildbucket.try_build(project='infra'),
|
|
|
|
|
api.step_data(
|
|
|
|
|
'presubmit',
|
|
|
|
|
api.json.output(
|
|
|
|
|
{
|
|
|
|
|
'errors': [{
|
|
|
|
|
'message': 'Missing LGTM',
|
|
|
|
|
'long_text': long_message,
|
|
|
|
|
'items': [],
|
|
|
|
|
'fatal': True
|
|
|
|
|
}],
|
|
|
|
|
'notifications': [],
|
|
|
|
|
'warnings': []
|
|
|
|
|
},
|
|
|
|
|
retcode=1)),
|
|
|
|
|
api.post_process(post_process.StatusFailure),
|
|
|
|
|
api.post_process(
|
|
|
|
|
post_process.SummaryMarkdown,
|
|
|
|
|
textwrap.dedent('''
|
|
|
|
|
#### There are 1 error(s), 0 warning(s), and 0 notifications(s).
|
|
|
|
|
|
|
|
|
|
**ERROR**
|
|
|
|
@ -178,52 +189,63 @@ def GenTests(api):
|
|
|
|
|
|
|
|
|
|
**Error size > 450 chars, there are 2 more error(s) (15 total)**
|
|
|
|
|
**The complete output can be found at the bottom of the presubmit stdout.**
|
|
|
|
|
''').strip()) + api.post_process(post_process.DropExpectation))
|
|
|
|
|
''').strip()),
|
|
|
|
|
api.post_process(post_process.DropExpectation),
|
|
|
|
|
status="FAILURE")
|
|
|
|
|
|
|
|
|
|
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(
|
|
|
|
|
{
|
|
|
|
|
'errors': [{
|
|
|
|
|
'message': 'Infra Failure',
|
|
|
|
|
'long_text': '',
|
|
|
|
|
'items': [],
|
|
|
|
|
'fatal': True
|
|
|
|
|
}],
|
|
|
|
|
'notifications': [],
|
|
|
|
|
'warnings': []
|
|
|
|
|
},
|
|
|
|
|
retcode=2)) + api.post_process(post_process.StatusException) +
|
|
|
|
|
api.post_process(
|
|
|
|
|
post_process.ResultReason,
|
|
|
|
|
textwrap.dedent(u'''
|
|
|
|
|
#### There are 1 error(s), 0 warning(s), and 0 notifications(s).
|
|
|
|
|
|
|
|
|
|
**ERROR**
|
|
|
|
|
```
|
|
|
|
|
Infra Failure
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
''').strip()) + api.post_process(post_process.DropExpectation))
|
|
|
|
|
yield api.test(
|
|
|
|
|
'infra-failure',
|
|
|
|
|
api.runtime(is_experimental=False),
|
|
|
|
|
api.buildbucket.try_build(project='infra'),
|
|
|
|
|
api.step_data(
|
|
|
|
|
'presubmit',
|
|
|
|
|
api.json.output(
|
|
|
|
|
{
|
|
|
|
|
'errors': [{
|
|
|
|
|
'message': 'Infra Failure',
|
|
|
|
|
'long_text': '',
|
|
|
|
|
'items': [],
|
|
|
|
|
'fatal': True
|
|
|
|
|
}],
|
|
|
|
|
'notifications': [],
|
|
|
|
|
'warnings': []
|
|
|
|
|
},
|
|
|
|
|
retcode=2)),
|
|
|
|
|
api.post_process(post_process.StatusException),
|
|
|
|
|
api.post_process(
|
|
|
|
|
post_process.SummaryMarkdown,
|
|
|
|
|
textwrap.dedent(u'''
|
|
|
|
|
#### There are 1 error(s), 0 warning(s), and 0 notifications(s).
|
|
|
|
|
|
|
|
|
|
**ERROR**
|
|
|
|
|
```
|
|
|
|
|
Infra Failure
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
''').strip()),
|
|
|
|
|
api.post_process(post_process.DropExpectation),
|
|
|
|
|
status="INFRA_FAILURE")
|
|
|
|
|
|
|
|
|
|
bug_msg = ('Something unexpected occurred'
|
|
|
|
|
' while running presubmit checks.'
|
|
|
|
|
' Please [file a bug](https://issues.chromium.org'
|
|
|
|
|
'/issues/new?component=1456211)')
|
|
|
|
|
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(
|
|
|
|
|
'failure-no-json',
|
|
|
|
|
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.SummaryMarkdown, bug_msg),
|
|
|
|
|
api.post_process(post_process.DropExpectation),
|
|
|
|
|
status="INFRA_FAILURE")
|
|
|
|
|
|
|
|
|
|
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)) +
|
|
|
|
|
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',
|
|
|
|
|
api.runtime(is_experimental=False),
|
|
|
|
|
api.buildbucket.try_build(project='infra'),
|
|
|
|
|
api.step_data('presubmit', api.json.output(None, retcode=2)),
|
|
|
|
|
api.post_process(post_process.StatusException),
|
|
|
|
|
api.post_process(post_process.SummaryMarkdown, bug_msg),
|
|
|
|
|
api.post_process(post_process.DropExpectation),
|
|
|
|
|
status="INFRA_FAILURE")
|
|
|
|
|