Page MenuHomePhabricator

All script_tests fails at appveyor
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce:

  • Running script_test on appveyor, all tests fail and commonscat test halts (or runs infinitely)

What happens?:

  • Running the test locally works as expected:

pwb.py script_tests -v TestScriptHelp.test_commonscat

C:\pwb\GIT\core>pwb.py script_tests -v TestScriptHelp.test_commonscat
tests: max_retries reduced from 15 to 1
commons_information depends on mwparserfromhell, which isn't available
patrol depends on mwparserfromhell, which isn't available
weblinkchecker depends on memento_client, which isn't available
test_commonscat (__main__.TestScriptHelp)
Test running commonscat -help. ... ok

----------------------------------------------------------------------
Ran 1 test in 0.804s

OK

C:\pwb\GIT\core>
  • Running tests on Appveyor fails and several scripts like commonscat -help test and interwikidata -help test never stops

https://ci.appveyor.com/project/Ladsgroup/pywikibot-g4xqx/builds/41621236/job/a9qghdg7itht37kf
https://ci.appveyor.com/project/Ladsgroup/pywikibot-g4xqx/builds/41625871/job/7bti97vhphhc45rs

What should have happened instead?:
The test should pass

Software version:
Pywikibot 7.0.0.dev0 after adding pwb script entry point in
rPWBC4f0ee4d

Event Timeline

Xqt triaged this task as High priority.Nov 22 2021, 5:16 PM

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

[pywikibot/core@master] [tests] Temporary add commonscat to unrunnable_script_set

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

Change 740644 merged by Xqt:

[pywikibot/core@master] [tests] Temporary add commonscat to unrunnable_script_set

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

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

[pywikibot/core@master] [tests] Temporary restrict runnable script_list in script_tests.py

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

Change 740657 merged by Xqt:

[pywikibot/core@master] [tests] Temporary restrict runnable script_list in script_tests.py

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

Seems scripts aren't found anymore in this environment:

======================================================================
FAIL: test__login (tests.script_tests.TestScriptHelp)
Test running login -help.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\pywikibot-g4xqx\tests\script_tests.py", line 242, in testScript
    stderr_other)
AssertionError: 'Use -help for further information.' not found in ['ERROR: login.py not found! Misspelling?', 'NOTE: Starting the most similar script login.py ***', '      in 5.0 seconds; type CTRL-C to stop.']
======================================================================
FAIL: test_add_text (tests.script_tests.TestScriptHelp)
Test running add_text -help.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\pywikibot-g4xqx\tests\script_tests.py", line 242, in testScript
    stderr_other)
AssertionError: 'Use -help for further information.' not found in ['ERROR: add_text.py not found! Misspelling?', 'NOTE: Starting the most similar script add_text.py ***', '      in 5.0 seconds; type CTRL-C to stop.']
======================================================================
FAIL: test_archivebot (tests.script_tests.TestScriptHelp)
Test running archivebot -help.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\pywikibot-g4xqx\tests\script_tests.py", line 242, in testScript
    stderr_other)
AssertionError: 'Use -help for further information.' not found in ['ERROR: archivebot.py not found! Misspelling?', 'NOTE: Starting the most similar script archivebot.py ***', '      in 5.0 seconds; type CTRL-C to stop.']
======================================================================
FAIL: test_basic (tests.script_tests.TestScriptHelp)
Test running basic -help.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\pywikibot-g4xqx\tests\script_tests.py", line 242, in testScript
    stderr_other)
AssertionError: 'Use -help for further information.' not found in ['ERROR: basic.py not found! Misspelling?', 'NOTE: Starting the most similar script basic.py ***', '      in 5.0 seconds; type CTRL-C to stop.']
======================================================================
FAIL: test_blockpageschecker (tests.script_tests.TestScriptHelp)
Test running blockpageschecker -help.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\pywikibot-g4xqx\tests\script_tests.py", line 242, in testScript
    stderr_other)
AssertionError: 'Use -help for further information.' not found in ['ERROR: blockpageschecker.py not found! Misspelling?', 'NOTE: Starting the most similar script blockpageschecker.py ***', '      in 5.0 seconds; type CTRL-C to stop.']
----------------------------------------------------------------------

The reason might be this change:

old:
testpath = os.path.join(_pwb_dir, *paths)

new:
testpath = os.path.join(config.base_dir, *paths)

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

[pywikibot/core@master] [tests] Only find one alternative script with script_tests.py

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

Change 740899 merged by jenkins-bot:

[pywikibot/core@master] [tests] Only find one alternative script with script_tests.py

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

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

[pywikibot/core@master] [tests] Only find one alternative script with script_tests.py

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

Change 742169 merged by jenkins-bot:

[pywikibot/core@master] [tests] Only find one alternative script with script_tests.py

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

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

[pywikibot/core@master] [bugfix] Only search user_script_paths inside config.base_dir

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

Change 742245 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] Only search user_script_paths inside config.base_dir

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