Upload coverage HTML reports (#1421)
Uploads two reports to Buildkite, one from cargo-cov and one from lcov via grcov. The lcov one is busted on linux and is what we need to bring codecov.io back up again. It works great on macos if you wanted to generate them locally and prefer lcov HTML reports. * Also comment out non-coverage build to speed things up.
This commit is contained in:
parent
da0404ad03
commit
9c0fa4d1d2
|
@ -4,7 +4,7 @@ steps:
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_CACHE_NAME: "stable"
|
CARGO_TARGET_CACHE_NAME: "stable"
|
||||||
timeout_in_minutes: 30
|
timeout_in_minutes: 30
|
||||||
- command: "ci/docker-run.sh solanalabs/rust-nightly:2018-09-28 ci/test-bench.sh"
|
- command: "ci/docker-run.sh solanalabs/rust-nightly:2018-10-04 ci/test-bench.sh"
|
||||||
name: "bench [public]"
|
name: "bench [public]"
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_CACHE_NAME: "nightly"
|
CARGO_TARGET_CACHE_NAME: "nightly"
|
||||||
|
@ -12,7 +12,7 @@ steps:
|
||||||
- command: "ci/shellcheck.sh"
|
- command: "ci/shellcheck.sh"
|
||||||
name: "shellcheck [public]"
|
name: "shellcheck [public]"
|
||||||
timeout_in_minutes: 20
|
timeout_in_minutes: 20
|
||||||
- command: "ci/docker-run.sh solanalabs/rust-nightly:2018-09-28 ci/test-nightly.sh"
|
- command: "ci/docker-run.sh solanalabs/rust-nightly:2018-10-04 ci/test-nightly.sh"
|
||||||
name: "nightly [public]"
|
name: "nightly [public]"
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_CACHE_NAME: "nightly"
|
CARGO_TARGET_CACHE_NAME: "nightly"
|
||||||
|
|
|
@ -4,7 +4,6 @@ ARG date
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
rustup install nightly-$date && \
|
rustup install nightly-$date && \
|
||||||
rustup default nightly-$date && \
|
rustup default nightly-$date && \
|
||||||
rustup component add clippy-preview --toolchain=nightly-$date && \
|
|
||||||
rustc --version && \
|
rustc --version && \
|
||||||
cargo --version && \
|
cargo --version && \
|
||||||
cargo +nightly-$date install cargo-cov
|
cargo +nightly-$date install cargo-cov
|
||||||
|
|
|
@ -13,6 +13,7 @@ RUN set -x && \
|
||||||
apt install -y \
|
apt install -y \
|
||||||
buildkite-agent \
|
buildkite-agent \
|
||||||
cmake \
|
cmake \
|
||||||
|
lcov \
|
||||||
libclang-common-7-dev \
|
libclang-common-7-dev \
|
||||||
llvm-7 \
|
llvm-7 \
|
||||||
rsync \
|
rsync \
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
source ci/upload_ci_artifact.sh
|
||||||
|
|
||||||
ci/version-check.sh nightly
|
ci/version-check.sh nightly
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
|
@ -10,8 +11,8 @@ _() {
|
||||||
"$@"
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
_ cargo build --verbose --features unstable
|
# Uncomment this to run nightly test suit
|
||||||
_ cargo test --verbose --features=unstable
|
# _ cargo test --verbose --features=unstable
|
||||||
|
|
||||||
maybe_cargo_install() {
|
maybe_cargo_install() {
|
||||||
for cmd in "$@"; do
|
for cmd in "$@"; do
|
||||||
|
@ -27,17 +28,33 @@ maybe_cargo_install() {
|
||||||
|
|
||||||
maybe_cargo_install cov
|
maybe_cargo_install cov
|
||||||
|
|
||||||
|
# Generate coverage data and report via unit-test suite.
|
||||||
_ cargo cov clean
|
_ cargo cov clean
|
||||||
_ cargo cov test --lib
|
_ cargo cov test --lib
|
||||||
_ cargo cov report
|
_ cargo cov report
|
||||||
|
|
||||||
echo --- Coverage report:
|
# Generate a coverage report with grcov via lcov.
|
||||||
ls -l target/cov/report/index.html
|
if [[ ! -f ./grcov ]]; then
|
||||||
|
uname=$(uname | tr '[:upper:]' '[:lower:]')
|
||||||
|
uname_m=$(uname -m | tr '[:upper:]' '[:lower:]')
|
||||||
|
name=grcov-${uname}-${uname_m}.tar.bz2
|
||||||
|
_ wget "https://github.com/mozilla/grcov/releases/download/v0.2.3/${name}"
|
||||||
|
_ tar -xjf "${name}"
|
||||||
|
fi
|
||||||
|
_ ./grcov . -t lcov > lcov.info
|
||||||
|
_ genhtml -o target/cov/report-lcov --show-details --highlight --ignore-errors source --legend lcov.info
|
||||||
|
|
||||||
|
# Upload to tarballs to buildkite.
|
||||||
|
_ cd target/cov && tar -cjf cov-report.tar.bz2 report/* && cd -
|
||||||
|
_ upload_ci_artifact "target/cov/cov-report.tar.bz2"
|
||||||
|
|
||||||
|
_ cd target/cov && tar -cjf lcov-report.tar.bz2 report-lcov/* && cd -
|
||||||
|
_ upload_ci_artifact "target/cov/lcov-report.tar.bz2"
|
||||||
|
|
||||||
if [[ -z "$CODECOV_TOKEN" ]]; then
|
if [[ -z "$CODECOV_TOKEN" ]]; then
|
||||||
echo CODECOV_TOKEN undefined
|
echo CODECOV_TOKEN undefined
|
||||||
else
|
else
|
||||||
# TODO: Fix this.
|
|
||||||
true
|
true
|
||||||
#bash <(curl -s https://codecov.io/bash) -x 'llvm-cov-7 gcov'
|
# TODO: Why doesn't codecov grok our lcov files?
|
||||||
|
#bash <(curl -s https://codecov.io/bash) -X gcov
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,7 +19,7 @@ require() {
|
||||||
|
|
||||||
case ${1:-stable} in
|
case ${1:-stable} in
|
||||||
nightly)
|
nightly)
|
||||||
require rustc 1.30.[0-9]+-nightly
|
require rustc 1.31.[0-9]+-nightly
|
||||||
require cargo 1.31.[0-9]+-nightly
|
require cargo 1.31.[0-9]+-nightly
|
||||||
;;
|
;;
|
||||||
stable)
|
stable)
|
||||||
|
|
Loading…
Reference in New Issue