jenkins-bot has submitted this change and it was merged.
Change subject: Assert gate jobs are properly configured
......................................................................
Assert gate jobs are properly configured
In the JJB templates for mediawiki-extensions-* jobs, we define a list
of extensions participating and the jobs must be triggered by all
projects.
There is nothing preventing to add the trigger to Zuul without updating
the Jenkins jobs. Nor is there anything preventing to add a dependency
in the job which is not triggering it.
Introduce a test to assert JJB <-> Zuul are in sync.
CirrusSearch has been triggering the gate though it is not even defined
as a dependency in the Jenkins jobs. That has been covered by 297dff88.
List repositories in Zuul having extension-gate and assert the set is
equal to the list of dependencies in mediawiki-extensions-* jobs.
Change-Id: I9dc6e4ada3fd0686428a0b6cc42db07d4eeac60c
---
M tests/test_zuul_layout.py
1 file changed, 37 insertions(+), 0 deletions(-)
Approvals:
Hashar: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/test_zuul_layout.py b/tests/test_zuul_layout.py
index f56ba0d..eff8310 100644
--- a/tests/test_zuul_layout.py
+++ b/tests/test_zuul_layout.py
@@ -8,6 +8,7 @@
import os
import unittest
+import yaml
import zuul.scheduler
from zuul.scheduler import ReconfigureEvent
import zuul.model
@@ -441,3 +442,39 @@
},
]
self.assertTrue(test_manager.eventMatches(event, change))
+
+ def test_gated_extensions_are_both_in_jjb_and_zuul(self):
+ self.longMessage = True
+
+ # Grab deps from the JJB template mediawiki-extensions-{phpflavor}
+ jjb_mw_file = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ '../jjb/mediawiki.yaml')
+ with open(jjb_mw_file, 'r') as f:
+ jjb = yaml.load(f)
+
+ mw_project = next(entry['project'] for entry in jjb
+ if 'project' in entry
+ and entry['project'].get('name') == 'mediawiki-core')
+ jjb_gate_template = next(
+ job['mediawiki-extensions-{phpflavor}']
+ for job in mw_project['jobs']
+ if isinstance(job, dict)
+ and job.keys()[0] == 'mediawiki-extensions-{phpflavor}')
+ # List of extensions basenames
+ jjb_deps = set(jjb_gate_template['dependencies'].splitlines())
+
+ # Grab projects having the gate job 'mediawiki-extensions-hhvm'
+ gated_in_zuul = set([
+ ext_name[len('mediawiki/extensions/'):] # extension basename
+ for (ext_name, pipelines) in self.getProjectsDefs().iteritems()
+ if ext_name.startswith('mediawiki/extensions/')
+ and 'mediawiki-extensions-hhvm' in pipelines.get('test', {})
+ ])
+
+ self.assertSetEqual(
+ gated_in_zuul, jjb_deps, msg='Zuul projects triggering gate jobs '
+ '(first set) and dependencies list in JJB (second set) must be '
+ 'equals.\n'
+ 'In Zuul: apply the template extension-gate\n'
+ 'In JJB: add extension to "gatedextensions"')
--
To view, visit https://gerrit.wikimedia.org/r/259711
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9dc6e4ada3fd0686428a0b6cc42db07d4eeac60c
Gerrit-PatchSet: 5
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits