jenkins-bot has submitted this change and it was merged. Change subject: test: simplify zuul_project_in_gerrit ......................................................................
test: simplify zuul_project_in_gerrit Reuse the logic from test_zuul_coverage and integrate the test there making it fairly trivial. Change-Id: I6e968c4095e2c56996dcd638e71ceb0c3649f4f5 --- M tests/test_zuul_coverage.py D tests/test_zuul_project_in_gerrit.py 2 files changed, 9 insertions(+), 39 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/test_zuul_coverage.py b/tests/test_zuul_coverage.py index be548d1..610ecb8 100644 --- a/tests/test_zuul_coverage.py +++ b/tests/test_zuul_coverage.py @@ -55,3 +55,12 @@ def test_all_skins_have_gate_and_submit(self): self.assert_have_gate_and_submit('mediawiki/skins/') + + # FIXME should compare against ACTIVE + READ-ONLY repos ??? + def test_zuul_projects_in_gerrit(self): + zuul = set(self.getLayoutProjects()) + gerrit = set(self._repos.keys()) + self.longMessage = True + self.assertEqual( + [], sorted((zuul & gerrit) ^ zuul), + 'Projects configured in Zuul but no more active in Gerrit') diff --git a/tests/test_zuul_project_in_gerrit.py b/tests/test_zuul_project_in_gerrit.py deleted file mode 100644 index 3225840..0000000 --- a/tests/test_zuul_project_in_gerrit.py +++ /dev/null @@ -1,39 +0,0 @@ -import json -import os -import urllib2 - -from nose.plugins.attrib import attr -import yaml - -GERRIT_URL = 'https://gerrit.wikimedia.org/r/projects/?type=code' -ZUUL_LAYOUT = os.path.join(os.path.dirname(__file__), '../zuul/layout.yaml') - - -def get_gerrit_repos(): - """ - Connect to gerrit.wikimedia.org to retrieve a list of public projects. - - Returns a sorted list of project names - """ - request = urllib2.urlopen(GERRIT_URL) - # Strip Gerrit json harness: )]}' - request.readline() - projects = json.load(request) - return sorted(projects.keys()) - - -GERRIT_REPOS = get_gerrit_repos() - - -@attr('qa') -def test_zuul_project_in_gerrit(): - - with open(ZUUL_LAYOUT) as f: - layout = yaml.load(f) - for pj in layout.get('projects'): - yield is_in_gerrit, pj.get('name') - - -def is_in_gerrit(zuul_project): - msg = "Project configured in Zuul is not in Gerrit: %s" % (zuul_project) - assert zuul_project in GERRIT_REPOS, msg -- To view, visit https://gerrit.wikimedia.org/r/323845 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e968c4095e2c56996dcd638e71ceb0c3649f4f5 Gerrit-PatchSet: 2 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Hashar <has...@free.fr> Gerrit-Reviewer: Hashar <has...@free.fr> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits