stupidcache / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Add tox.ini #492

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Here's a change to add a tox.ini for tox:

https://code.google.com/r/msabramo-psutil-tox/source/detail?r=3f28e2b10650f35841
277244206a41f39901bca0&name=tox

This lets one test across multiple versions of Python.

Original issue reported on code.google.com by msabr...@gmail.com on 1 Apr 2014 at 4:42

GoogleCodeExporter commented 9 years ago
Interesting. 
Can you please:

1 - post what post-commit URL you have configured in 
https://code.google.com/p/{YOUR_PROJECT}/adminSource

2 - describe what did you do on the "tox side"

Original comment by g.rodola on 1 Apr 2014 at 7:03

GoogleCodeExporter commented 9 years ago
I didn't do anything special with the post-commit URL. Tox inherently is not 
something that fires automatically when you do commits, although you could rig 
it up  to do this -- for example, at my work, we have our Jenkins jobs invoke 
tox, using the following recipe: 
http://tox.readthedocs.org/en/latest/example/jenkins.html

The way tox works is that you create a tox.ini file, `pip install tox`, and 
then invoke tox as follows:

❯ tox GLOB sdist-make: /Users/marca/dev/hg-repos/psutil/setup.py py26 inst-nodeps: /Users/marca/dev/hg-repos/psutil/.tox/dist/psutil-2.0.0.zip py26 runtests: PYTHONHASHSEED='1670459751'

py26 runtests: commands[0] | py.test

=================================================================== test

session starts

platform darwin -- Python 2.6.7 -- py-1.4.20 -- pytest-2.5.2 collected 180 items

test/test_memory_leaks.py ..s.....ss..s...s...ssss.s.......s.....ss..s...s...ssss.s...........s..s.... test/test_psutil.py ..F................F..F................Fs..s.......ss.........s......ss......... ...F.................... ...



summary



ERROR: py26: commands failed ERROR: py27: commands failed ERROR: pypy: commands failed ERROR: py33: commands failed


Tox is not a cloud CI system like Travis CI or Drone.io. It's a command that 
you run which simply runs whatever commands you tell it to run in a bunch of 
different virtualenvs. Most commonly you have it run your test suite and you 
have it do in a bunch of virtualenvs for different Python versions.

http://tox.testrun.org/

But perhaps something like Drone.io could be useful here as well for doing 
automated testing of psutil. In fact, here's a Drone.io job that I just set up 
in about 5 minutes. It doesn't yet trigger automatically on commits, but I 
think that can be done as long as I can get Google Code to post to a web hook.

The alternative way to set up automated CI would be to mirror the repo on 
GitHub (or move it to GitHub) and then you can use Travis CI which 
automatically builds on commits and pull requests, which is awesome.

Original comment by msabr...@gmail.com on 1 Apr 2014 at 8:17

GoogleCodeExporter commented 9 years ago
Oops, here's the Drone.io job that I forgot to link to:

https://drone.io/msabramo/msabramo-psutil-tox/4

Original comment by msabr...@gmail.com on 1 Apr 2014 at 8:19

GoogleCodeExporter commented 9 years ago
I included a tox file for testing python versions from 2.6 to 3.4 as of 
revision 8186c053bf24.
It would be great to integrate this with some automation tool such as drone.io 
so that tests gets automatically run on ever "hg push". I will look into that 
later.

Original comment by g.rodola on 13 May 2014 at 3:36