Closed Bug 1563601 Opened 6 years ago Closed 6 years ago

Should we have a test coverage CI task for glean-core?

Categories

(Data Platform and Tools :: Glean: SDK, task, P1)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: chutten|PTO, Assigned: janerik)

Details

(Whiteboard: [telemetry:glean-rs:m8])

Attachments

(1 file)

Codecov's enabled on mozilla/mobile/android-components, but not on mozilla/glean which means we're covered on glean-ac but not glean-core.

Should we look into fixing that, maybe?

Priority: -- → P3
Whiteboard: [telemetry:glean-rs:m?]
Whiteboard: [telemetry:glean-rs:m?] → [telemetry:glean-rs:m8]

I played around with this today shortly using mozilla's own grcov.
It's as easy as:

export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"
cargo +nightly build
cargo +nightly test
grcov target/ -t lcov --ignore-not-existing --ignore-dir "/*" > lcov.info
genhtml -o report/ --show-details --highlight --ignore-errors source --legend lcov.info

to generate coverage info and render it to HTML (genhtml is from the lcov package).

Uploading it to codecov.io is just as easy. The last commands become:

zip -0 ccov.zip `find . \( -name "glean*.gc*" \) -print`
grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir "/*" -o lcov.info;
export CODECOV_TOKEN="secret"
./codecov.sh -f lcov.info;

Example upload in my forked repository: https://codecov.io/gh/badboy/glean/tree/master/glean-core

I plan to add that to CI for the Rust part, we can then iterate and try to include the Kotlin coverage in another step.

Assignee: nobody → jrediger
Priority: P3 → P1
Attached file GitHub Pull Request
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: