Fix testr configuration
* Correct passing env vars in testr.conf. * Use ZUUL_TEST_ROOT correctly when building the tempdir for the local git dir for tests. * Remove some tabs from docs. * Update test gearman server method override to match current gear. * Make test_failed_changes more deterministic: this test occasionally failed due to races in the test. * Update the fake logger configuration to match previous usage. Change-Id: I1850b930e37d9a0fd2e9c8098052cf7df60576af Reviewed-on: https://review.openstack.org/35404 Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
e6a6c403db
commit
e2819012fa
|
@ -120,8 +120,8 @@ plugin as follows::
|
|||
Refspec: ${ZUUL_REF}
|
||||
Branches to build:
|
||||
Branch Specifier: ${ZUUL_COMMIT}
|
||||
Advanced:
|
||||
Clean after checkout: True
|
||||
Advanced:
|
||||
Clean after checkout: True
|
||||
|
||||
That should be sufficient for a job that only builds a single project.
|
||||
If you have multiple interrelated projects (i.e., they share a Zuul
|
||||
|
|
|
@ -628,6 +628,9 @@ class FakeGearmanServer(gear.Server):
|
|||
if job.name in connection.functions:
|
||||
if not peek:
|
||||
queue.remove(job)
|
||||
connection.related_jobs[job.handle] = job
|
||||
job.worker_connection = connection
|
||||
job.running = True
|
||||
return job
|
||||
return None
|
||||
|
||||
|
@ -682,9 +685,12 @@ class TestScheduler(testtools.TestCase):
|
|||
self.useFixture(fixtures.NestedTempfile())
|
||||
if (os.environ.get('OS_LOG_CAPTURE') == 'True' or
|
||||
os.environ.get('OS_LOG_CAPTURE') == '1'):
|
||||
self.useFixture(fixtures.FakeLogger())
|
||||
|
||||
tmp_root = os.environ.get("ZUUL_TEST_ROOT", tempfile.mkdtemp())
|
||||
self.useFixture(fixtures.FakeLogger(
|
||||
level=logging.DEBUG,
|
||||
format='%(asctime)s %(name)-32s '
|
||||
'%(levelname)-8s %(message)s'))
|
||||
tmp_root = tempfile.mkdtemp(dir=os.environ.get("ZUUL_TEST_ROOT",
|
||||
'/tmp'))
|
||||
self.test_root = os.path.join(tmp_root, "zuul-test")
|
||||
self.upstream_root = os.path.join(self.test_root, "upstream")
|
||||
self.git_root = os.path.join(self.test_root, "git")
|
||||
|
@ -1135,18 +1141,28 @@ class TestScheduler(testtools.TestCase):
|
|||
|
||||
def test_failed_changes(self):
|
||||
"Test that a change behind a failed change is retested"
|
||||
self.worker.hold_jobs_in_build = True
|
||||
|
||||
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
|
||||
B = self.fake_gerrit.addFakeChange('org/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.worker.addFailTest('project-test1', A)
|
||||
|
||||
self.fake_gerrit.addEvent(A.addApproval('APRV', 1))
|
||||
self.fake_gerrit.addEvent(B.addApproval('APRV', 1))
|
||||
self.waitUntilSettled()
|
||||
|
||||
self.worker.release('.*-merge')
|
||||
self.waitUntilSettled()
|
||||
|
||||
self.worker.hold_jobs_in_build = False
|
||||
self.worker.release()
|
||||
|
||||
self.waitUntilSettled()
|
||||
# It's certain that the merge job for change 2 will run, but
|
||||
# the test1 and test2 jobs may or may not run.
|
||||
assert len(self.history) > 6
|
||||
assert A.data['status'] == 'NEW'
|
||||
assert B.data['status'] == 'MERGED'
|
||||
|
|
Loading…
Reference in New Issue