jenkins-report.sh 926 Bytes
Newer Older
1
#!/usr/bin/env bash
stu committed
2
set -e
Christine Lytwynec committed
3

stu committed
4 5 6 7 8
# This script generates coverage and diff cover reports, and optionally
# reports this data to codecov.io. The following environment variables must be
# set in order to report to codecov:
# CODE_COV_TOKEN: CodeCov API token
# CI_BRANCH: The branch that the coverage report describes
stu committed
9

Christine Lytwynec committed
10 11
# This script is used by the edx-platform-unit-coverage jenkins job.

12 13
source scripts/jenkins-common.sh

14
# Get the diff coverage and html reports for unit tests
15
paver coverage
16

stu committed
17 18 19 20 21 22 23 24 25
# Test for the CodeCov API token
if [ -z $CODE_COV_TOKEN ]; then
    echo "codecov.io API token not set."
    echo "This must be set as an environment variable if order to report coverage"
else
    # Send the coverage data to codecov
    pip install codecov==2.0.5
    codecov --token=$CODE_COV_TOKEN --branch=$CI_BRANCH
fi
26

27 28 29
# JUnit test reporter will fail the build
# if it thinks test results are old
touch `find . -name *.xml` || true