Skip to content

Commit

Permalink
Merge pull request #66 from common-workflow-language/fix_tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
mr-c authored Apr 13, 2018
2 parents aec2384 + 6e0acd8 commit 2d47780
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 26 deletions.
18 changes: 17 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
sudo: false
language: python

cache: pip
python:
- 2.7
- 3.4
- 3.5
- 3.6
matrix:
include:
- os: linux
Expand All @@ -10,6 +15,17 @@ matrix:
- os: osx
language: generic
python: 2.7
jobs:
include:
- stage: release-test
python: 2.7
script: RELEASE_SKIP=head PYVER=2.7 ./release-test.sh
- python: 3.4
script: RELEASE_SKIP=head PYVER=3 ./release-test.sh
- python: 3.5
script: RELEASE_SKIP=head PYVER=3 ./release-test.sh
- python: 3.6
script: RELEASE_SKIP=head PYVER=3 ./release-test.sh

install:
- pip2 install tox-travis || pip3 install tox-travis
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include Makefile gittaggers.py
include tests/*
include tests/test-data/*
include cwltest/tests/*
include cwltest/tests/test-data/*
global-exclude *~
global-exclude *.pyc

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ VERSION=1.0.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

## all : default task
all:
all: FORCE
pip install -e .

## help : print this help message and exit
Expand Down Expand Up @@ -131,7 +131,7 @@ diff-cover.html: coverage-gcovr.xml coverage.xml
--html-report diff-cover.html

## test : run the ${MODULE} test suite
test: FORCE
test: all
./setup.py test

sloccount.sc: ${PYSOURCES} Makefile
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/mock_cwl_runner.py → cwltest/tests/mock_cwl_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ERROR_TOOL = "return-1.cwl"


def main():
def main(): # type: ()->int
parser = argparse.ArgumentParser()
parser.add_argument("processfile")
parser.add_argument("jobfile")
Expand All @@ -24,4 +24,4 @@ def main():


if __name__ == "__main__":
main()
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion tests/test_argparse.py → cwltest/tests/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ def test_arg(self):

if __name__ == '__main__':
unittest.main()

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 18 additions & 15 deletions release-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@ PYVER=${PYVER:=2.7}

rm -Rf testenv${PYVER}_? || /bin/true

export HEAD=`git rev-parse HEAD`
virtualenv testenv${PYVER}_1 -p python${PYVER}
export HEAD=${TRAVIS_PULL_REQUEST_SHA:-$(git rev-parse HEAD)}
if [ "${RELEASE_SKIP}" != "head" ]
then
virtualenv testenv${PYVER}_1 -p python${PYVER}
# First we test the head
source testenv${PYVER}_1/bin/activate
rm testenv${PYVER}_1/lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
make install-dependencies
make test
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir testenv${PYVER}_1/not-${module}
# if there is a subdir named '${module}' py.test will execute tests
# there instead of the installed module's tests
pushd testenv${PYVER}_1/not-${module}; ../bin/${run_tests}; popd
fi

virtualenv testenv${PYVER}_2 -p python${PYVER}
virtualenv testenv${PYVER}_3 -p python${PYVER}
virtualenv testenv${PYVER}_4 -p python${PYVER}
virtualenv testenv${PYVER}_5 -p python${PYVER}

# First we test the head
source testenv${PYVER}_1/bin/activate
rm testenv${PYVER}_1/lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
make install-dependencies
make test
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir testenv${PYVER}_1/not-${module}
# if there is a subdir named '${module}' py.test will execute tests
# there instead of the installed module's tests
pushd testenv${PYVER}_1/not-${module}; ../bin/${run_tests}; popd


# Secondly we test via pip

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ignore = E124,E128,E129,E201,E202,E225,E226,E231,E265,E271,E302,E303,F401,E402,E
universal = 0

[tool:pytest]
testpaths = tests
testpaths = cwltest/tests

[aliases]
test=pytest
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest", "tests"],
packages=["cwltest", "cwltest.tests"],
package_data={'cwltest.tests': 'test-data/*'},
include_package_data=True,
install_requires=install_requires,
test_suite='tests',
setup_requires=[] + pytest_runner,
tests_require=['pytest'],
entry_points={
'console_scripts': ["cwltest=cwltest:main",
"mock-cwl-runner=tests.mock_cwl_runner:main"]
"mock-cwl-runner=cwltest.tests.mock_cwl_runner:main"]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
Expand Down

0 comments on commit 2d47780

Please sign in to comment.