Page MenuHomePhabricator

deletionbot_tests fails due to missing usernames in user-config.py
Closed, ResolvedPublicBUG REPORT

Description

TestDeletionBot.test_dry of deletionbot_tests fails:

https://ci.appveyor.com/project/Ladsgroup/pywikibot-g4xqx/builds/30478340/job/lndoekixp8nb59wk

[00:25:21] ======================================================================
[00:25:21] ERROR: test_dry (tests.deletionbot_tests.TestDeletionBot)
[00:25:21] Test dry run of bot.
[00:25:21] ----------------------------------------------------------------------
[00:25:21] Traceback (most recent call last):
[00:25:21]   File "c:\projects\pywikibot-g4xqx\tests\deletionbot_tests.py", line 107, in test_dry
[00:25:21]     delete.main('-page:Main Page', '-always', '-summary:foo')
[00:25:21]   File "c:\projects\pywikibot-g4xqx\scripts\delete.py", line 302, in main
[00:25:21]     bot.run()
[00:25:21]   File "c:\projects\pywikibot-g4xqx\pywikibot\bot.py", line 1724, in run
[00:25:21]     super(MultipleSitesBot, self).run()
[00:25:21]   File "c:\projects\pywikibot-g4xqx\pywikibot\bot.py", line 1527, in run
[00:25:21]     self.treat(page)
[00:25:21]   File "c:\projects\pywikibot-g4xqx\pywikibot\bot.py", line 1812, in treat
[00:25:21]     self.treat_page()
[00:25:21]   File "c:\projects\pywikibot-g4xqx\scripts\delete.py", line 218, in treat_page
[00:25:21]     self.site.login()
[00:25:21]   File "c:\projects\pywikibot-g4xqx\pywikibot\tools\__init__.py", line 1757, in wrapper
[00:25:21]     return obj(*__args, **__kw)
[00:25:21]   File "c:\projects\pywikibot-g4xqx\pywikibot\site.py", line 2066, in login
[00:25:21]     login_manager = api.LoginManager(site=self, user=self.username())
[00:25:21]   File "c:\projects\pywikibot-g4xqx\pywikibot\tools\__init__.py", line 1757, in wrapper
[00:25:21]     return obj(*__args, **__kw)
[00:25:21]   File "c:\projects\pywikibot-g4xqx\pywikibot\login.py", line 96, in __init__
[00:25:21]     .format(site=site))
[00:25:21] NoUsername: ERROR: username for wikipedia:test is undefined.
[00:25:21] If you have a username for that site, please add a line to user-config.py as follows:
[00:25:21] usernames['wikipedia']['test'] = 'myUsername'
[00:25:21]

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript

It occurrs after changing testwiki to wikipedia family in tests:

  • Either there is missing a username for wikipedia family in that test case in tests
  • Or this change revealed an issue with username handling in deletionbot
  • Or this change revealed an issue with DrySite there in tests

?

MarcoAurelio renamed this task from deletionbot_tests fails due to missing usernames in uer-config.py to deletionbot_tests fails due to missing usernames in user-config.py.Jan 31 2020, 10:41 PM

probably the user-config.py contains usernames['test']['test'] = 'myUsername' instead of usernames['wikipedia']['test'] = 'myUsername' but I've no glue where this can be set.

Change 572877 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [bugfix] Fix TestDeletionBot missing user

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

Change 572877 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Fix TestDeletionBot missing user

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

Dvorapa claimed this task.
Dvorapa moved this task from Backlog to Test failures on the Pywikibot-tests board.
Dvorapa changed the subtype of this task from "Task" to "Bug Report".