Check the test-suite specific coverage file, and upload it earlier in the process
This commit is contained in:
@@ -331,12 +331,14 @@ def coverage():
|
||||
report_dir = Env.REPORT_DIR
|
||||
rcfile = Env.PYTHON_COVERAGERC
|
||||
|
||||
if not (report_dir / '.coverage').isfile():
|
||||
combined_report_file = report_dir / '{}.coverage'.format(os.environ.get('TEST_SUITE', ''))
|
||||
|
||||
if not combined_report_file.isfile():
|
||||
# This may be that the coverage files were generated using -p,
|
||||
# try to combine them to the one file that we need.
|
||||
sh(u"coverage combine --rcfile={}".format(rcfile))
|
||||
|
||||
if not os.path.getsize(report_dir / '.coverage') > 50:
|
||||
if not os.path.getsize(combined_report_file) > 50:
|
||||
# Check if the .coverage data file is larger than the base file,
|
||||
# because coverage combine will always at least make the "empty" data
|
||||
# file even when there isn't any data to be combined.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# This script generates coverage and diff cover reports, and optionally
|
||||
# reports this data to codecov.io. The following environment variables must be
|
||||
@@ -14,6 +15,10 @@ source scripts/jenkins-common.sh
|
||||
# Get the diff coverage and html reports for unit tests
|
||||
paver coverage -b $TARGET_BRANCH
|
||||
|
||||
if [[ -n "$PYTEST_CONTEXTS" ]]; then
|
||||
paver upload_coverage_to_s3
|
||||
fi
|
||||
|
||||
# Test for the CodeCov API token
|
||||
if [ -z $CODE_COV_TOKEN ]; then
|
||||
echo "codecov.io API token not set."
|
||||
@@ -27,7 +32,3 @@ fi
|
||||
# JUnit test reporter will fail the build
|
||||
# if it thinks test results are old
|
||||
touch `find . -name *.xml` || true
|
||||
|
||||
if [[ -n "$PYTEST_CONTEXTS" ]]; then
|
||||
paver upload_coverage_to_s3
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user