Lets say I have 5 selenium test files (test1.py.....test5.py). In Jenkins, the usual way you want to run your tests is in parallel (each a different job) so that you know easier when something broke (send emails, mark builds as fail, etc etc). <div>
<br></div><div>So I run things, per job, as: </div><div>[job1] tox test1.py</div><div>[job2] tox test2.py</div><div>[job3] tox test3.py</div><div>....</div><div><br></div><div>Now when I launch them, some of them, some times, fail because of the error above. I know I could just run "tox" and it will run all tests, but then I lose cool jenkin stuff like being able to tell which test failed easily (if one fails in one file, the whole build fails). I could just run them as "py.test" instead of tox, but that's annoying (deps, multi-conf, etc). </div>
<div><br></div><div>Detox? Sounds promising. I'll take a look. Thanks!</div><div><br></div><div><div>~Pedro<br></div>
<br><br><div class="gmail_quote">On Tue, Feb 19, 2013 at 9:58 AM, holger krekel <span dir="ltr"><<a href="mailto:holger@merlinux.eu" target="_blank">holger@merlinux.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Pedrod,<br>
<div class="im"><br>
On Mon, Feb 18, 2013 at 14:50 -0500, Pedro Rodriguez wrote:<br>
> I'm using Tox with Jenkins to run several selenium tests. Everything is<br>
> good but every now and then I get the follow error:<br>
><br>
> IOError: [Errno 2] No such file or directory: '/var/lib/jenkins/.tox/<br>
> jenkins/lib/python2.7/site-packages/Distutils-1.0-py2.7.egg-info'<br>
><br>
> Looking at the log (when it works), I think the issue is this:<br>
><br>
> Installing collected packages: Distutils<br>
><br>
> Found existing installation: Distutils 1.0<br>
><br>
> Uninstalling Distutils:<br>
><br>
> Removing file or directory<br>
> /var/lib/jenkins/.tox/jenkins/lib/python2.7/site-packages/Distutils-1.0-py2.7.egg-info<br>
> Successfully uninstalled Distutils<br>
><br>
> I think what is happening is that if 2 or more tox are running at the same<br>
> time, while one is Uninstalling Distutils, then another one tries to do the<br>
> same thing (and since the other one already did it, it can't find it and<br>
> throws an IO error).<br>
<br>
</div>I am not sure i follow. There should only ever be one tox instance running<br>
things per virtualenv. Are you suggesting there are two tox processes<br>
working on the same virtualenv?<br>
<div class="im"><br>
> So:<br>
> ToxA -> Finds the Distutils installation<br>
> ToxB -> Also finds it<br>
> ToxA -> Delete it<br>
> ToxB -> Try to delete (fails)<br>
><br>
> So my questions are:<br>
> - Why is Distutils being deleted? (noob when it comes to it)<br>
<br>
</div>i don't know - it's not something that tox deals with itself.<br>
<div class="im"><br>
> - Is there a way to avoid this?<br>
> - How are you guys using Tox with Jenkins? I'm just calling tox -e jenkins<br>
> path/to/test.py. Is there a better way?<br>
<br>
</div>did you look at: <a href="http://testrun.org/tox/latest//example/jenkins.html" target="_blank">http://testrun.org/tox/latest//example/jenkins.html</a> ?<br>
<div class="im"><br>
> - sbt and other building tools usually have locking mechanisms for these<br>
> kind of things. Why doesn't Tox? (if it does, how do I turn it on?).<br>
<br>
</div>There is "detox" which runs tests in parallel but it takes care itself<br>
to not have more than one "tox" instance running per virtualenv.<br>
<br>
best,<br>
holger<br>
</blockquote></div><br></div>