Fix skipped job counted as failed
Skipped jobs were counted as failed, leading to an error status for the buildset in the web UI. Change-Id: I0634e7e1181d619a3cba40c4634c2ac28d70fdc6
This commit is contained in:
parent
5f5032cf82
commit
53ec16de9d
|
@ -3039,9 +3039,29 @@ class TestDataReturn(AnsibleZuulTestCase):
|
||||||
A.messages[-1])
|
A.messages[-1])
|
||||||
|
|
||||||
def test_data_return_child_jobs(self):
|
def test_data_return_child_jobs(self):
|
||||||
|
self.wait_timeout = 120
|
||||||
|
self.executor_server.hold_jobs_in_build = True
|
||||||
|
|
||||||
A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A')
|
A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A')
|
||||||
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
|
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
|
||||||
self.waitUntilSettled()
|
self.waitUntilSettled()
|
||||||
|
|
||||||
|
self.executor_server.release('data-return-child-jobs')
|
||||||
|
self.waitUntilSettled()
|
||||||
|
|
||||||
|
self.executor_server.release('data-return-child-jobs')
|
||||||
|
self.waitUntilSettled()
|
||||||
|
|
||||||
|
# Make sure skipped jobs are not reported as failing
|
||||||
|
tenant = self.sched.abide.tenants.get("tenant-one")
|
||||||
|
status = tenant.layout.pipelines["check"].formatStatusJSON()
|
||||||
|
self.assertEqual(
|
||||||
|
status["change_queues"][0]["heads"][0][0]["failing_reasons"], [])
|
||||||
|
|
||||||
|
self.executor_server.hold_jobs_in_build = False
|
||||||
|
self.executor_server.release()
|
||||||
|
self.waitUntilSettled()
|
||||||
|
|
||||||
self.assertHistory([
|
self.assertHistory([
|
||||||
dict(name='data-return-child-jobs', result='SUCCESS',
|
dict(name='data-return-child-jobs', result='SUCCESS',
|
||||||
changes='1,1'),
|
changes='1,1'),
|
||||||
|
|
|
@ -2057,8 +2057,8 @@ class QueueItem(object):
|
||||||
"""Check if any jobs have finished with a non-success result.
|
"""Check if any jobs have finished with a non-success result.
|
||||||
|
|
||||||
Return True if any job in the job graph has returned with a
|
Return True if any job in the job graph has returned with a
|
||||||
status not equal to SUCCESS, else return False. Non-voting
|
status not equal to SUCCESS or SKIPPED, else return False.
|
||||||
and in-flight jobs are ignored.
|
Non-voting and in-flight jobs are ignored.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not self.hasJobGraph():
|
if not self.hasJobGraph():
|
||||||
|
@ -2067,7 +2067,8 @@ class QueueItem(object):
|
||||||
if not job.voting:
|
if not job.voting:
|
||||||
continue
|
continue
|
||||||
build = self.current_build_set.getBuild(job.name)
|
build = self.current_build_set.getBuild(job.name)
|
||||||
if build and build.result and (build.result != 'SUCCESS'):
|
if (build and build.result and
|
||||||
|
build.result not in ['SUCCESS', 'SKIPPED']):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue