convert testing infrastructure to tox
This converts the testing infrastructure to tox for both locally testing and travis. This is nearly equivalent to the previous testing with the only exception that linting fails with the first tool to fail and won't process all of them. Slightly tricky thing is that tox resets *all* of the environment for it's subprocess runs by default. A couple of the dependencies we have will not install in non UTF8 locales: temper-python & XBee.
This commit is contained in:
1 parent
278033cbf9
commit
97c0f5bb5a
7 files changed
+82
-104
No files matched your search
@@ -1,42 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# script/cibuild: Setup environment for CI to run tests. This is primarily
|
||||
# designed to run on the continuous integration server.
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if [ -z "$TRAVIS_PYTHON_VERSION" -o "$TRAVIS_PYTHON_VERSION" = "3.5" ]; then
|
||||
echo "Verifying requirements_all.txt..."
|
||||
python3 setup.py -q develop
|
||||
tput setaf 1
|
||||
script/gen_requirements_all.py validate
|
||||
VERIFY_REQUIREMENTS_STATUS=$?
|
||||
tput sgr0
|
||||
else
|
||||
VERIFY_REQUIREMENTS_STATUS=0
|
||||
fi
|
||||
|
||||
if [ "$VERIFY_REQUIREMENTS_STATUS" != "0" ]; then
|
||||
exit $VERIFY_REQUIREMENTS_STATUS
|
||||
fi
|
||||
|
||||
script/bootstrap_server > /dev/null
|
||||
DEP_INSTALL_STATUS=$?
|
||||
|
||||
if [ "$DEP_INSTALL_STATUS" != "0" ]; then
|
||||
exit $DEP_INSTALL_STATUS
|
||||
fi
|
||||
|
||||
if [ "$TRAVIS_PYTHON_VERSION" != "3.5" ]; then
|
||||
NO_LINT=1
|
||||
fi
|
||||
|
||||
export NO_LINT
|
||||
|
||||
script/test coverage
|
||||
|
||||
STATUS=$?
|
||||
|
||||
coveralls
|
||||
|
||||
exit $STATUS
|
||||
+5
-21
@@ -1,22 +1,6 @@
|
||||
# Run style checks
|
||||
#!/bin/sh
|
||||
#
|
||||
# NOTE: all testing is now driven through tox. The tox command below
|
||||
# performs roughly what this test did in the past.
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "Checking style with flake8..."
|
||||
tput setaf 1
|
||||
flake8 --exclude www_static homeassistant
|
||||
FLAKE8_STATUS=$?
|
||||
tput sgr0
|
||||
|
||||
echo "Checking style with pylint..."
|
||||
tput setaf 1
|
||||
pylint homeassistant
|
||||
PYLINT_STATUS=$?
|
||||
tput sgr0
|
||||
|
||||
if [ $FLAKE8_STATUS -eq 0 ]
|
||||
then
|
||||
exit $PYLINT_STATUS
|
||||
else
|
||||
exit $FLAKE8_STATUS
|
||||
fi
|
||||
tox -e lint
|
||||
+4
-28
@@ -1,30 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# NOTE: all testing is now driven through tox. The tox command below
|
||||
# performs roughly what this test did in the past.
|
||||
|
||||
# script/test: Run test suite for application. Optionally pass in a path to an
|
||||
# individual test file to run a single test.
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "Running tests..."
|
||||
|
||||
if [ "$1" = "coverage" ]; then
|
||||
py.test -v --timeout=30 --cov --cov-report=
|
||||
TEST_STATUS=$?
|
||||
else
|
||||
py.test -v --timeout=30
|
||||
TEST_STATUS=$?
|
||||
fi
|
||||
|
||||
if [ "$NO_LINT" = "1" ]; then
|
||||
LINT_STATUS=0
|
||||
else
|
||||
script/lint
|
||||
LINT_STATUS=$?
|
||||
fi
|
||||
|
||||
if [ $LINT_STATUS -eq 0 ]
|
||||
then
|
||||
exit $TEST_STATUS
|
||||
else
|
||||
exit $LINT_STATUS
|
||||
fi
|
||||
tox -e py34
|
||||
Reference in new issue
Block a user