Skip to content

Commit 35f5fd0

Browse files
committed
Replace detox with more universal TOX_PARAMS variable
1 parent 5798113 commit 35f5fd0

4 files changed

Lines changed: 22 additions & 23 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ script:
1212
- docker run --rm -it -v $PWD/example_project:/src -w /src -e TOXENV frenzymadness/fedora-python-tox
1313
# Test project cloned into Docker container from provided GIT URL
1414
- docker run --rm -it -e TOXENV -e GIT_URL=https://github.com/frenzymadness/python-tox-example.git frenzymadness/fedora-python-tox
15-
# Test in local folder with detox
16-
- docker run --rm -it -v $PWD/example_project:/src -w /src -e TOXENV frenzymadness/fedora-python-tox detox
15+
# Test in local folder in parallel
16+
- docker run --rm -it -v $PWD/example_project:/src -w /src -e TOXENV -e TOX_PARAMS="-p auto" frenzymadness/fedora-python-tox
1717

1818
matrix:
1919
include:

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ RUN dnf update -y \
2525
python3-pip \
2626
/usr/bin/tox \
2727
/usr/bin/virtualenv \
28-
# /usr/bin/detox is provided by 2 different packages:
29-
python3-detox \
3028
gcc \
3129
gcc-c++ \
3230
git-core \

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,28 @@ test_fac.py ..........
103103
congratulations :)
104104
```
105105

106-
## Parallel run
106+
## Parallel run and other tox features
107107

108-
If you want to run your tests in parallel, use `detox` command at the end of `docker run` line. Detox is preinstalled in the image but it works only with a local source code.
108+
You can adjust the behavior of tox by setting TOX_PARAMS variable with any combination of CLI parameters. It's useful for example for parallel run of your tests.
109109

110110
```
111-
docker run --rm -it -v $PWD:/src -w /src frenzymadness/fedora-python-tox detox
112-
py27 create: /src/.tox/py27
113-
py34 create: /src/.tox/py34
114-
py35 create: /src/.tox/py35
115-
py36 create: /src/.tox/py36
116-
py27 installdeps: pytest
117-
py36 installdeps: pytest
118-
py35 installdeps: pytest
119-
py34 installdeps: pytest
120-
py36 runtests: PYTHONHASHSEED='639038107'
121-
py36 runtests: commands[0] | pytest
122-
py35 runtests: PYTHONHASHSEED='639038107'
123-
py35 runtests: commands[0] | pytest
124-
125-
... etc ...
126-
111+
docker run --rm -it -v $PWD:/src -w /src -e TOX_PARAMS="-p auto" frenzymadness/fedora-python-tox
112+
✔ OK py37 in 12.199 seconds
113+
✔ OK py38 in 12.212 seconds
114+
✔ OK py36 in 12.862 seconds
115+
✔ OK py35 in 12.893 seconds
116+
✔ OK py27 in 13.382 seconds
117+
✔ OK py34 in 14.672 seconds
118+
⠴ [3] pypy | pypy3 | jythonERROR: invocation failed (exit code 1), logfile: /src/.tox/jython/log/jython-0.log
119+
========================================= log start ==========================================
120+
jython create: /src/.tox/jython
121+
ERROR: InterpreterNotFound: jython
122+
123+
========================================== log end ===========================================
124+
✖ FAIL jython in 4.44 seconds
125+
✔ OK pypy in 17.398 seconds
126+
✔ OK pypy3 in 19.189 seconds
127+
__________________________________________ summary ___________________________________________
127128
py27: commands succeeded
128129
py34: commands succeeded
129130
py35: commands succeeded

run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ if [ ! -z $GIT_URL ]; then
99
git clone $GIT_URL $TEMP_DIR && cd $TEMP_DIR
1010
fi
1111

12-
/usr/bin/tox
12+
/usr/bin/tox $TOX_PARAMS

0 commit comments

Comments
 (0)