Merge "Don't set child jobs to skipped on post failure"
This commit is contained in:
commit
d60346181b
|
@ -0,0 +1,17 @@
|
||||||
|
- pipeline:
|
||||||
|
name: check
|
||||||
|
manager: independent
|
||||||
|
post-review: true
|
||||||
|
trigger:
|
||||||
|
gerrit:
|
||||||
|
- event: patchset-created
|
||||||
|
success:
|
||||||
|
gerrit:
|
||||||
|
Verified: 1
|
||||||
|
failure:
|
||||||
|
gerrit:
|
||||||
|
Verified: -1
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: base
|
||||||
|
parent: null
|
|
@ -0,0 +1 @@
|
||||||
|
test
|
|
@ -0,0 +1,4 @@
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
- fail:
|
||||||
|
msg: Fail in post
|
|
@ -0,0 +1,7 @@
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: Pause and let child run
|
||||||
|
zuul_return:
|
||||||
|
data:
|
||||||
|
zuul:
|
||||||
|
pause: true
|
|
@ -0,0 +1,2 @@
|
||||||
|
- hosts: all
|
||||||
|
tasks: []
|
|
@ -0,0 +1,16 @@
|
||||||
|
- job:
|
||||||
|
name: compile
|
||||||
|
run: playbooks/compile.yaml
|
||||||
|
post-run: playbooks/compile-post.yaml
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: test
|
||||||
|
run: playbooks/test.yaml
|
||||||
|
|
||||||
|
- project:
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- compile
|
||||||
|
- test:
|
||||||
|
dependencies:
|
||||||
|
- compile
|
|
@ -0,0 +1,7 @@
|
||||||
|
- tenant:
|
||||||
|
name: tenant-one
|
||||||
|
source:
|
||||||
|
gerrit:
|
||||||
|
config-projects:
|
||||||
|
- common-config
|
||||||
|
- org/project
|
|
@ -4592,6 +4592,15 @@ class TestJobPause(AnsibleZuulTestCase):
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
def test_job_pause(self):
|
def test_job_pause(self):
|
||||||
|
"""
|
||||||
|
compile1
|
||||||
|
+--> compile2
|
||||||
|
| +--> test-after-compile2
|
||||||
|
+--> test1-after-compile1
|
||||||
|
+--> test2-after-compile1
|
||||||
|
test-good
|
||||||
|
test-fail
|
||||||
|
"""
|
||||||
|
|
||||||
self.wait_timeout = 120
|
self.wait_timeout = 120
|
||||||
|
|
||||||
|
@ -4721,6 +4730,34 @@ class TestJobPause(AnsibleZuulTestCase):
|
||||||
self.assertIn('test : SKIPPED', A.messages[0])
|
self.assertIn('test : SKIPPED', A.messages[0])
|
||||||
|
|
||||||
|
|
||||||
|
class TestJobPausePostFail(AnsibleZuulTestCase):
|
||||||
|
tenant_config_file = 'config/job-pause2/main.yaml'
|
||||||
|
|
||||||
|
def _get_file(self, build, path):
|
||||||
|
p = os.path.join(build.jobdir.root, path)
|
||||||
|
with open(p) as f:
|
||||||
|
return f.read()
|
||||||
|
|
||||||
|
def test_job_pause_post_fail(self):
|
||||||
|
"""Tests that a parent job which has a post failure does not
|
||||||
|
retroactively set its child job's result to SKIPPED.
|
||||||
|
|
||||||
|
compile
|
||||||
|
+--> test
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Output extra ansible info so we might see errors.
|
||||||
|
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
|
||||||
|
|
||||||
|
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
|
||||||
|
self.waitUntilSettled()
|
||||||
|
|
||||||
|
self.assertHistory([
|
||||||
|
dict(name='test', result='SUCCESS', changes='1,1'),
|
||||||
|
dict(name='compile', result='POST_FAILURE', changes='1,1'),
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
class TestContainerJobs(AnsibleZuulTestCase):
|
class TestContainerJobs(AnsibleZuulTestCase):
|
||||||
tenant_config_file = "config/container-build-resources/main.yaml"
|
tenant_config_file = "config/container-build-resources/main.yaml"
|
||||||
|
|
||||||
|
|
|
@ -2410,9 +2410,11 @@ class QueueItem(object):
|
||||||
build.job.name)
|
build.job.name)
|
||||||
|
|
||||||
for job in skipped:
|
for job in skipped:
|
||||||
fakebuild = Build(job, None)
|
child_build = self.current_build_set.getBuild(job.name)
|
||||||
fakebuild.result = 'SKIPPED'
|
if not child_build:
|
||||||
self.addBuild(fakebuild)
|
fakebuild = Build(job, None)
|
||||||
|
fakebuild.result = 'SKIPPED'
|
||||||
|
self.addBuild(fakebuild)
|
||||||
|
|
||||||
def setNodeRequestFailure(self, job):
|
def setNodeRequestFailure(self, job):
|
||||||
fakebuild = Build(job, None)
|
fakebuild = Build(job, None)
|
||||||
|
|
Loading…
Reference in New Issue