Skip to content

Commit

Permalink
Globing in vls (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
andamian authored Mar 12, 2018
1 parent 6a14852 commit 1bbf8c4
Show file tree
Hide file tree
Showing 16 changed files with 958 additions and 67 deletions.
27 changes: 27 additions & 0 deletions .intTest
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Runs the integration tests for each module (if defined)

# work only with modules that have integration testing
# (test for presence of intTest directory)

[ -z "$TRAVIS_INTTEST_PROXY" ] && echo "TRAVIS_INTTEST_PROXY not set - skip integration tests" && exit 0

for cert in $(ls travis_inttest_proxy* | grep -v .pem); do
if [ ! -f $cert.pem ]; then
echo "$cert.pem not found"
openssl aes-256-cbc -pass "pass:$TRAVIS_INTTEST_PROXY" -in $cert -out $cert.pem -d -a
fi
done

for i in $(find . -type d -name intTest | awk -F '/' '{print $2}'); do
echo "Running integration tests for $i module"
cd $i
mkdir intTest/certs
for cert in $(ls ../*.pem); do
cp $cert intTest/certs
done
python setup.py intTest
cd -
echo "Done $i module"
done

5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ script:
cd $i;
pytest --cov $i || exit 1;
if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then
flake8 -v $i || break -1;
flake8 -v $i || exit -1;
fi;
cd ..;
done
Expand All @@ -34,6 +34,9 @@ after_success:

jobs:
include:
#- stage: intTest
#python: 3.5
#script: ./.intTest
- stage: publish
python: 3.4
deploy:
Expand Down
34 changes: 33 additions & 1 deletion vofs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,38 @@ def run_tests(self):
err_no = pytest.main(self.pytest_args)
sys.exit(err_no)

class PyIntTest(TestCommand):
"""class py.test for the int testing
"""
user_options = []

def __init__(self, dist, **kw):
TestCommand.__init__(self, dist, **kw)
self.pytest_args = ['intTest']

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
err_no = pytest.main(self.pytest_args)
sys.exit(err_no)

class PyAllTest(TestCommand):
"""class py.test for the unit and integration testing
"""
user_options = []

def __init__(self, dist, **kw):
TestCommand.__init__(self, dist, **kw)
self.pytest_args = ['--cov', PACKAGENAME, PACKAGENAME, 'intTest']

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
err_no = pytest.main(self.pytest_args)
sys.exit(err_no)

# Note that requires and provides should not be included in the call to
# ``setup``, since these are now deprecated. See this link for more details:
# https://groups.google.com/forum/#!topic/astropy-dev/urYO8ckB2uM
Expand Down Expand Up @@ -105,6 +137,6 @@ def run_tests(self):
'Programming Language :: Python :: 3.6'
],
cmdclass = {
'coverage': PyTest,
'coverage': PyTest, 'intTest': PyIntTest, 'allTest': PyAllTest
}
)
Binary file added vos/intTest/data/something.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1bbf8c4

Please sign in to comment.