From 523e1e2ee8c597a0e9570e54f20bdee56c3a0efe Mon Sep 17 00:00:00 2001 From: Fred Park Date: Fri, 13 Oct 2017 09:51:04 -0700 Subject: [PATCH] Switch from Coveralls to Codecov - Prevent AppVeyor from building a Docker image on PR --- .codecov.yml | 4 ++++ .coveragerc | 1 + .travis.yml | 4 ++-- README.md | 3 +-- appveyor.yml | 8 ++++++-- test_requirements.txt | 3 ++- tox.ini | 1 + 7 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..faa8660 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,4 @@ +coverage: + round: down + precision: 5 + range: "100...100" diff --git a/.coveragerc b/.coveragerc index 5fc34c3..c66d280 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,5 @@ [run] +source = blobxfer omit = **/test/* diff --git a/.travis.yml b/.travis.yml index e11bd5d..8e1de44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,13 +30,13 @@ install: - export BLOBXFER_NOBUILD=$([[ "$TRAVIS_PYTHON_VERSION" == "3.5" ]] || [[ "$TRAVIS_OS_NAME" == "osx" ]] || echo 1) - travis_retry pip install --upgrade pip - travis_retry pip install --upgrade setuptools wheel -- travis_retry pip install --upgrade coveralls tox-travis +- travis_retry pip install --upgrade codecov tox-travis script: - tox after_success: -- coveralls --rcfile=.coveragerc --verbose +- codecov - echo BLOBXFER_NOBUILD=$BLOBXFER_NOBUILD before_deploy: diff --git a/README.md b/README.md index 7826150..3524321 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ [![Build Status](https://travis-ci.org/Azure/blobxfer.svg?branch=master)](https://travis-ci.org/Azure/blobxfer) [![Build status](https://ci.appveyor.com/api/projects/status/qgth9p7jlessgp5i/branch/master?svg=true)](https://ci.appveyor.com/project/alfpark/blobxfer) -[![Coverage Status](https://coveralls.io/repos/github/Azure/blobxfer/badge.svg?branch=master)](https://coveralls.io/github/Azure/blobxfer?branch=master) +[![codecov](https://codecov.io/gh/Azure/blobxfer/branch/master/graph/badge.svg)](https://codecov.io/gh/Azure/blobxfer) [![PyPI](https://img.shields.io/pypi/v/blobxfer.svg)](https://pypi.python.org/pypi/blobxfer) -[![PyPI](https://img.shields.io/pypi/pyversions/blobxfer.svg)](https://pypi.python.org/pypi/blobxfer) [![Docker Pulls](https://img.shields.io/docker/pulls/alfpark/blobxfer.svg)](https://hub.docker.com/r/alfpark/blobxfer) [![Image Layers](https://images.microbadger.com/badges/image/alfpark/blobxfer:latest.svg)](http://microbadger.com/images/alfpark/blobxfer) diff --git a/appveyor.yml b/appveyor.yml index 35770b9..888b0c7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -58,6 +58,10 @@ after_test: bin\\%BLOBXFER_ARTIFACT% upload --remote-path releases/%APPVEYOR_REPO_TAG_NAME% --local-path bin\\%BLOBXFER_ARTIFACT% --strip-components 1 --file-md5 --overwrite ) - ps: >- + if (!($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)) { + Write-Host "Build is from a PR, not creating a Docker image" + return + } if ($Env:PYTHON_VERSION -eq "3.6") { $DOCKER_IMAGE_TAG_SUFFIX = $null if ($Env:APPVEYOR_REPO_TAG -eq "true") { @@ -70,8 +74,8 @@ after_test: $DOCKER_IMAGE_TAG_SUFFIX = 'develop-windows' } if ($DOCKER_IMAGE_TAG_SUFFIX -eq $null) { - Write-Host "Image tag suffix is null, not creating a Docker image" - return + Write-Host "Image tag suffix is null, not creating a Docker image" + return } $DOCKER_IMAGE_TAG = $Env:DOCKER_IMAGE_TAG_PREFIX + $DOCKER_IMAGE_TAG_SUFFIX Write-Host "Creating image with tag: $DOCKER_IMAGE_TAG" diff --git a/test_requirements.txt b/test_requirements.txt index e7ecca2..7b66184 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,4 +1,5 @@ +coverage>=4.4.1 flake8>=3.4.1 mock>=2.0.0; python_version < '3.3' -pytest>=3.2.0 +pytest>=3.2.3 pytest-cov>=2.5.1 diff --git a/tox.ini b/tox.ini index a0d81eb..e3870e5 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ envlist = py27, py34, py35, py36 [testenv] deps = -rtest_requirements.txt +passenv = CI TRAVIS TRAVIS_* commands = flake8 {envsitepackagesdir}/blobxfer_cli/ flake8 {envsitepackagesdir}/blobxfer/