55
66package=cwltest
77module=cwltest
8- repo=https://github.com/common-workflow-language/cwltest.git
8+ slug=${TRAVIS_PULL_REQUEST_SLUG:= common-workflow-language/ cwltool}
9+ repo=https://github.com/${slug} .git
910run_tests=" py.test --pyarg ${module} "
1011pipver=8.0.1 # minimum required version of pip
11- setupver =20.10.1 # minimum required version of setuptools
12+ setuptoolsver =20.10.1 # minimum required version of setuptools
1213PYVER=${PYVER:= 2.7}
1314
14- rm -Rf testenv${PYVER} _? || /bin/true
15+ rm -Rf " testenv${PYVER} _" ? || /bin/true
1516
1617export HEAD=${TRAVIS_PULL_REQUEST_SHA:- $(git rev-parse HEAD)}
1718if [ " ${RELEASE_SKIP} " != " head" ]
1819then
19- virtualenv testenv${PYVER} _1 -p python${PYVER}
20+ virtualenv " testenv${PYVER} _1" -p " python${PYVER} "
2021 # First we test the head
22+ # shellcheck source=/dev/null
2123 source testenv${PYVER} _1/bin/activate
22- rm testenv${PYVER} _1/lib/python-wheels/setuptools* \
24+ rm " testenv${PYVER} _1/lib/python-wheels/setuptools" * \
2325 && pip install --force-reinstall -U pip==${pipver} \
24- && pip install setuptools==${setupver } wheel
26+ && pip install setuptools==${setuptoolsver } wheel
2527 make install-dependencies
2628 make test
2729 pip uninstall -y ${package} || true ; pip uninstall -y ${package} || true ; make install
28- mkdir testenv${PYVER} _1/not-${module}
30+ mkdir " testenv${PYVER} _1/not-${module} "
2931 # if there is a subdir named '${module}' py.test will execute tests
3032 # there instead of the installed module's tests
31- pushd testenv${PYVER} _1/not-${module} ; ../bin/${run_tests} ; popd
33+ pushd " testenv${PYVER} _1/not-${module} "
34+ # shellcheck disable=SC2086
35+ ../bin/${run_tests} ; popd
3236fi
3337
34- virtualenv testenv${PYVER} _2 -p python${PYVER}
35- virtualenv testenv${PYVER} _3 -p python${PYVER}
36- virtualenv testenv${PYVER} _4 -p python${PYVER}
37- virtualenv testenv${PYVER} _5 -p python${PYVER}
38+ virtualenv " testenv${PYVER} _2" -p " python${PYVER} "
39+ virtualenv " testenv${PYVER} _3" -p " python${PYVER} "
40+ virtualenv " testenv${PYVER} _4" -p " python${PYVER} "
41+ virtualenv " testenv${PYVER} _5" -p " python${PYVER} "
3842
3943
4044# Secondly we test via pip
4145
42- pushd testenv${PYVER} _2
46+ pushd " testenv${PYVER} _2"
47+ # shellcheck source=/dev/null
4348source bin/activate
4449rm lib/python-wheels/setuptools* \
4550 && pip install --force-reinstall -U pip==${pipver} \
46- && pip install setuptools==${setupver } wheel
47- pip install -e git+${repo} @${HEAD} # egg=${package}
51+ && pip install setuptools==${setuptoolsver } wheel
52+ pip install -e " git+${repo} @${HEAD} #egg=${package} "
4853pushd src/${package}
4954make install-dependencies
5055make dist
5156make test
52- cp dist/${package} * tar.gz ../../../testenv${PYVER} _3/
53- cp dist/${package} * whl ../../../testenv${PYVER} _4/
57+ cp dist/${package} * tar.gz " ../../../testenv${PYVER} _3/"
58+ cp dist/${package} * whl " ../../../testenv${PYVER} _4/"
5459pip uninstall -y ${package} || true ; pip uninstall -y ${package} || true ; make install
5560popd # ../.. no subdir named ${proj} here, safe for py.testing the installed module
61+ # shellcheck disable=SC2086
5662bin/${run_tests}
5763popd
5864
5965# Is the source distribution in testenv${PYVER}_2 complete enough to build
6066# another functional distribution?
6167
62- pushd testenv${PYVER} _3/
68+ pushd " testenv${PYVER} _3/"
69+ # shellcheck source=/dev/null
6370source bin/activate
6471rm lib/python-wheels/setuptools* \
6572 && pip install --force-reinstall -U pip==${pipver} \
66- && pip install setuptools==${setupver } wheel
73+ && pip install setuptools==${setuptoolsver } wheel
6774pip install ${package} * tar.gz
6875pip install pytest
6976mkdir out
@@ -73,19 +80,25 @@ make dist
7380make test
7481pip uninstall -y ${package} || true ; pip uninstall -y ${package} || true ; make install
7582mkdir ../not-${module}
76- pushd ../not-${module} ; ../../bin/${run_tests} ; popd
83+ pushd ../not-${module}
84+ # shellcheck disable=SC2086
85+ ../../bin/${run_tests}
86+ popd
7787popd
7888popd
7989
8090# Is the wheel in testenv${PYVER}_2 installable and will it pass the tests
8191
82- pushd testenv${PYVER} _4/
92+ pushd " testenv${PYVER} _4/"
93+ # shellcheck source=/dev/null
8394source bin/activate
8495rm lib/python-wheels/setuptools* \
8596 && pip install --force-reinstall -U pip==${pipver} \
86- && pip install setuptools==${setupver } wheel
97+ && pip install setuptools==${setuptoolsver } wheel
8798pip install ${package} * .whl
8899pip install pytest
89100mkdir not-${module}
90- pushd not-${module} ; ../bin/${run_tests} ; popd
101+ pushd not-${module}
102+ # shellcheck disable=SC2086
103+ ../bin/${run_tests} ; popd
91104popd
0 commit comments