forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins-report.sh
executable file
·29 lines (23 loc) · 944 Bytes
/
jenkins-report.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -e
# 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
# This script is used by the edx-platform-unit-coverage jenkins job.
source scripts/jenkins-common.sh
# Get the diff coverage and html reports for unit tests
paver coverage -b $TARGET_BRANCH
# 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
# JUnit test reporter will fail the build
# if it thinks test results are old
touch `find . -name *.xml` || true