From 1a8842d8c6cc47b995392a31f9381779ef4c6495 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 7 Oct 2018 02:09:46 +0300 Subject: [PATCH] test: upload coverage only on CRON Signed-off-by: Ruslan Kuprieiev --- scripts/ci/script.sh | 3 ++- tests/__main__.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/ci/script.sh b/scripts/ci/script.sh index b7491e764..f5c2d2618 100644 --- a/scripts/ci/script.sh +++ b/scripts/ci/script.sh @@ -6,7 +6,8 @@ set -e python -mtests if [[ "$TRAVIS_PULL_REQUEST" == "false" && \ - "$TRAVIS_SECURE_ENV_VARS" == "true" ]]; then + "$TRAVIS_SECURE_ENV_VARS" == "true" && \ + "$TRAVIS_EVENT_TYPE" == "cron" ]]; then codecov fi diff --git a/tests/__main__.py b/tests/__main__.py index 3a7eafee5..a20e4e684 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -7,4 +7,9 @@ os.chdir(REPO_ROOT) os.putenv('PATH', '{}:{}'.format(os.path.join(REPO_ROOT, 'bin'), os.getenv('PATH'))) os.putenv('DVC_HOME', REPO_ROOT) -check_call('nosetests -v --processes=-1 --process-timeout=200 --cover-inclusive --cover-erase --cover-package=dvc --with-coverage', shell=True) +cmd = 'nosetests -v --process-timeout=200 --cover-inclusive --cover-erase --cover-package=dvc --with-coverage' +# NOTE: run on CRON in single process mode to avoid problems in coverage +# module for nose tests, where it sometimes doesn't parse .coveragerc. +if not (os.getenv('TRAVIS') == 'true' and os.getenv('TRAVIS_EVENT_TYPE') == 'cron'): + cmd += ' --processes=-1' +check_call(cmd, shell=True)