Add test case for projects with one job.
This situation exposed a problem where tests for the second change would not be run if the change in front of it had one job marked hold and succeeded. Change-Id: I8f3c3bdb9d3631efc8b207a61d5a9086808cafb4 Reviewed-on: https://review.openstack.org/11818 Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
afd18ac240
commit
7f71c80362
|
@ -81,3 +81,11 @@ projects:
|
||||||
- project1-project2-integration
|
- project1-project2-integration
|
||||||
post:
|
post:
|
||||||
- project2-post
|
- project2-post
|
||||||
|
|
||||||
|
- name: org/one-job-project
|
||||||
|
check:
|
||||||
|
- one-job-project-merge
|
||||||
|
gate:
|
||||||
|
- one-job-project-merge
|
||||||
|
post:
|
||||||
|
- one-job-project-post
|
||||||
|
|
|
@ -581,6 +581,7 @@ class testScheduler(unittest.TestCase):
|
||||||
init_repo("org/project")
|
init_repo("org/project")
|
||||||
init_repo("org/project1")
|
init_repo("org/project1")
|
||||||
init_repo("org/project2")
|
init_repo("org/project2")
|
||||||
|
init_repo("org/one-job-project")
|
||||||
self.config = CONFIG
|
self.config = CONFIG
|
||||||
self.sched = zuul.scheduler.Scheduler()
|
self.sched = zuul.scheduler.Scheduler()
|
||||||
|
|
||||||
|
@ -1173,3 +1174,25 @@ class testScheduler(unittest.TestCase):
|
||||||
print ' repo messages :', repo_messages
|
print ' repo messages :', repo_messages
|
||||||
correct_messages = ['initial commit', 'mp commit', 'B-1']
|
correct_messages = ['initial commit', 'mp commit', 'B-1']
|
||||||
assert repo_messages == correct_messages
|
assert repo_messages == correct_messages
|
||||||
|
|
||||||
|
def test_one_job_project(self):
|
||||||
|
"Test that queueing works with one job"
|
||||||
|
A = self.fake_gerrit.addFakeChange('org/one-job-project',
|
||||||
|
'master', 'A')
|
||||||
|
B = self.fake_gerrit.addFakeChange('org/one-job-project',
|
||||||
|
'master', 'B')
|
||||||
|
A.addApproval('CRVW', 2)
|
||||||
|
B.addApproval('CRVW', 2)
|
||||||
|
self.fake_gerrit.addEvent(A.addApproval('APRV', 1))
|
||||||
|
self.fake_gerrit.addEvent(B.addApproval('APRV', 1))
|
||||||
|
self.waitUntilSettled()
|
||||||
|
|
||||||
|
jobs = self.fake_jenkins.all_jobs
|
||||||
|
finished_jobs = self.fake_jenkins.job_history
|
||||||
|
print jobs
|
||||||
|
print finished_jobs
|
||||||
|
|
||||||
|
assert A.data['status'] == 'MERGED'
|
||||||
|
assert A.reported == 2
|
||||||
|
assert B.data['status'] == 'MERGED'
|
||||||
|
assert B.reported == 2
|
||||||
|
|
Loading…
Reference in New Issue