Merge "Don't report enqueue of non-live item"
This commit is contained in:
commit
d48be299ab
@ -296,7 +296,7 @@ class FakeGerritChange(object):
|
||||
if reset:
|
||||
self.checks[checker] = {'state': 'NOT_STARTED',
|
||||
'created': str(datetime.datetime.now())}
|
||||
chk = self.checks[checker]
|
||||
chk = self.checks.setdefault(checker, {})
|
||||
chk['updated'] = str(datetime.datetime.now())
|
||||
for (key, default) in [
|
||||
('state', None),
|
||||
|
@ -284,7 +284,9 @@ class TestChecksApi(ZuulTestCase):
|
||||
|
||||
@simple_layout('layouts/gerrit-checks.yaml')
|
||||
def test_check_pipeline(self):
|
||||
B = self.fake_gerrit.addFakeChange('org/project', 'master', 'B')
|
||||
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
|
||||
A.setDependsOn(B, 1)
|
||||
A.setCheck('zuul:check', reset=True)
|
||||
self.waitForPoll('gerrit')
|
||||
self.waitUntilSettled()
|
||||
@ -308,9 +310,11 @@ class TestChecksApi(ZuulTestCase):
|
||||
self.assertEqual(A.checks_history[3]['zuul:check']['message'],
|
||||
'Change passed all voting jobs')
|
||||
self.assertHistory([
|
||||
dict(name='test-job', result='SUCCESS', changes='1,1')])
|
||||
dict(name='test-job', result='SUCCESS', changes='1,1 2,1')])
|
||||
self.assertEqual(A.reported, 0, "no messages should be reported")
|
||||
self.assertEqual(A.messages, [], "no messages should be reported")
|
||||
# Make sure B was never updated
|
||||
self.assertEqual(len(B.checks_history), 0)
|
||||
|
||||
@simple_layout('layouts/gerrit-checks.yaml')
|
||||
def test_gate_pipeline(self):
|
||||
|
@ -354,7 +354,7 @@ class PipelineManager(object):
|
||||
item.live = live
|
||||
self.reportStats(item)
|
||||
item.quiet = quiet
|
||||
if not item.reported_enqueue:
|
||||
if item.live and not item.reported_enqueue:
|
||||
self.reportEnqueue(item)
|
||||
item.reported_enqueue = True
|
||||
self.enqueueChangesBehind(change, event, quiet,
|
||||
|
Loading…
Reference in New Issue
Block a user