Don't use RecordingMergeClient.history in TestNonLiveMerges
Currently, the history of the scheduler's merge client is used to assert the correct number of executed merge jobs. This won't work in a multi-scheduler setup as we can't say for sure which scheduler submitted which merge jobs. Instead, we use the merge_job_history property which gives a condensed view on the history of all merger APIs that are used within the test. Change-Id: Ib6240a9548015954024ba4de760b5de361d4428d
This commit is contained in:
parent
596315785f
commit
fac78226fc
|
@ -3208,8 +3208,9 @@ class TestNonLiveMerges(ZuulTestCase):
|
|||
|
||||
# We expect one merge call per live change, plus one call for
|
||||
# each non-live change with a config update (which is all of them).
|
||||
self.assertEqual(
|
||||
len(self.scheds.first.sched.merger.history[MergeRequest.MERGE]), 6)
|
||||
merge_jobs = [job for job in self.merge_job_history.values()
|
||||
if job.job_type == MergeRequest.MERGE]
|
||||
self.assertEqual(len(merge_jobs), 6)
|
||||
|
||||
def test_non_live_merges(self):
|
||||
"""
|
||||
|
@ -3232,8 +3233,9 @@ class TestNonLiveMerges(ZuulTestCase):
|
|||
self.waitUntilSettled()
|
||||
|
||||
# We expect one merge call per live change.
|
||||
self.assertEqual(
|
||||
len(self.scheds.first.sched.merger.history[MergeRequest.MERGE]), 3)
|
||||
merge_jobs = [job for job in self.merge_job_history.values()
|
||||
if job.job_type == MergeRequest.MERGE]
|
||||
self.assertEqual(len(merge_jobs), 3)
|
||||
|
||||
|
||||
class TestJobContamination(AnsibleZuulTestCase):
|
||||
|
|
Loading…
Reference in New Issue