Last modified: 2014-11-04 20:44:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74326, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72326 - ZeroPortal browsertests fails early due to auth issue with zero.wikimedia.org
ZeroPortal browsertests fails early due to auth issue with zero.wikimedia.org
Status: NEW
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
wmf-deployment
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-21 18:02 UTC by Chris McMahon
Modified: 2014-11-04 20:44 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Chris McMahon 2014-10-21 18:02:30 UTC

    
Comment 2 Antoine "hashar" Musso (WMF) 2014-10-21 19:33:46 UTC
Browser tests jobs assume the targeted URL is a MediaWiki instance with an accessible API.   It then query /w/api.php for the git_branch being used which let us checkout the matching branch.

That script fails:

 ++ /srv/deployment/integration/slave-scripts/bin/mw-api-siteinfo.py http://zero.wikimedia.org/w/api.php git_branch
 Traceback (most recent call last):
   File "/srv/deployment/integration/slave-scripts/bin/mw-api-siteinfo.py", line 92, in <module>
     main()
   File "/srv/deployment/integration/slave-scripts/bin/mw-api-siteinfo.py", line 89, in main
     print getattr(mwresponse.query.general, field)
 AttributeError: 'MwApiResponse' object has no attribute 'query'

And the branch is not set so the job abort:

 + MEDIAWIKI_GIT_BRANCH=


We had the issue previously of not properly failing when the API send an HTTP error code (bug 70695) which S Page kindly fixed by having the script raise an exception whenever the status is wrong.


When querying Zero portal API I end up with:

Http response code 200

{u'servedby': u'mw1117', u'error': {u'info': u'You need read permission to use this module', u'*': u'See https://zero.wikimedia.org/w/api.php for API usage', u'code': u'readapidenied'}}


That highlights two issues:


1) ZeroPortal / MediaWiki API should yield a 403 which would abort the script.   Should probably be a bug on its own reported to ZeroPortal.

2) The script bin/mw-api-siteinfo.py in integration/jenkins.git needs to be adjusted by someone so it can be passed a username and an env variable name from which to read the password.  Then adjust the python code to authenticate with Zero.
Comment 3 Gerrit Notification Bot 2014-10-22 09:01:44 UTC
Change 166553 had a related patch set uploaded by Zfilipin:
ZeroPortal has browser tests

https://gerrit.wikimedia.org/r/166553
Comment 4 dr0ptp4kt 2014-10-23 16:43:07 UTC
Aha, okay, I think I understand the magic a little better. @yurik, is there a way to open the specific API endpoint to which @hashar refers for the CI infrastructure getting the git_branch value, and to do so without creating a highly privileged account?

As a related matter, I suspect we're not going to be able to run the authenticated tests from the Cucumber suite on the CI server (i.e., someone will need to run the tests periodically on his or her local machine), meaning we'll need to constrain the CI server checks to specific Cucumber tags.

@hashar, by the way, is there a way to ensure these CI tests run over https:// at all times?
Comment 5 Antoine "hashar" Musso (WMF) 2014-10-24 15:29:41 UTC
> @hashar, by the way, is there a way to ensure these CI tests run over
> https:// at all times?

The mw-api-siteinfo.py  script is being passed $MEDIAWIKI_API_URL , so that env variable just need to use https://
Comment 6 Gerrit Notification Bot 2014-11-04 20:43:28 UTC
Change 166553 abandoned by Hashar:
ZeroPortal has browser tests

Reason:
The change as proposed is not going to work since Zero is a production portal with authentication, which is not what is expected (all other wikis are public).

A solution has to be figured out by mobile to be able to run browser tests against the production wiki from the Jenkins host.  Follow up on https://bugzilla.wikimedia.org/show_bug.cgi?id=72326 (and see my comment #2 there).

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links