Page MenuHomePhabricator

TestValidTemplate.test_archivebot_archiveheader_io and test_redirect_broken_redirect_template_io are failing
Closed, ResolvedPublic

Description

https://travis-ci.org/wikimedia/pywikibot/jobs/362524875#L4033

______________ TestValidTemplate.test_archivebot_archiveheader_io ______________
self = <tests.l10n_tests.TestValidTemplate testMethod=test_archivebot_archiveheader_io>
    def test_template(self):
        """Test validity of template."""
        lang = site.lang
        if lang not in keys:
            return
        msg = i18n.twtranslate(lang, package, fallback=False)
        if msg:
            # check whether the message contains a template
            templates = extract_templates_and_params_regex_simple(msg)
            self.assertIsInstance(templates, list)
            self.assertGreater(len(templates), 0)
    
            # known problem
            if site.code == 'simple':
                raise unittest.SkipTest(
                    "'simple' wiki has 'en' language code but "
                    "missing template. Must be solved by the "
                    "corresponding script.")
            # check whether template exists
            title = templates[0][0]
            page = pywikibot.Page(site, title, ns=10)
>           self.assertTrue(page.exists())
E           AssertionError: False is not true
tests/l10n_tests.py:52: AssertionError
_________ TestValidTemplate.test_redirect_broken_redirect_template_io __________
self = <tests.l10n_tests.TestValidTemplate testMethod=test_redirect_broken_redirect_template_io>
    def test_template(self):
        """Test validity of template."""
        lang = site.lang
        if lang not in keys:
            return
        msg = i18n.twtranslate(lang, package, fallback=False)
        if msg:
            # check whether the message contains a template
            templates = extract_templates_and_params_regex_simple(msg)
            self.assertIsInstance(templates, list)
            self.assertGreater(len(templates), 0)
    
            # known problem
            if site.code == 'simple':
                raise unittest.SkipTest(
                    "'simple' wiki has 'en' language code but "
                    "missing template. Must be solved by the "
                    "corresponding script.")
            # check whether template exists
            title = templates[0][0]
            page = pywikibot.Page(site, title, ns=10)
>           self.assertTrue(page.exists())
E           AssertionError: False is not true

Event Timeline

Dalba triaged this task as High priority.Apr 5 2018, 9:42 AM

Looks like a wrong template was given for io language in twn

I removed the Archivebot-archiveheader/io entry at twn but the test_redirect_broken_redirect_template_io error is curious because there is no corresponding entry for that template yet. I think the assert message should be expanded.

Change 424258 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/i18n@master] [bugfix] remove invalid io template which does not exist

https://gerrit.wikimedia.org/r/424258

Change 424258 merged by jenkins-bot:
[pywikibot/i18n@master] [bugfix] remove invalid io template which does not exist

https://gerrit.wikimedia.org/r/424258

Change 424284 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] give a more precise message when L10N test fails

https://gerrit.wikimedia.org/r/424284

The other msg doesn't failed anymore. Is there any unwanted side effect?
https://travis-ci.org/wikimedia/pywikibot

Dalba closed this task as Resolved.EditedApr 5 2018, 12:22 PM

Everything looks fine.

TestValidTemplate is one of the slowest test suites. It takes nearly 4 minutes on my computer. I was wondering if we could somehow speed it up or if we need to check them all on all builds... That'll be another task though.

Change 424284 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] give a more precise message when L10N test fails

https://gerrit.wikimedia.org/r/424284

Everything looks fine.

TestValidTemplate is one of the slowest test suits. It takes nearly 4 minutes on my computer. I wondering if we could somehow speed it up or if we need to check them all on all builds... That'll be another task though.

We have only two packages to check but be have to do it for all given languages this are 600 checks on live wikis whether the message is valid i.e. the templates exists. No idea to speed this up.

Maybe we could have TestSites tests without net connection