Unverified Commit b62b792f authored by Denis_P's avatar Denis_P 👙 Committed by GitHub

Coverage report fixes (#390)

* test (ci): add covfix [skip ci]

* test (ci): more vars (newer cov data) [skip ci]

* test (ci): 2 more flags [skip ci]

* test (ci): 2 more flags, filtered [skip ci]

* test (ci): 2 more flags, filtered! [skip ci]

* test (ci): 1 flag, grcov [skip ci]

* test (ci): 1 flag, covfix [skip ci]

* test (ci): covfix report wo branches [skip ci]

* test (ci): 2 covfix reports

* test (ci): CI debug, run only this job

* test (ci): codecov config

* test (ci): codecov config 2

* test (ci): codecov config 3

* change (ci): code coverage reports with lines only and with branch coverage

* Update .gitlab-ci.yml
Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
parent 1d392516
Pipeline #91089 skipped
...@@ -109,26 +109,29 @@ codecov: ...@@ -109,26 +109,29 @@ codecov:
needs: needs:
- check-std - check-std
variables: variables:
# According to https://github.com/mozilla/grcov/blob/master/README.md # Variables partly came from https://github.com/mozilla/grcov/blob/master/README.md
# we have to use these variables.
CARGO_INCREMENTAL: 0 CARGO_INCREMENTAL: 0
# If `-Zno-landing-pads` is enabled some some tests start to fail. RUSTFLAGS: "-Zprofile -Zmir-opt-level=0 -Zpanic_abort_tests -Ccodegen-units=1
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" -Cinline-threshold=0 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off"
# The `cargo-taurpalin` coverage reporting tool seems to have better code instrumentation # The `cargo-taurpalin` coverage reporting tool seems to have better code instrumentation and thus
# and thus produces better results for Rust codebases in general. However, unlike `grcov` it # produces better results for Rust codebases in general. However, unlike `grcov` it requires
# requires running docker with `--security-opt seccomp=unconfined` which is why we use `grcov` # running docker with `--security-opt seccomp=unconfined` which is why we use `grcov` instead.
# instead.
script: script:
# RUSTFLAGS are the cause target cache can't be used here # RUSTFLAGS are the cause target cache can't be used here
- unset "CARGO_TARGET_DIR" - unset "CARGO_TARGET_DIR"
- cargo clean - cargo clean
- cargo test --verbose --all-features --no-fail-fast --workspace - cargo test --verbose --all-features --no-fail-fast --workspace
- cargo build --verbose --all-features --workspace - cargo build --verbose --all-features --workspace
- grcov ./target -s . -t coveralls+ --guess-directory-when-missing --llvm --branch --ignore-not-existing --ignore "/*" # coverage with branches
--token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" --output-file ccov.json - grcov ./target -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" --ignore "tests/*" -o lcov-w-branch.info
- rust-covfix -o lcov-w-branch.info lcov-w-branch.info
# We'd like to not use a remote bash script for uploading the coverage reports, # We'd like to not use a remote bash script for uploading the coverage reports,
# however this job seems to be more tricky than we hoped. # however this job seems to be more tricky than we hoped.
- bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_P_TOKEN" -f lcov-w-branch.info
# lines coverage
- grcov ./target -s . -t lcov --llvm --ignore-not-existing --ignore "/*" --ignore "tests/*" -o lcov-lines.info
- rust-covfix -o lcov-lines.info lcov-lines.info
- bash <(curl -s https://codecov.io/bash) -f lcov-lines.info
clippy-std: clippy-std:
stage: workspace stage: workspace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment