jenkins-bot has submitted this change and it was merged.
Change subject: Test harness for scripts should login first
......................................................................
Test harness for scripts should login first
If the login does not happen first, the first script that attempts
to login will unexpectedly emit
Logging in to <site> as <user>
Change-Id: I41111456149aab7da02613e581e692d4e1058b31
---
M tests/script_tests.py
1 file changed, 13 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index b371904..ef151ed 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -53,12 +53,13 @@
if name.endswith('.py')
and not name.startswith('_') # skip __init__.py and _*
and check_script_deps(name)
+ and name != 'login.py' # this is moved to be first
and name != 'imageuncat.py' # this halts indefinitely
and name != 'watchlist.py' # result depends on speed
and name != 'welcome.py' # result depends on speed
and name != 'script_wui.py' # depends on lua compiling
]
- return script_list
+ return ['login'] + script_list
script_input = {
'catall': 'q\n', # q for quit
@@ -192,7 +193,13 @@
return testScript
for script_name in runnable_script_list(scripts_path):
- test_name = 'test_' + script_name + '_execution'
+ # force login to be the first, alphabetically, so the login
+ # message does not unexpectedly occur during execution of
+ # another script.
+ if script_name == 'login':
+ test_name = 'test__' + script_name + '_execution'
+ else:
+ test_name = 'test_' + script_name + '_execution'
dct[test_name] = test_execution(script_name, ['-help'])
if script_name in ['shell', 'version',
'checkimages', # bug 68613
@@ -204,7 +211,10 @@
dct[test_name] = unittest.expectedFailure(dct[test_name])
dct[test_name].__doc__ = 'Test running ' + script_name + '.'
- test_name = 'test_' + script_name + '_no_args'
+ if script_name == 'login':
+ test_name = 'test__' + script_name + '_no_args'
+ else:
+ test_name = 'test_' + script_name + '_no_args'
dct[test_name] = test_execution(script_name, ['-simulate'],
no_args_expected_results)
if script_name in ['add_text', # raises custom NoEnoughData
--
To view, visit https://gerrit.wikimedia.org/r/151291
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I41111456149aab7da02613e581e692d4e1058b31
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: py2.6 test fix: welcome breaks unreliably
......................................................................
py2.6 test fix: welcome breaks unreliably
Change-Id: I049a4c864a25972fad5e13399f186c649da67331
---
M tests/script_tests.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index a6a9398..b371904 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -55,6 +55,7 @@
and check_script_deps(name)
and name != 'imageuncat.py' # this halts indefinitely
and name != 'watchlist.py' # result depends on speed
+ and name != 'welcome.py' # result depends on speed
and name != 'script_wui.py' # depends on lua compiling
]
return script_list
--
To view, visit https://gerrit.wikimedia.org/r/151269
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I049a4c864a25972fad5e13399f186c649da67331
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: call handleArgs before local args are processed
......................................................................
call handleArgs before local args are processed
Change-Id: I0f710087291d74ab423f44088551708f97a21ff8
---
M scripts/watchlist.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/watchlist.py b/scripts/watchlist.py
index 2509088..c3d685c 100755
--- a/scripts/watchlist.py
+++ b/scripts/watchlist.py
@@ -137,10 +137,11 @@
def main():
+ local_args = pywikibot.handleArgs()
all = False
new = False
sysop = False
- for arg in pywikibot.handleArgs():
+ for arg in local_args:
if arg in ('-all', '-update'):
all = True
elif arg == '-new':
--
To view, visit https://gerrit.wikimedia.org/r/151038
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0f710087291d74ab423f44088551708f97a21ff8
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Script test fixes for py2.6
......................................................................
Script test fixes for py2.6
unittest2 on py2.6 on travis reports the following warning and
returns a non-zero exit code for the test suite when a test
is unexpectedly successful.
DeprecationWarning: Use of a TestResult without an addUnexpectedSuccess
method is deprecated
Several of our tests fail only on one site (en.wp, ar.wp or wd), or on
other conditions which cant be predicted.
This test removes use of unexpected success from the tests.
Change-Id: Ic2a4be02871f9eda2c40744935392985cd7a6a01
---
M tests/script_tests.py
1 file changed, 7 insertions(+), 6 deletions(-)
Approvals:
John Vandenberg: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index 038653e..a6a9398 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -12,6 +12,7 @@
import time
import subprocess
import pywikibot
+from pywikibot import config
from tests.utils import unittest, PywikibotTestCase
@@ -53,6 +54,8 @@
and not name.startswith('_') # skip __init__.py and _*
and check_script_deps(name)
and name != 'imageuncat.py' # this halts indefinitely
+ and name != 'watchlist.py' # result depends on speed
+ and name != 'script_wui.py' # depends on lua compiling
]
return script_list
@@ -205,7 +208,6 @@
no_args_expected_results)
if script_name in ['add_text', # raises custom NoEnoughData
'checkimages', # bug 68613
- 'cfd', # bug 69015
'commonscat', # raises custom NoEnoughData
'claimit', # bug 68657 - zero output
'data_ingestion', # bug 68611
@@ -214,15 +216,14 @@
'flickrripper', # bug 68606 (and deps)
'imagerecat', # bug 68658
'imagetransfer', # bug 68659
- 'lonelypages', # raises custom Exception
- 'misspelling', # bug 68665
'pagefromfile', # bug 68660
- 'script_wui', # bug 68797
'template', # bug 68661 - zero output
'transferbot', # raises custom Exception
'upload', # raises custom ValueError
- 'watchlist', # fails on Wikidata only
- ]:
+ ] or \
+ (config.family == 'wikidata' and script_name == 'lonelypages') or \
+ ((config.family != 'wikipedia' or config.mylang != 'en') and script_name == 'cfd') or \
+ (config.family == 'wikipedia' and config.mylang != 'en' and script_name == 'misspelling'):
dct[test_name] = unittest.expectedFailure(dct[test_name])
dct[test_name].__doc__ = \
'Test running ' + script_name + ' without arguments.'
--
To view, visit https://gerrit.wikimedia.org/r/151255
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic2a4be02871f9eda2c40744935392985cd7a6a01
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Remove imageuncat from script tests
......................................................................
Remove imageuncat from script tests
imageuncat is causing the travis builds to halt.
Also replace 'PIL' with module name 'ImageTk' in dependency check.
Change-Id: If188c217f2d193da1b6333f04191e320d2e795b5
---
M tests/script_tests.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index 523d882..52ef10e 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -24,7 +24,7 @@
'script_wui.py': ['crontab', 'lua'],
# Note: package 'lunatic-python' provides module 'lua'
- 'flickrripper.py': ['PIL', 'flickrapi'],
+ 'flickrripper.py': ['ImageTk', 'flickrapi'],
# Note: 'PIL' is not available via pip2.7 on MS Windows,
# however it is available with setuptools.
}
@@ -51,7 +51,9 @@
script_list = [name[0:-3] for name in dir_list # strip .py
if name.endswith('.py')
and not name.startswith('_') # skip __init__.py and _*
- and check_script_deps(name)]
+ and check_script_deps(name)
+ and name != 'imageuncat.py' # this halts indefinitely
+ ]
return script_list
script_input = {
--
To view, visit https://gerrit.wikimedia.org/r/151091
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If188c217f2d193da1b6333f04191e320d2e795b5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fixup for recent standardisation of nowcommons
......................................................................
Fixup for recent standardisation of nowcommons
Fixes I1cc6b5734237d143c8100f3c26c20d78c36924c6
Change-Id: I14ea9f7be0bc0df363a2fe2945a068753645598f
---
M scripts/nowcommons.py
1 file changed, 7 insertions(+), 7 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index 260dcfd..3f2c60e 100644
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -261,7 +261,7 @@
break
def getPageGenerator(self):
- if use_hash:
+ if self.getOption('use_hash'):
gen = self.useHashGenerator()
else:
nowCommonsTemplates = [pywikibot.Page(self.site, title,
@@ -309,7 +309,7 @@
comment = i18n.translate(self.site, nowCommonsMessage, fallback=True)
for page in self.getPageGenerator():
- if use_hash:
+ if self.getOption('use_hash'):
# Page -> Has the namespace | commons image -> Not
images_list = page # 0 -> local image, 1 -> commons image
page = pywikibot.Page(self.site, images_list[0])
@@ -325,18 +325,18 @@
pywikibot.output(u'File is already on Commons.')
continue
md5 = localImagePage.getFileMd5Sum()
- if use_hash:
+ if self.getOption('use_hash'):
filenameOnCommons = images_list[1]
else:
filenameOnCommons = self.findFilenameOnCommons(
localImagePage)
- if not filenameOnCommons and not use_hash:
+ if not filenameOnCommons and not self.getOption('use_hash'):
pywikibot.output(u'NowCommons template not found.')
continue
commonsImagePage = pywikibot.ImagePage(commons, 'Image:%s'
% filenameOnCommons)
if localImagePage.title(withNamespace=False) == \
- commonsImagePage.title(withNamespace=False) and use_hash:
+ commonsImagePage.title(withNamespace=False) and self.getOption('use_hash'):
pywikibot.output(
u'The local and the commons images have the same name')
if localImagePage.title(withNamespace=False) != \
@@ -378,7 +378,7 @@
# refresh because we want the updated list
usingPages = len(list(pywikibot.ImagePage(
self.site, page.title()).usingPages()))
- if usingPages > 0 and use_hash:
+ if usingPages > 0 and self.getOption('use_hash'):
# just an enter
pywikibot.input(
u'There are still %s pages with this \
@@ -397,7 +397,7 @@
if md5 == commonsImagePage.getFileMd5Sum():
pywikibot.output(
u'The image is identical to the one on Commons.')
- if len(localImagePage.getFileVersionHistory()) > 1 and not use_hash:
+ if len(localImagePage.getFileVersionHistory()) > 1 and not self.getOption('use_hash'):
pywikibot.output(
u"This image has a version history. Please \
delete it manually after making sure that the \
--
To view, visit https://gerrit.wikimedia.org/r/151098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I14ea9f7be0bc0df363a2fe2945a068753645598f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>