Skip to content

jenkins.bash: Add support for Python 3 conformance testing #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions jenkins.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,40 @@ cloneorpull() {
}
venv() {
if ! test -d "$1" ; then
virtualenv "$1"
virtualenv -p python${PYTHON_VERSION} "$1"
fi
# shellcheck source=/dev/null
source "$1"/bin/activate
}
git clean --force -d -x || /bin/true

cloneorpull common-workflow-language https://github.com/common-workflow-language/common-workflow-language.git
venv cwltool-venv
docker pull node:slim
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
pip install -U setuptools wheel pip
python setup.py install
pip install "cwltest>=1.0.20160825151655"
pushd common-workflow-language
# clean both the repos before the loop
git clean --force -d -x || /bin/true
# shellcheck disable=SC2154
if [[ "$version" = *dev* ]]
then
EXTRA="EXTRA=--enable-dev"
fi
./run_test.sh --junit-xml=result.xml RUNNER=cwltool -j4 DRAFT="${version}" ${EXTRA}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mr-c Is version an env variable when running the script?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently only set to v1.0 will be v1.1.0-dev1 later, etcetera

CODE=$?
popd
git -C common-workflow-language clean --force -d -x || /bin/true

# Test for Python 2.7 and Python 3
for PYTHON_VERSION in 2.7 3
do
venv cwltool-venv${PYTHON_VERSION}
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
# use pip2.7 and pip3 in separate loop runs
pip${PYTHON_VERSION} install -U setuptools wheel pip
pip${PYTHON_VERSION} install .
pip${PYTHON_VERSION} install "cwltest>=1.0.20160825151655"
pushd common-workflow-language
# shellcheck disable=SC2154
if [[ "$version" = *dev* ]]
then
EXTRA="EXTRA=--enable-dev"
fi
./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml RUNNER=cwltool -j4 DRAFT=${version}
CODE=$(($CODE+$?)) # capture return code of ./run_test.sh
deactivate
popd
done

# build new docker container
if [ "$GIT_BRANCH" = "origin/master" ] && [[ "$version" = "v1.0" ]]
then
./build-cwl-docker.sh && docker push commonworkflowlanguage/cwltool_module && docker push commonworkflowlanguage/cwltool
Expand Down