Page MenuHomePhabricator

test_create_short_link fails again at Github
Closed, ResolvedPublic

Description

test_create_short_link fails again at Appveyor since few days even the bot is logged in:

[00:29:30] ======================================================================
[00:29:30] ERROR: test_create_short_link (tests.page_tests.TestShortLink)
[00:29:30] Test create_short_link function.
[00:29:30] ----------------------------------------------------------------------
[00:29:30] Traceback (most recent call last):
[00:29:30]   File "C:\projects\pywikibot-g4xqx\tests\page_tests.py", line 1276, in test_create_short_link
[00:29:30]     self.assertEqual(p1.create_short_link(), 'https://w.wiki/3Cy')
[00:29:30]   File "C:\projects\pywikibot-g4xqx\pywikibot\page\__init__.py", line 2320, in create_short_link
[00:29:30]     link = wiki.create_short_link(url)
[00:29:30]   File "C:\projects\pywikibot-g4xqx\pywikibot\site\__init__.py", line 1391, in callee
[00:29:30]     return fn(self, *args, **kwargs)
[00:29:30]   File "C:\projects\pywikibot-g4xqx\pywikibot\site\__init__.py", line 7628, in create_short_link
[00:29:30]     data = req.submit()
[00:29:30]   File "C:\projects\pywikibot-g4xqx\pywikibot\data\api.py", line 2113, in submit
[00:29:30]     raise APIError(**result['error'])
[00:29:30] APIError: urlshortener-blocked: Blocked users can't make short URLs.
[00:29:30] [current site: meta:meta;
[00:29:30]  current user: Pywikibot-test;
[00:29:30]  help: See https://meta.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.]
[00:29:30] 
[00:29:30] ----------------------------------------------------------------------
[00:29:30] Ran 1899 tests in 1682.625s

See also T244062

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Xqt triaged this task as High priority.Jun 27 2020, 4:14 PM
Xqt updated the task description. (Show Details)

I guess this is due to this local IP block: https://meta.wikimedia.org/wiki/Special:BlockList?wpTarget=67.225.165.185&blockType=&limit=50&wpFormIdentifier=blocklist

@Urbanecm: Could you please grant local IP block exempt for Pywikibot-test and Pywikibot-oauth at meta please. Or remove the local IP block because the IP range is blocked globally already.

Granted. Removing the block is not a good idea, as global blocks do not take effect at Meta.

Granted. Removing the block is not a good idea, as global blocks do not take effect at Meta.

Thanks a lot.

Xqt claimed this task.
Xqt reassigned this task from Xqt to Urbanecm.
Xqt added a project: Upstream.

reopened due to:

======================================================================
ERROR: test_create_short_link (tests.page_tests.TestShortLink) (permalink=True)
Test create_short_link function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pywikibot/pywikibot/tests/page_tests.py", line 1246, in test_create_short_link
    self.assertEqual(p1.create_short_link(permalink=True,
  File "/home/runner/work/pywikibot/pywikibot/pywikibot/page/__init__.py", line 2072, in create_short_link
    link = wiki.create_short_link(url)
  File "/home/runner/work/pywikibot/pywikibot/pywikibot/site/_decorators.py", line 60, in callee
    return fn(self, *args, **kwargs)
  File "/home/runner/work/pywikibot/pywikibot/pywikibot/site/_extensions.py", line 709, in create_short_link
    data = req.submit()
  File "/home/runner/work/pywikibot/pywikibot/pywikibot/data/api.py", line 1877, in submit
    raise pywikibot.exceptions.APIError(**result['error'])
pywikibot.exceptions.APIError: urlshortener-blocked: Blocked users can't make short URLs.
[help: See https://meta.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes.;
 current site: meta:meta;
 current user: 20.115.157.169]
----------------------------------------------------------------------

https://github.com/wikimedia/pywikibot/runs/5158724884?check_suite_focus=true

Seems test account isn't logged in here.

Xqt renamed this task from test_create_short_link fails again at Appveyor to test_create_short_link fails again at Github.Feb 11 2022, 6:24 PM

Change 761968 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [tests] skip test_create_short_link if login fails.

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

Change 761968 merged by jenkins-bot:

[pywikibot/core@master] [tests] skip test_create_short_link if login fails.

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