From 48a71c2ebeace366cde98977f0bd13da7dbf7121 Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Wed, 6 Nov 2024 07:29:23 -0400 Subject: [PATCH] feat: remove codecov --- .circleci/config.yml | 28 ------------ README.md | 2 - automation/emit_coverage_info.sh | 57 ------------------------- automation/upload-to-codecov.sh | 36 ---------------- codecov.yml | 11 ----- docs/howtos/testing-a-rust-component.md | 4 -- 6 files changed, 138 deletions(-) delete mode 100755 automation/emit_coverage_info.sh delete mode 100755 automation/upload-to-codecov.sh delete mode 100644 codecov.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b79a84e2..2452101c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,15 +47,6 @@ commands: - run: | sccache --version sccache --zero-stats - install-grcov: - steps: - - run: - name: Install grcov - command: | - cargo install --locked grcov@0.8.19 - # Run in a different shell to source $BASH_ENV - - run: | - grcov --version install-mdbook: steps: - run: @@ -234,22 +225,6 @@ jobs: - test-setup - run: ./automation/tests.py rust-clippy - save-sccache-cache - Generate code coverage: - executor: docker - resource_class: large - steps: - - full-checkout - - test-setup - - install-grcov - # Test coverage support in Rust has been evolving rapidly, use nightly - # in the hope of getting the best support/features on that front. - - run: RUSTUP_TOOLCHAIN="nightly" bash ./automation/emit_coverage_info.sh - - run: - name: Compile coverage - command: grcov ./target/debug/ -s . -t lcov --llvm --ignore-not-existing --ignore "target/*" --ignore "/*" -o lcov.info - - run: - name: Upload to codecov.io - command: ./automation/upload-to-codecov.sh Check Protobuf files are up-to-date: executor: docker resource_class: small @@ -345,9 +320,6 @@ workflows: run-tests-min-supported-version: jobs: - Rust tests - min supported rust version - coverage: - jobs: - - Generate code coverage ios-test: jobs: - iOS test diff --git a/README.md b/README.md index 3e2a2cecc..1070326d2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ - - # Firefox Application Services Application Services (a-s) is a collection of Rust Components that are used to enable Firefox applications to integrate with Firefox accounts, sync, experimentation, etc. Each component is built using a core of shared code written in Rust, wrapped with native language bindings for different platforms. diff --git a/automation/emit_coverage_info.sh b/automation/emit_coverage_info.sh deleted file mode 100755 index b731cfbb2..000000000 --- a/automation/emit_coverage_info.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash - -# Run tests in order to produce coverage data. Does not collect coverage data, -# just produces it. Note that we ignore all test failures -- some of the -# experimental flags we use cause test failures, we don't really care, other CI -# tasks check this anyway. -# -# Note that running this outside of CI doesn't work on all platforms. In -# particular, macos needs further patches in order to work, probably windows -# too. It's really intended for use inside CI only. -# -# Finally, this must be done on nightly -- `cargo-tarpaulin`, which works on -# stable, also has issues with NSS, but not ones that seem easy to work around. -# As a result, we use `grcov`. Ultimately `grcov` should long-term allow us to -# integrate coverage data from over the FFI, which is a huge plus to this -# approach, so it's probably for the best, even if `grcov`'s actual coverage -# information seems to be of lower quality than `tarpaulin`. - -if [[ ! -f "$PWD/automation/emit_coverage_info.sh" ]] -then - echo "emit_coverage_info.sh must be executed from the root directory." - exit 1 -fi - -cargo +nightly clean -# Note that incremental builds, as well as sccache seems to break coverage :(. -# So, we disable those. -export CARGO_INCREMENTAL=0 -unset RUSTC_WRAPPER -# TODO: re-add `-Clink-dead-code` to RUSTFLAGS -- right now it causes a build -# linker error in NSS, as apparently some part of NSS we don't use doesn't have -# the build flags set up correctly. This makes our code coverage accuracy worse, -# but AFAICT, not in a massive way -- or at least codecov.io seems to account -# for it in some manner. -# -# Also, this `--cfg coverage` is how the `#[cfg(coverage)]` we use in some parts -# of the rust code comes into existence (it's non-standard) -export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort --cfg coverage"; -export RUSTDOCFLAGS="-Cpanic=abort" - -# Apparently --no-default-features doesn't work in the root, even with -p to select a specific package. -# Instead we pull the list of individual package manifest files which have default features -# out of `cargo metadata` and test using --manifest-path for each individual package. -for manifest in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select((.features | .default | length) > 0 or .name == "nimbus-fml") | .manifest_path'); do - package=$(dirname "$manifest") - package=$(basename "$package") - echo "## no-default-features test for package $package (manifest @ $manifest)" - cargo +nightly test --manifest-path "$manifest" --no-default-features --no-fail-fast || true -done - -cargo +nightly test --all --no-fail-fast || true - -cargo +nightly run -p sync-test || true -cargo +nightly run -p protobuf-gen -- tools/protobuf_files.toml || true -cargo +nightly run -p systest || true - -env RUSTFLAGS="--cfg __appsvc_ci_hack $RUSTFLAGS" cargo +nightly test --all --all-features --no-fail-fast || true diff --git a/automation/upload-to-codecov.sh b/automation/upload-to-codecov.sh deleted file mode 100755 index 158b42fae..000000000 --- a/automation/upload-to-codecov.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -set -ex - -# Make the reports file, which combines all reports together (currently we just have 1) -touch reports -cat lcov.info >> reports -echo '<<<<<< EOF' >> reports - -# Calculate query params (most of this was taken from the bash uploader script) - -# https://circleci.com/docs/environment-variables - -service="circleci" -branch="$CIRCLE_BRANCH" -build="$CIRCLE_BUILD_NUM" -job="$CIRCLE_NODE_INDEX" -if [ "$CIRCLE_PROJECT_REPONAME" != "" ]; -then - slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" -else - # git@github.com:owner/repo.git - slug="${CIRCLE_REPOSITORY_URL##*:}" - # owner/repo.git - slug="${slug%%.git}" -fi -pr="${CIRCLE_PULL_REQUEST##*/}" -commit="$CIRCLE_SHA1" - - -query="commit=${commit}&branch=${branch}&build=${build}&job=${job}&slug=${slug}&service=${service}&pr=${pr}" -url="https://codecov.io/upload/v2?${query}" - -echo "Codecov URL: ${url}" - -curl -X POST --data-binary @reports "${url}" diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 1750d9f77..000000000 --- a/codecov.yml +++ /dev/null @@ -1,11 +0,0 @@ -coverage: - # Tell codecov our default branch. - branch: main - # Don't trigger CI failure on coverage reduction. - status: - project: - default: - informational: true - patch: - default: - informational: true \ No newline at end of file diff --git a/docs/howtos/testing-a-rust-component.md b/docs/howtos/testing-a-rust-component.md index 3cf9066d5..5aa10ff62 100644 --- a/docs/howtos/testing-a-rust-component.md +++ b/docs/howtos/testing-a-rust-component.md @@ -106,10 +106,6 @@ a manual process involving: Ideally some or all of this would be automated and run in CI, but we have not yet invested in such automation. -## Test Coverage - -We currently have code coverage reporting on Github using [codecov](https://github.com/mozilla/application-services/blob/main/codecov.yml). However, our code coverage does not tell us how much more coverage is caused by our consumers' tests. - ## Ideas for Improvement * ASan, Memsan, and maybe other sanitizer checks, especially around the points where we cross FFI boundaries.