From 5bc01cd51a9b320844d025c32de9f5c10136dd4d Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Sat, 1 Sep 2018 14:05:12 -1000 Subject: [PATCH] Revive code coverage --- ci/buildkite.yml | 2 +- ci/test-nightly.sh | 36 +++++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ci/buildkite.yml b/ci/buildkite.yml index 7af1bb6a5b..9e53967e14 100644 --- a/ci/buildkite.yml +++ b/ci/buildkite.yml @@ -12,7 +12,7 @@ steps: - command: "ci/shellcheck.sh" name: "shellcheck [public]" timeout_in_minutes: 20 - - command: "ci/docker-run.sh solanalabs/rust-nightly:2018-09-28 ci/test-nightly.sh || true" + - command: "ci/docker-run.sh solanalabs/rust-nightly:2018-09-28 ci/test-nightly.sh" name: "nightly [public]" env: CARGO_TARGET_CACHE_NAME: "nightly" diff --git a/ci/test-nightly.sh b/ci/test-nightly.sh index 24eaa1248c..1af99cea44 100755 --- a/ci/test-nightly.sh +++ b/ci/test-nightly.sh @@ -13,17 +13,31 @@ _() { _ cargo build --verbose --features unstable _ cargo test --verbose --features=unstable -exit 0 +maybe_cargo_install() { + for cmd in "$@"; do + set +e + cargo "$cmd" --help > /dev/null 2>&1 + declare exitcode=$? + set -e + if [[ $exitcode -eq 101 ]]; then + _ cargo install cargo-"$cmd" + fi + done +} -# Coverage disabled (see issue #433) -_ cargo cov test -_ cargo cov report +maybe_cargo_install cov -echo --- Coverage report: -ls -l target/cov/report/index.html +_ cargo cov clean +_ cargo cov test --lib -if [[ -z "$CODECOV_TOKEN" ]]; then - echo CODECOV_TOKEN undefined -else - bash <(curl -s https://codecov.io/bash) -x 'llvm-cov-6.0 gcov' -fi +# TODO: Fix `cargo cov report` in Docker. +#_ cargo cov report +# +#echo --- Coverage report: +#ls -l target/cov/report/index.html +# +#if [[ -z "$CODECOV_TOKEN" ]]; then +# echo CODECOV_TOKEN undefined +#else +# bash <(curl -s https://codecov.io/bash) -x 'llvm-cov-6.0 gcov' +#fi