Skip to content

Commit 11564e3

Browse files
authored
Merge pull request #27 from common-workflow-language/release_0.5
add release-test
2 parents 12c9f2d + ffc5699 commit 11564e3

File tree

4 files changed

+99
-1
lines changed

4 files changed

+99
-1
lines changed

Diff for: MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include MANIFEST.in
1+
include MANIFEST.in Makefile
22
include tests/*.cwl

Diff for: release-test.sh

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
export LC_ALL=C
7+
8+
package=cwl-upgrader
9+
module=cwlupgrader
10+
slug=${TRAVIS_PULL_REQUEST_SLUG:=common-workflow-language/${package}}
11+
repo=https://github.com/${slug}.git
12+
test_prefix=""
13+
run_tests() {
14+
${test_prefix}bin/py.test --pyargs -x ${module}
15+
}
16+
pipver=7.0.2 # minimum required version of pip
17+
setuptoolsver=24.2.0 # required to generate correct metadata for
18+
# python_requires
19+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
20+
21+
rm -Rf testenv? || /bin/true
22+
23+
export HEAD=${TRAVIS_PULL_REQUEST_SHA:-$(git rev-parse HEAD)}
24+
25+
if [ "${RELEASE_SKIP}" != "head" ]
26+
then
27+
virtualenv testenv1 -p python3
28+
# First we test the head
29+
# shellcheck source=/dev/null
30+
source testenv1/bin/activate
31+
rm -Rf testenv1/local
32+
rm testenv1/lib/python-wheels/setuptools* \
33+
&& pip install --force-reinstall -U pip==${pipver} \
34+
&& pip install setuptools==${setuptoolsver} wheel
35+
make install-dep
36+
pip install .
37+
make test
38+
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
39+
mkdir testenv1/not-${module}
40+
# if there is a subdir named '${module}' py.test will execute tests
41+
# there instead of the installed module's tests
42+
pushd testenv1/not-${module}
43+
# shellcheck disable=SC2086
44+
test_prefix=../ run_tests; popd
45+
fi
46+
47+
virtualenv testenv2 -p python3
48+
virtualenv testenv3 -p python3
49+
virtualenv testenv4 -p python3
50+
rm -Rf testenv[234]/local
51+
52+
# Secondly we test via pip
53+
54+
cd testenv2
55+
# shellcheck source=/dev/null
56+
source bin/activate
57+
rm lib/python-wheels/setuptools* \
58+
&& pip install --force-reinstall -U pip==${pipver} \
59+
&& pip install setuptools==${setuptoolsver} wheel
60+
pip install -e "git+${repo}@${HEAD}#egg=${package}" #[deps]
61+
cd src/${package}
62+
make install-dep
63+
make dist
64+
make test
65+
cp dist/${package}*tar.gz ../../../testenv3/
66+
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
67+
cd ../.. # no subdir named ${proj} here, safe for py.testing the installed module
68+
# shellcheck disable=SC2086
69+
run_tests
70+
71+
# Is the distribution in testenv2 complete enough to build another
72+
# functional distribution?
73+
74+
cd ../testenv3/
75+
# shellcheck source=/dev/null
76+
source bin/activate
77+
rm lib/python-wheels/setuptools* \
78+
&& pip install --force-reinstall -U pip==${pipver} \
79+
&& pip install setuptools==${setuptoolsver} wheel
80+
package_tar=${package}*tar.gz
81+
pip install "-r${DIR}/test-requirements.txt"
82+
pip install ${package_tar} # [deps]
83+
mkdir out
84+
tar --extract --directory=out -z -f ${package}*.tar.gz
85+
cd out/${package}*
86+
make install-dep
87+
make dist
88+
make test
89+
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
90+
mkdir ../not-${module}
91+
pushd ../not-${module}
92+
# shellcheck disable=SC2086
93+
test_prefix=../../ run_tests; popd

Diff for: setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
download_url="https://github.com/common-workflow-language/cwl-upgrader",
2323
license="Apache 2.0",
2424
packages=["cwlupgrader", "cwlupgrader.tests"],
25+
include_package_data=True,
2526
package_dir={"cwlupgrader.tests": "tests"},
27+
package_data={"cwlupgrader.tests": ["*.cwl"]},
2628
install_requires=["setuptools", "ruamel.yaml >= 0.14.12, <= 0.15.97", "typing"],
2729
entry_points={"console_scripts": ["cwl-upgrader = cwlupgrader.main:main"]},
2830
classifiers=[

Diff for: test-requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pytest < 4.3.0
2+
pytest-runner
3+
pytest-cov

0 commit comments

Comments
 (0)