Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/198185
Change subject: Add test to verify every extension+skin has an entry in zuul/layout.yaml ...................................................................... Add test to verify every extension+skin has an entry in zuul/layout.yaml Change-Id: I05d7504e0fc29300f78934158c4c24a259de93db --- A tests/test_zuul_coverage.py 1 file changed, 51 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/85/198185/1 diff --git a/tests/test_zuul_coverage.py b/tests/test_zuul_coverage.py new file mode 100644 index 0000000..e80e3e8 --- /dev/null +++ b/tests/test_zuul_coverage.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python2 +""" +Checks repository coverage, specifically that we cover +all MediaWiki extensions and repositories +""" + +import json +import os +import unittest +import urllib +import yaml + + +class TestZuulCoverage(unittest.TestCase): + + maxDiff = None + + def getExtDistRepos(self): + req = urllib.urlopen( + 'https://www.mediawiki.org/w/api.php?action=query' + '&list=extdistrepos&format=json&continue' + ) + data = json.load(req) + req.close() + return data['query']['extdistrepos'] + + def getLayoutProjects(self): + layout = os.path.join( + os.path.dirname(os.path.abspath(__file__)), + '../zuul/layout.yaml') + with open(layout) as f: + projects = [p['name'] for p in yaml.safe_load(f)['projects']] + return projects + + def test_all_extensions_have_gate_and_submit(self): + projects = self.getLayoutProjects() + extensions = self.getExtDistRepos()['extensions'] + missing = [] + for extension in extensions: + if 'mediawiki/extensions/%s' % extension not in projects: + missing.append(extension) + self.assertEqual([], missing) + + def test_all_skins_have_gate_and_submit(self): + projects = self.getLayoutProjects() + skins = self.getExtDistRepos()['skins'] + missing = [] + for skin in skins: + if 'mediawiki/skins/%s' % skin not in projects: + missing.append(skin) + self.assertEqual([], missing) -- To view, visit https://gerrit.wikimedia.org/r/198185 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05d7504e0fc29300f78934158c4c24a259de93db Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Legoktm <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
