Skip to content

Commit 8d5b3e8

Browse files
authored
Merge pull request #505 from common-workflow-language/py3_conformance
jenkins.bash: Add support for Python 3 conformance testing
2 parents 845ce98 + a33bc7a commit 8d5b3e8

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

jenkins.bash

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,40 @@ cloneorpull() {
1414
}
1515
venv() {
1616
if ! test -d "$1" ; then
17-
virtualenv "$1"
17+
virtualenv -p python${PYTHON_VERSION} "$1"
1818
fi
1919
# shellcheck source=/dev/null
2020
source "$1"/bin/activate
2121
}
22-
git clean --force -d -x || /bin/true
22+
2323
cloneorpull common-workflow-language https://github.com/common-workflow-language/common-workflow-language.git
24-
venv cwltool-venv
2524
docker pull node:slim
26-
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
27-
pip install -U setuptools wheel pip
28-
python setup.py install
29-
pip install "cwltest>=1.0.20160825151655"
30-
pushd common-workflow-language
25+
# clean both the repos before the loop
3126
git clean --force -d -x || /bin/true
32-
# shellcheck disable=SC2154
33-
if [[ "$version" = *dev* ]]
34-
then
35-
EXTRA="EXTRA=--enable-dev"
36-
fi
37-
./run_test.sh --junit-xml=result.xml RUNNER=cwltool -j4 DRAFT="${version}" ${EXTRA}
38-
CODE=$?
39-
popd
27+
git -C common-workflow-language clean --force -d -x || /bin/true
28+
29+
# Test for Python 2.7 and Python 3
30+
for PYTHON_VERSION in 2.7 3
31+
do
32+
venv cwltool-venv${PYTHON_VERSION}
33+
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
34+
# use pip2.7 and pip3 in separate loop runs
35+
pip${PYTHON_VERSION} install -U setuptools wheel pip
36+
pip${PYTHON_VERSION} install .
37+
pip${PYTHON_VERSION} install "cwltest>=1.0.20160825151655"
38+
pushd common-workflow-language
39+
# shellcheck disable=SC2154
40+
if [[ "$version" = *dev* ]]
41+
then
42+
EXTRA="EXTRA=--enable-dev"
43+
fi
44+
./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml RUNNER=cwltool -j4 DRAFT=${version}
45+
CODE=$(($CODE+$?)) # capture return code of ./run_test.sh
46+
deactivate
47+
popd
48+
done
49+
50+
# build new docker container
4051
if [ "$GIT_BRANCH" = "origin/master" ] && [[ "$version" = "v1.0" ]]
4152
then
4253
./build-cwl-docker.sh && docker push commonworkflowlanguage/cwltool_module && docker push commonworkflowlanguage/cwltool

0 commit comments

Comments
 (0)