Skip to content

Commit e0a756b

Browse files
committed
update the test execution and ship the tests
1 parent f3a4276 commit e0a756b

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
include Makefile
22
global-exclude *~
33
global-exclude *.pyc
4+
include tests/*
5+
include tests/test-data/*

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ MODULE=cwltest
2626
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2727
# `[[` conditional expressions.
2828
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
29-
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pep257 flake8
29+
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pep257 flake8 pytest
3030
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pep257 sloccount python-flake8
3131
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --date=`git log --first-parent \
3232
--max-count=1 --format=format:%cI`)
3333
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3434

3535
## all : default task
3636
all:
37-
./setup.py develop
37+
pip install -e .
3838

3939
## help : print this help message and exit
4040
help: Makefile
@@ -109,10 +109,7 @@ diff_pylint_report: pylint_report.txt
109109
diff-quality --violations=pylint pylint_report.txt
110110

111111
.coverage: $(PYSOURCES) all
112-
export COVERAGE_PROCESS_START=${mkfile_dir}.coveragerc; \
113-
cd ${CWL}; ./run_test.sh RUNNER=cwltool
114-
coverage run setup.py test
115-
coverage combine ${CWL} ${CWL}/draft-3/ ./
112+
coverage run ./setup.py test
116113

117114
coverage.xml: .coverage
118115
python-coverage xml
@@ -135,6 +132,7 @@ diff-cover.html: coverage-gcovr.xml coverage.xml
135132

136133
## test : run the ${MODULE} test suite
137134
test: FORCE
135+
./setup.py test
138136

139137
sloccount.sc: ${PYSOURCES} Makefile
140138
sloccount --duplicates --wide --details $^ > sloccount.sc

release-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -x
66
package=cwltest
77
module=cwltest
88
repo=https://github.com/common-workflow-language/cwltest.git
9-
run_tests="cwltest --help"
9+
run_tests="py.test --pyarg ${module}"
1010
pipver=8.0.1 # minimum required version of pip
1111
setupver=20.10.1 # minimum required version of setuptools
1212

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ ignore = E124,E128,E129,E201,E202,E225,E226,E231,E265,E271,E302,E303,F401,E402,E
55

66
[bdist_wheel]
77
universal = 1
8+
9+
[tool:pytest]
10+
testpaths = tests

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
'six>=1.10.0'
2323
]
2424

25+
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
26+
pytest_runner = ['pytest-runner'] if needs_pytest else []
27+
2528
if sys.version_info.major == 2:
2629
install_requires.extend(['futures >= 3.0.5', 'subprocess32'])
2730

@@ -37,10 +40,13 @@
3740
url="https://github.com/common-workflow-language/cwltest",
3841
download_url="https://github.com/common-workflow-language/cwltest",
3942
license='Apache 2.0',
40-
packages=["cwltest"],
43+
packages=["cwltest", "cwltest.tests"],
44+
package_dir={'cwltest.tests': 'tests'},
45+
include_package_data=True,
4146
install_requires=install_requires,
4247
test_suite='tests',
43-
tests_require=[],
48+
setup_requires=[] + pytest_runner,
49+
tests_require=['pytest'],
4450
entry_points={
4551
'console_scripts': ["cwltest=cwltest:main"]
4652
},

0 commit comments

Comments
 (0)