[Bug 69183] tox runs all tests (including manual ones)

2014-08-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=69183

Antoine hashar Musso has...@free.fr changed:

   What|Removed |Added

 CC||has...@free.fr

--- Comment #1 from Antoine hashar Musso has...@free.fr ---
tox is just a wrapper around virtualenv, it then execute a given command. In
this case 'nosetests'.  Good news, nosetests let one flag tests with an
attribute which can then be included/excluded at will using  --attr=.

I discussed about it with Pywikibot folks, they have unit tests and tests that
target the production site.   We wanted to prevent running tests again a site. 
What they ended up with is a base class for each kind of tests that adds an
attribute and let them skip tests running against a site.

Some magic code at: https://gerrit.wikimedia.org/r/#/c/151604/4/tests/utils.py


You could go with a ManualTestCase that will have an attribute manual_test .
Then exclude those tests by running: nosetests --attr='!manual_test'.That
could be added to the commands= stanza in tox.ini

Note, you can create a new tox environment to execute the manual test easily
and end up with something like:

 # Default env executed for py26,py27 targets
 # Excludes manual tests
 [testenv]
 ...
 commands = nosetests --attr='!manual_test'

 # Only run manual tests, execute with: tox -emanual_test
 [testenv:manual_test]
 commands = nosetests --attr='manual_test'

 # produce coverage report
 [testenv:cover]
 commands = nosetests --attr='!manual_test' --with-coverage --cover-html

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 69183] tox runs all tests (including manual ones)

2014-08-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=69183

--- Comment #2 from nuria nu...@wikimedia.org ---
You could go with a ManualTestCase that will have an attribute manual_test 
Right, we already have such an attribute. I just opened the bug to make sure we
do not forget to update our tox config.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 69183] tox runs all tests (including manual ones)

2014-08-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=69183

--- Comment #3 from Antoine hashar Musso has...@free.fr ---
Great! Let me know if there if you encounter any issue with tox configuration.
Will be happy to brainstorm with you.

Also adding relevant Jenkins jobs is quite easy to handle. A short tutorial
explains how to amend Jenkins configuration definition at
https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Test_your_python#Editing_Jenkins_configuration

:)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l