Last modified: 2014-04-07 13:41:33 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 T46220, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44220 - Support Python unit testing using `python setup.py test`
Support Python unit testing using `python setup.py test`
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 50344
  Show dependency treegraph
 
Reported: 2013-01-21 20:34 UTC by Ori Livneh
Modified: 2014-04-07 13:41 UTC (History)
6 users (show)

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


Attachments

Description Ori Livneh 2013-01-21 20:34:38 UTC
Extension:EventLogging has a suite of Python unit tests, triggered by running `python setup.py test` in the server/ subdirectory. It would be great to have those run by Jenkins.

Even better would be to run the test suite under tox <http://tox.readthedocs.org/en/latest/>. EventLogging provides a tox config file in server/tox.ini, so running 'tox' in servers/ triggers a test run on both Python 2 and Python 3.
Comment 1 Antoine "hashar" Musso (WMF) 2013-01-22 14:13:05 UTC
We definitely want to use tox :-]  That requires some macro definition in Jenkins Job Builder nothing to worry about.

One possible trouble is that setup.py will install third party libraries from pip and we do not want to blindly install third party stuff and run their code.  Will have to be creative there.
Comment 2 Ori Livneh 2013-02-08 09:37:46 UTC
(In reply to comment #1)
> One possible trouble is that setup.py will install third party libraries from
> pip and we do not want to blindly install third party stuff and run their
> code.
>  Will have to be creative there.

Some ideas:
===========

Access package artifacts between multiple tox-runs
--------------------------------------------------
http://tox.readthedocs.org/en/latest/example/general.html#artifacts


Access package artifacts between Jenkins jobs
---------------------------------------------
http://tox.readthedocs.org/en/latest/example/jenkins.html#jenkins-artifact-example
We could run a PyPI clone:


Running our own PyPI
--------------------
http://tox.readthedocs.org/en/latest/config.html#confval-indexserver
http://www.python.org/dev/peps/pep-0381/
http://wiki.python.org/moin/PyPiImplementations
http://brandonkonkle.com/blog/2010/mar/25/creating-personal-pypi-chishop/


Disabling dependency retrieval and enabling sitepackages instead
----------------------------------------------------------------
http://tox.readthedocs.org/en/latest/config.html#confval-sitepackages=True|False
This would allow the tox environments to use Python modules that are globally installed on the Jenkins host. To add additional modules for testing, you'd have to make sure they're in apt and add them via puppet to the integration server.
Comment 3 Antoine "hashar" Musso (WMF) 2014-04-07 13:11:03 UTC
A few weeks ago I added tox on the integration slaves running in labs.  So one can add a tox.ini file and run whatever tests they want :-]
Comment 4 Antoine "hashar" Musso (WMF) 2014-04-07 13:41:33 UTC
For tox, one has a bunch of informations at https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Test_your_python

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


Navigation
Links