Skip to content

Commit 41fd067

Browse files
committed
test Singularity on Jenkins
1 parent 12cccc6 commit 41fd067

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ MODULE=cwltool
2727
# `[[` conditional expressions.
2828
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
2929
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pydocstyle flake8 pytest isort mock
30-
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount python-flake8 python-mock
30+
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
31+
python-flake8 python-mock shellcheck
3132
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --date=`git log --first-parent \
3233
--max-count=1 --format=format:%cI`)
3334
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

jenkins.bash

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cloneorpull() {
1414
}
1515
venv() {
1616
if ! test -d "$1" ; then
17-
virtualenv -p python${PYTHON_VERSION} "$1"
17+
virtualenv -p python"${PYTHON_VERSION}" "$1"
1818
fi
1919
# shellcheck source=/dev/null
2020
source "$1"/bin/activate
@@ -28,25 +28,39 @@ git -C common-workflow-language clean --force -d -x || /bin/true
2828

2929
# Test for Python 2.7 and Python 3
3030
for PYTHON_VERSION in 2.7 3
31+
do
32+
for CONTAINER in docker singularity
3133
do
3234
venv cwltool-venv${PYTHON_VERSION}
3335
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
3436
# use pip2.7 and pip3 in separate loop runs
3537
pip${PYTHON_VERSION} install -U setuptools wheel pip
38+
pip${PYTHON_VERSION} uninstall -y cwltool
3639
pip${PYTHON_VERSION} install .
3740
pip${PYTHON_VERSION} install "cwltest>=1.0.20180130081614"
3841
pushd common-workflow-language
3942
# shellcheck disable=SC2154
4043
if [[ "$version" = *dev* ]]
4144
then
42-
EXTRA="EXTRA=--enable-dev"
45+
EXTRA=" --enable-dev"
46+
fi
47+
if [[ "$CONTAINER" = "singularity" ]]
48+
then
49+
EXTRA+=" --singularity"
4350
fi
51+
if [ -n "$EXTRA" ]
52+
then
53+
EXTRA="EXTRA=${EXTRA}"
54+
fi
55+
# shellcheck disable=SC2086
4456
./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml RUNNER=cwltool \
45-
-j4 DRAFT=${version} --classname=py${PYTHON_VERSION}
46-
CODE=$(($CODE+$?)) # capture return code of ./run_test.sh
57+
-j4 DRAFT="${version}" ${EXTRA} \
58+
--classname=py${PYTHON_VERSION}_${CONTAINER}
59+
CODE=$((CODE+$?)) # capture return code of ./run_test.sh
4760
deactivate
4861
popd
4962
done
63+
done
5064

5165
# build new docker container
5266
if [ "$GIT_BRANCH" = "origin/master" ] && [[ "$version" = "v1.0" ]]

0 commit comments

Comments
 (0)