Remove check that gerrit reporter has params

Since reporters must be specified now (after we added the ability
to have multiple reporters), the right way to make a silent pipeline
is to have no reporters, and the right way to have an experimental
pipeline (non-voting but reporting) is to have a reporter with no
parameters.

Change-Id: I5c979f0d2a6aafe5de4d60d8ce245d9bdcd73dae
This commit is contained in:
James E. Blair 2014-04-28 13:55:14 -07:00
parent f4cbfbd5a6
commit badc1ad870
3 changed files with 25 additions and 4 deletions

View File

@ -93,6 +93,16 @@ pipelines:
gerrit:
verified: 0
- name: experimental
manager: IndependentPipelineManager
trigger:
gerrit:
- event: patchset-created
success:
gerrit: {}
failure:
gerrit: {}
jobs:
- name: ^.*-merge$
failure-message: Unable to merge change
@ -230,3 +240,7 @@ projects:
- name: org/noop-project
gate:
- noop
- name: org/experimental-project
experimental:
- experimental-project-test

View File

@ -811,6 +811,7 @@ class TestScheduler(testtools.TestCase):
self.init_repo("org/node-project")
self.init_repo("org/conflict-project")
self.init_repo("org/noop-project")
self.init_repo("org/experimental-project")
self.statsd = FakeStatsd()
os.environ['STATSD_HOST'] = 'localhost'
@ -3969,3 +3970,13 @@ For CI problems and help debugging, contact ci@example.org"""
running_items = client.get_running_jobs()
self.assertEqual(0, len(running_items))
def test_nonvoting_pipeline(self):
"Test that a nonvoting pipeline (experimental) can still report"
A = self.fake_gerrit.addFakeChange('org/experimental-project', 'master', 'A')
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
self.waitUntilSettled()
self.assertEqual(self.getJobFromHistory('experimental-project-test').result,
'SUCCESS')
self.assertEqual(A.reported, 1)

View File

@ -30,10 +30,6 @@ class Reporter(object):
"""Send a message to gerrit."""
self.log.debug("Report change %s, params %s, message: %s" %
(change, params, message))
if not params:
self.log.debug("Not reporting change %s: No params specified." %
change)
return
changeid = '%s,%s' % (change.number, change.patchset)
change._ref_sha = self.trigger.getRefSha(change.project.name,
'refs/heads/' + change.branch)