jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/327177 )
Change subject: Properly inject SKIN_DEPENDENCIES
......................................................................
Properly inject SKIN_DEPENDENCIES
For mediawiki-core-selenium-jessie, we need to inject the Vector skin as
a dependency via SKIN_DEPENDENCIES. I thought about adding it directly
in the Jenkins job definition, however the Gearman plugin does not merge
Zuul parameters with the one from the job.
Remove the paramter from the job level (from 3a5661d0a) and move the
logic to the zuul parameter function.
Add tests to assert SKIN_DEPENDENCIES is injected and kept when Vector
is appended.
Since the test alter the 'dependencies' global, add some setUp/tearDown
to restore it in its original state.
Will let us refactor the mwext-mw-selenium jobs and move them to
Nodepool (T137112).
Bug: T137112
Bug: T139740
Change-Id: I82db52a5c0205cf846f3945a696004fa5f19d4d0
---
M jjb/mediawiki.yaml
M tests/test_zuul_mw_dependencies.py
M zuul/parameter_functions.py
3 files changed, 44 insertions(+), 6 deletions(-)
Approvals:
Hashar: Looks good to me, approved
jenkins-bot: Verified
diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index f0bd6eb..de1e3c0 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -59,12 +59,6 @@
name: 'mediawiki-core-selenium-jessie'
node: ci-jessie-wikimedia
concurrent: true
- parameters:
- # Inject Vector. Not done in zuul/parameters_function.py since it does not
- # process when the triggering project is mediawiki/core.
- - string:
- name: 'SKIN_DEPENDENCIES'
- default: 'mediawiki/skins/Vector'
triggers:
- zuul
properties:
diff --git a/tests/test_zuul_mw_dependencies.py
b/tests/test_zuul_mw_dependencies.py
index de6098a..5a0fc2f 100644
--- a/tests/test_zuul_mw_dependencies.py
+++ b/tests/test_zuul_mw_dependencies.py
@@ -13,6 +13,17 @@
class TestMwDependencies(unittest.TestCase):
+
+ def setUp(self):
+ # Let test mangle the 'dependencies' global
+ self._deps_copy = dependencies.copy()
+
+ def tearDown(self):
+ # Restore the 'dependencies' global from the shallow clone
+ global dependencies
+ dependencies = self._deps_copy
+ self.assertIn('AbuseFilter', dependencies)
+
def assertHasDependencies(self, params):
self.assertIn('EXT_DEPENDENCIES', params)
@@ -101,6 +112,31 @@
self.assertMissingDependencies(self.fetch_dependencies(
project='foo/bar/baz'))
+ def test_vector_skin_added_to_selenium_job(self):
+ deps = self.fetch_dependencies(
+ job_name='mediawiki-core-selenium-jessie')
+ self.assertDictContainsSubset(
+ {'SKIN_DEPENDENCIES': 'mediawiki/skins/Vector'},
+ deps
+ )
+
+ def test_vector_skin_added_to_selenium_job_on_top_of_other_deps(self):
+
+ # FoobarExt already depends on the monobook skin, we want to make sure
+ # we also inject Vector. Global is restored via setUp/tearDown
+ global dependencies
+ dependencies = {
+ 'FoobarExt': ['skins/monobook'],
+ }
+ deps = self.fetch_dependencies(
+ project='mediawiki/extensions/FoobarExt',
+ job_name='mediawiki-core-selenium-jessie')
+ self.assertIn('SKIN_DEPENDENCIES', deps)
+ self.assertEqual(
+ deps['SKIN_DEPENDENCIES'],
+ 'mediawiki/skins/monobook\\nmediawiki/skins/Vector',
+ )
+
def test_resolve_skin_on_extension(self):
mapping = {'Foo': ['skins/Vector']}
self.assertEqual(
diff --git a/zuul/parameter_functions.py b/zuul/parameter_functions.py
index afb5c11..ac300dc 100644
--- a/zuul/parameter_functions.py
+++ b/zuul/parameter_functions.py
@@ -59,6 +59,14 @@
if job.name.startswith(mw_deps_jobs_starting_with):
set_mw_dependencies(item, job, params)
+ # FIXME rather hacky for T139740
+ if job.name.startswith('mediawiki-core-selenium'):
+ set_mw_dependencies(item, job, params)
+ if params['SKIN_DEPENDENCIES']:
+ params['SKIN_DEPENDENCIES'] += '\\nmediawiki/skins/Vector'
+ else:
+ params['SKIN_DEPENDENCIES'] = 'mediawiki/skins/Vector'
+
if job.name.startswith('mediawiki-extensions-'):
set_gated_extensions(item, job, params)
--
To view, visit https://gerrit.wikimedia.org/r/327177
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I82db52a5c0205cf846f3945a696004fa5f19d4d0
Gerrit-PatchSet: 4
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits