Skip to content

Commit 62eab92

Browse files
committed
speed up release testing, if cpus > 2
1 parent 21de4c3 commit 62eab92

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ MODULE=cwltool
2626
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2727
# `[[` conditional expressions.
2828
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
29-
DEVPKGS=pycodestyle diff_cover autopep8 pylint coverage pydocstyle flake8 pytest isort
29+
DEVPKGS=pycodestyle diff_cover autopep8 pylint coverage pydocstyle flake8 \
30+
pytest pytest-xdist isort
3031
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
3132
python-flake8 python-mock shellcheck
3233
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
@@ -142,7 +143,7 @@ diff-cover.html: coverage.xml
142143

143144
## test : run the ${MODULE} test suite
144145
test: $(pysources)
145-
python setup.py test
146+
python setup.py test --addopt "-n$(shell expr $(nproc) / 2)"
146147

147148
## testcov : run the ${MODULE} test suite and collect coverage
148149
testcov: $(pysources)

release-test.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ package=cwltool
77
module=cwltool
88
slug=${TRAVIS_PULL_REQUEST_SLUG:=common-workflow-language/cwltool}
99
repo=https://github.com/${slug}.git
10-
run_tests="bin/py.test --ignore ${module}/schemas/ --pyarg cwltool"
10+
parallel=""
11+
if [[ "${OSTYPE}" == linux* ]]
12+
then
13+
parallel=-n$(( $(nproc) / 2 ))
14+
fi
15+
if [[ "${OSTYPE}" == darwin* ]]
16+
then
17+
parallel=-n$(( $(sysctl -n hw.physicalcpu) / 2 ))
18+
fi
19+
20+
run_tests="bin/py.test --ignore ${module}/schemas/ --pyarg cwltool ${parallel}"
1121
pipver=7.0.2 # minimum required version of pip
1222
setuptoolsver=24.2.0 # required to generate correct metadata for
1323
# python_requires

0 commit comments

Comments
 (0)