jayvdb created this task. jayvdb assigned this task to Omegat. jayvdb added subscribers: pywikipedia-bugs, jayvdb, XZise, Grunny. jayvdb added projects: PyWikiBot-Interwiki-Map, pywikibot-core, Pywikibot-tests. jayvdb changed Security from none to none.
TASK DESCRIPTION Search on the Wikia website appears to work fine
http://www.wikia.com/Special:Search?search=foo&fulltext=Search http://www.wikia.com/Special:Search?search=Seuss&fulltext=Search
But errors result from calling the api, search on text or title
http://www.wikia.com/api.php?format=jsonfm&action=query&generator=se... http://www.wikia.com/api.php?format=jsonfm&action=query&generator=se...
But a near match search does appear to be working.
http://www.wikia.com/api.php?format=jsonfm&action=query&generator=se...
but not returning results which do appear on the search page.
http://www.wikia.com/api.php?format=jsonfm&action=query&generator=se...
This is causing a test error in site_tests.SiteUserTestCase.testSearch
``` Traceback (most recent call last): File "./tests/site_tests.py", line 887, in testSearch se = list(mysite.search("wiki", total=100)) File "./pywikibot/data/api.py", line 1452, in __iter__ self.data = self.request.submit() File "./pywikibot/data/api.py", line 1071, in submit raise APIError(code, info, **result["error"]) pywikibot.data.api.APIError: gsrsearch-text-disabled: text search is disabled ```
The simplest fix for the test suite is to catch and detect 'gsrsearch-text-disabled' - when the API returns that error, use unittest.SkipTest to skip the test without causing a test failure.
Longer term pywikibot needs to detect that search is disabled, like we detect whether upload is enabled in APISite.is_uploaddisabled.
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
To: Omegat, jayvdb Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
jayvdb changed the title from "Skip " to "Skip search tests when the search API is disabled.". jayvdb edited the task description.
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
To: Omegat, jayvdb Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
gerritbot added a project: Patch-For-Review. gerritbot added a comment.
Change 180409 had a related patch set uploaded (by Maverick): Bug:https://phabricator.wikimedia.org/T77968
https://gerrit.wikimedia.org/r/180409
https://phabricator.wikimedia.org/tag/patch-for-review/
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Omegat, gerritbot Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
jayvdb added a comment.
As noted on the code review, we need to first analyse this 'what' parameter, in the MediaWiki php code, and understand how what = text or title are disabled. http://git.wikimedia.org/blob/mediawiki%2Fcore.git/ed646ee688057e6022a00e296...
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Omegat, jayvdb Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
jayvdb added a comment.
We done a bit of analysis and cant find the appropriate way to use feature detection. We could do dummy requests and check the response, which is what the previous changeset attempted to do, but ... a simpler approach is for the test method to use has_extension to detect extension 'WikiaSearch' and skip the test if the extension is found. We dont know for sure if that extension ( https://github.com/Wikia/app/tree/dev/extensions/wikia/Search ?) is causing the problem, but it is a decent way to detect 'wikia' without depending on the name of the family file.
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Omegat, jayvdb Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
jayvdb added a comment.
To get the exact name of the extension according to the API, use the API query called 'siteinfo', and prop called 'extensions'
https://www.mediawiki.org/wiki/API:Meta#siteinfo_.2F_si
http://www.wikia.com/api.php?format=jsonfm&action=query&meta=siteinf...
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Omegat, jayvdb Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
gerritbot added a comment.
Change 182359 had a related patch set uploaded (by Maverick): Skip search test for wikia
https://gerrit.wikimedia.org/r/182359
https://phabricator.wikimedia.org/tag/patch-for-review/
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Omegat, gerritbot Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
gerritbot added a comment.
Change 182359 merged by jenkins-bot: Skip search test for sites using Wikia Search
https://gerrit.wikimedia.org/r/182359
TASK DETAIL https://phabricator.wikimedia.org/T77968
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Omegat, gerritbot Cc: Aklapper, jayvdb, XZise, Grunny, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org