summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-09 15:49:09 +0000
committerGerrit Code Review <review@openstack.org>2019-01-09 15:49:09 +0000
commit9801e8a07cd12548e0ac34f860932541fd2eecd5 (patch)
tree25229a0aec7a1b3ea1e4f8f8e2ca94f3d975c4c2
parent863705c334389348ba36808fc2dc888ac3e3697c (diff)
parent53ec16de9dbb128704c9f1dda5fc3027d5baba9e (diff)
Merge "Fix skipped job counted as failed"
-rw-r--r--tests/unit/test_v3.py20
-rw-r--r--zuul/model.py7
2 files changed, 24 insertions, 3 deletions
diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py
index 11064b8..d390d7a 100644
--- a/tests/unit/test_v3.py
+++ b/tests/unit/test_v3.py
@@ -3039,9 +3039,29 @@ class TestDataReturn(AnsibleZuulTestCase):
3039 A.messages[-1]) 3039 A.messages[-1])
3040 3040
3041 def test_data_return_child_jobs(self): 3041 def test_data_return_child_jobs(self):
3042 self.wait_timeout = 120
3043 self.executor_server.hold_jobs_in_build = True
3044
3042 A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') 3045 A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A')
3043 self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1)) 3046 self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
3044 self.waitUntilSettled() 3047 self.waitUntilSettled()
3048
3049 self.executor_server.release('data-return-child-jobs')
3050 self.waitUntilSettled()
3051
3052 self.executor_server.release('data-return-child-jobs')
3053 self.waitUntilSettled()
3054
3055 # Make sure skipped jobs are not reported as failing
3056 tenant = self.sched.abide.tenants.get("tenant-one")
3057 status = tenant.layout.pipelines["check"].formatStatusJSON()
3058 self.assertEqual(
3059 status["change_queues"][0]["heads"][0][0]["failing_reasons"], [])
3060
3061 self.executor_server.hold_jobs_in_build = False
3062 self.executor_server.release()
3063 self.waitUntilSettled()
3064
3045 self.assertHistory([ 3065 self.assertHistory([
3046 dict(name='data-return-child-jobs', result='SUCCESS', 3066 dict(name='data-return-child-jobs', result='SUCCESS',
3047 changes='1,1'), 3067 changes='1,1'),
diff --git a/zuul/model.py b/zuul/model.py
index 9899c92..85060b0 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -2065,8 +2065,8 @@ class QueueItem(object):
2065 """Check if any jobs have finished with a non-success result. 2065 """Check if any jobs have finished with a non-success result.
2066 2066
2067 Return True if any job in the job graph has returned with a 2067 Return True if any job in the job graph has returned with a
2068 status not equal to SUCCESS, else return False. Non-voting 2068 status not equal to SUCCESS or SKIPPED, else return False.
2069 and in-flight jobs are ignored. 2069 Non-voting and in-flight jobs are ignored.
2070 2070
2071 """ 2071 """
2072 if not self.hasJobGraph(): 2072 if not self.hasJobGraph():
@@ -2075,7 +2075,8 @@ class QueueItem(object):
2075 if not job.voting: 2075 if not job.voting:
2076 continue 2076 continue
2077 build = self.current_build_set.getBuild(job.name) 2077 build = self.current_build_set.getBuild(job.name)
2078 if build and build.result and (build.result != 'SUCCESS'): 2078 if (build and build.result and
2079 build.result not in ['SUCCESS', 'SKIPPED']):
2079 return True 2080 return True
2080 return False 2081 return False
2081 2082