diff --git a/.ci/travis/install.sh b/.ci/travis/install.sh index e70ca477..7a8b35da 100755 --- a/.ci/travis/install.sh +++ b/.ci/travis/install.sh @@ -16,6 +16,7 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then fi pip install --upgrade pip -pip install wheel coverage==3.7.1 python-coveralls mock +pip install --upgrade setuptools +pip install -r requirements_test.txt python setup.py develop pip freeze diff --git a/.ci/travis/test.sh b/.ci/travis/test.sh index dbff0667..d922fc5c 100755 --- a/.ci/travis/test.sh +++ b/.ci/travis/test.sh @@ -2,15 +2,18 @@ if [[ "$READTHEDOCS" == "1" ]]; then make -C docs html -fi - -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - if which pyenv > /dev/null; then - eval "$(pyenv init -)" +else + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + if which pyenv > /dev/null; then + eval "$(pyenv init -)" + fi + pyenv activate virtualenv + coverage run --branch $VIRTUAL_ENV/bin/trial tests + else + coverage run --branch `which trial` tests/ fi - pyenv activate virtualenv - coverage run --branch $VIRTUAL_ENV/bin/trial tests -else - coverage run --branch `which trial` tests/ + # Upload code coverage to codecov.io + coverage xml + codecov --required fi diff --git a/.travis.yml b/.travis.yml index 3f42ce7c..85145f19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,3 @@ install: script: - ./.ci/travis/test.sh - -after_success: - - coveralls diff --git a/README.rst b/README.rst index eb6d5191..ee04ab1a 100644 --- a/README.rst +++ b/README.rst @@ -83,6 +83,7 @@ checkout the configuration files used to run the tests on Travis and Appveyor: virtualenv env . env/bin/activate + pip install -r requirements_test.txt pip install -e . --egg trial tests @@ -90,7 +91,7 @@ checkout the configuration files used to run the tests on Travis and Appveyor: virtualenv env env\Scripts\activate - %VIRTUALE_ENV%\Scripts\pip.exe install wheel + %VIRTUALE_ENV%\Scripts\pip.exe -r requirements_test.txt %VIRTUALE_ENV%\Scripts\pip.exe install -e . --egg %VIRTUALE_ENV%\Scripts\python.exe %VIRTUALE_ENV%\Scripts\trial.py tests diff --git a/appveyor.yml b/appveyor.yml index 615b0c77..dbccda22 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ clone_folder: c:\\project test_script: - ps: cd C:\\project - - "%WITH_COMPILER% %PYTHON%\\Scripts\\pip.exe install wheel mock coverage" + - "%WITH_COMPILER% %PYTHON%\\Scripts\\pip.exe install -r C:\\project\\requirements_test.txt" - "%WITH_COMPILER% %PYTHON%\\Scripts\\pip.exe install ." # Twisted's trial does not build entrypoints on Windows so we have @@ -29,7 +29,9 @@ test_script: after_test: - "%WITH_COMPILER% %PYTHON%\\python.exe setup.py bdist_wheel" - - "%PYTHON%\\Scripts\\coverage.exe report" + - "%PYTHON%\\Scripts\\coverage.exe xml" + - "%PYTHON%\\Scripts\\codecov.exe --required" artifacts: - - path: dist\* + - path: dist\.whl + - path: .coverage diff --git a/requirements_test.txt b/requirements_test.txt new file mode 100644 index 00000000..f1b3a9fb --- /dev/null +++ b/requirements_test.txt @@ -0,0 +1,4 @@ +codecov +coverage==3.7.1 +mock +wheel