Page MenuHomePhabricator

CI tests are failing on tests.file_tests.TestMediaInfoReadonlyEditing
Closed, DuplicatePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Merge a patch :)

What happens?:

  • Post-merge build fails

What should have happened instead?:

  • Post-merge build should succeed :)

Other information (browser name/version, screenshots, etc.):

This test is failing. Example output log for https://gerrit.wikimedia.org/r/c/pywikibot/core/+/990720 is shown below:

...
11:01:43 ======================================================================
11:01:43 ERROR: test_edit_claims (tests.file_tests.TestMediaInfoReadonlyEditing)
11:01:43 Test claim editing without writing rights.
11:01:43 ----------------------------------------------------------------------
11:01:43 Traceback (most recent call last):
11:01:43   File "/src/pywikibot/login.py", line 102, in __init__
11:01:43     user = code_to_usr.get(site.code) or code_to_usr['*']
11:01:43 KeyError: '*'
11:01:43 
11:01:43 During handling of the above exception, another exception occurred:
11:01:43 
11:01:43 Traceback (most recent call last):
11:01:43   File "/src/tests/file_tests.py", line 533, in test_edit_claims
11:01:43     item.addClaim(new_claim)
11:01:43   File "/src/pywikibot/page/_wikibase.py", line 533, in addClaim
11:01:43     self.repo.addClaim(self, claim, bot=bot, **kwargs)
11:01:43   File "/src/pywikibot/site/_decorators.py", line 86, in callee
11:01:43     return fn(self, *args, **kwargs)
11:01:43   File "/src/pywikibot/site/_datasite.py", line 344, in addClaim
11:01:43     'token': self.tokens['csrf'],
11:01:43   File "/src/pywikibot/site/_tokenwallet.py", line 39, in __getitem__
11:01:43     self.site.login()
11:01:43   File "/src/pywikibot/site/_apisite.py", line 432, in login
11:01:43     user=self.username())
11:01:43   File "/src/pywikibot/login.py", line 110, in __init__
11:01:43     "'myUsername'".format(site=site))
11:01:43 pywikibot.exceptions.NoUsernameError: ERROR: username for commons:beta is undefined.
11:01:43 If you have a username for that site, please add a line to user config file (user_config.py) as follows:
11:01:43 usernames['commons']['beta'] = 'myUsername'

Event Timeline

Huji triaged this task as Unbreak Now! priority.Jan 24 2024, 10:45 PM
Huji added a subscriber: Xqt.

Whomever fixes this, can you also kindly specify where the user_config settings for CI is stored? I cannot find it in https://gerrit.wikimedia.org/r/plugins/gitiles/integration/config/+/refs/heads/master/zuul/layout.yaml .. and nor should I, because it should involve a password or BotPassword of sorts, I guess?

JJMC89 lowered the priority of this task from Unbreak Now! to Needs Triage.Jan 26 2024, 6:25 AM

@Xqt any idea how it magically got fixed? And how to prevent it in future?

@Huji: This is nit fixed but the failure is skipped until the test is modified. There is nothing to do with user-config settings, CI runs with anonymous users. The problem is that user rights was changed for IPs at beta-commons, refer the other task for it.