Fail jobs when requirements not met

When Zuul identifies a job which should receive required artifacts
but can not find them (because the preceding jobs did not supply
them, perhaps due to error), treat the requiring job as having
failed rather than being skipped so that errors don't go unnoticed.

Change-Id: Ib9dd9e6a870d2af46ee11aa99812abf53ea1c5a2
This commit is contained in:
James E. Blair 2019-03-18 11:34:53 -07:00
parent bdd9ff50a1
commit b76eaeb0b0
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

@ -5391,7 +5391,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

@ -2352,7 +2352,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