Re-enable test_one_job_project unit test
Create a new configuration project specific to one-job-project. Once
created using the new zuulv3 syntax, the test just worked.
Change-Id: Iba61970ddb2aafbebd0c326dce4b85ae72e35f02
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index f919f2b..c9005f0 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -1227,24 +1227,6 @@
self.assertNotEqual(commit_A, commit_B, commit_C)
@skip("Disabled for early v3 development")
- 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('code-review', 2)
- B.addApproval('code-review', 2)
- self.fake_gerrit.addEvent(A.addApproval('approved', 1))
- self.fake_gerrit.addEvent(B.addApproval('approved', 1))
- self.waitUntilSettled()
-
- self.assertEqual(A.data['status'], 'MERGED')
- self.assertEqual(A.reported, 2)
- self.assertEqual(B.data['status'], 'MERGED')
- self.assertEqual(B.reported, 2)
-
- @skip("Disabled for early v3 development")
def test_job_from_templates_launched(self):
"Test whether a job generated via a template can be launched"
@@ -4676,3 +4658,24 @@
self.assertIn('dup2', A.messages[1])
self.assertNotIn('dup1', A.messages[1])
self.assertIn('project-test1', A.messages[1])
+
+
+class TestSchedulerOneJobProject(ZuulTestCase):
+ tenant_config_file = 'config/one-job-project/main.yaml'
+
+ 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('code-review', 2)
+ B.addApproval('code-review', 2)
+ self.fake_gerrit.addEvent(A.addApproval('approved', 1))
+ self.fake_gerrit.addEvent(B.addApproval('approved', 1))
+ self.waitUntilSettled()
+
+ self.assertEqual(A.data['status'], 'MERGED')
+ self.assertEqual(A.reported, 2)
+ self.assertEqual(B.data['status'], 'MERGED')
+ self.assertEqual(B.reported, 2)