Merge "Fail jobs when requirements not met"

This commit is contained in:
Zuul 2019-04-03 23:31:35 +00:00 committed by Gerrit Code Review
commit 99c6617454
3 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Jobs which use the :attr:`job.requires` attribute and fail to have
their requirements met are now recorded as "FAILED" rather than
"SKIPPED". This can happen if an earlier job which is expected to
produce artifacts fails to do so due to an error.

View File

@ -5596,7 +5596,7 @@ class TestProvidesRequires(ZuulDBTestCase):
dict(name='hold', result='SUCCESS', changes='1,1'),
dict(name='hold', result='SUCCESS', changes='1,1 2,1'),
], ordered=False)
self.assertIn('image-user : SKIPPED', B.messages[0])
self.assertIn('image-user : FAILED', B.messages[0])
self.assertIn('not met by build', B.messages[0])

View File

@ -2365,7 +2365,7 @@ class QueueItem(object):
except RequirementsError as e:
self.warning(str(e))
fakebuild = Build(job, None)
fakebuild.result = 'SKIPPED'
fakebuild.result = 'FAILED'
self.addBuild(fakebuild)
ret = True
return ret