Skip to content

Commit c8e8779

Browse files
author
y-p
committed
TST: Added Script for running tox instances in parallel.
1 parent 0947ff0 commit c8e8779

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

tox_prll.ini

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Tox (http://tox.testrun.org/) is a tool for running tests
2+
# in multiple virtualenvs. This configuration file will run the
3+
# test suite on all supported python versions. To use it, "pip install tox"
4+
# and then run "tox" from this directory.
5+
6+
[tox]
7+
envlist = py25, py26, py27, py31, py32
8+
sdistsrc = {env:DISTFILE}
9+
10+
[testenv]
11+
deps =
12+
cython
13+
numpy >= 1.6.1
14+
nose
15+
pytz
16+
17+
# cd to anything but the default {toxinidir} which
18+
# contains the pandas subdirectory and confuses
19+
# nose away from the fresh install in site-packages
20+
changedir = {envdir}
21+
22+
commands =
23+
# TODO: --exe because of GH #761
24+
{envbindir}/nosetests --exe pandas.tests
25+
# cleanup the temp. build dir created by the tox build
26+
/bin/rm -rf {toxinidir}/build
27+
28+
# quietly rollback the install.
29+
# Note this line will only be reached if the tests
30+
# previous lines succeed (in particular, the tests),
31+
# but an uninstall is really only required when
32+
# files are removed from source tree, in which case,
33+
# stale versions of files will will remain in the venv,
34+
# until the next time uninstall is run.
35+
#
36+
# tox should provide a preinstall-commands hook.
37+
pip uninstall pandas -qy
38+
39+
40+
[testenv:py25]
41+
deps =
42+
cython
43+
numpy >= 1.6.1
44+
nose
45+
pytz
46+
simplejson
47+
48+
[testenv:py26]
49+
50+
[testenv:py27]
51+
52+
[testenv:py31]
53+
54+
[testenv:py32]

tox_prll.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
#
3+
# tox has an undocumented (as of 1.4.2) config option called "sdistsrc"
4+
# which can make a run use a pre-prepared sdist file.
5+
# we prepare the sdist once , then launch the tox runs in parallel using it.
6+
#
7+
# currently (tox 1.4.2) We have to skip sdist generation when running in parallel
8+
# or we get a race.
9+
#
10+
11+
12+
ENVS=$(cat tox.ini | grep envlist | tr "," " " | cut -d " " -f 3-)
13+
TOX_INI_PAR="tox_prll.ini"
14+
15+
echo "[Creating distfile]"
16+
tox --sdistonly
17+
export DISTFILE="$(find .tox/dist -type f )"
18+
19+
echo -e "[Starting tests]\n"
20+
for e in $ENVS; do
21+
echo "[launching tox for $e]"
22+
tox -c "$TOX_INI_PAR" -e "$e" &
23+
done

0 commit comments

Comments
 (0)