Skip to content

Code coverage for the Rust code#642

Merged
imobachgs merged 3 commits intomasterfrom
rust-coverage
Jun 30, 2023
Merged

Code coverage for the Rust code#642
imobachgs merged 3 commits intomasterfrom
rust-coverage

Conversation

@imobachgs
Copy link
Copy Markdown
Contributor

@imobachgs imobachgs commented Jun 30, 2023

Problem

We do not have any report about the test coverage for the Rust code.

Solution

This PR enables code coverage reporting for the Rust code using Tarpaulin.

  • All jobs are using coverallsapp/github-action@v2 now.
  • Use cargo-binstall to install Tarpaulin, saving the build time. An alternative approach might be to package Tarpaulin ourselves.
  • rust_ci uses the yast-ruby container because the Coveralls GitHub Action was not working with the Tumbleweed image (IDK the reason).
  • rust_ci uses the cobertura format instead of lcov because the file names in the latter are absolute (which looks wrong). See the list of supported formats if you are interested.
  • Code coverage is ~15% 😞

Screenshots

Screenshot from 2023-06-30 11-42-29

@imobachgs imobachgs marked this pull request as ready for review June 30, 2023 10:47
@coveralls
Copy link
Copy Markdown

coveralls commented Jun 30, 2023

Coverage Status

coverage: 72.595% (-4.3%) from 76.846% when pulling 9336b1a on rust-coverage into 0fde6ba on master.

tool: cargo-binstall

- name: Install Tarpaulin (for code coverage)
run: cargo-binstall --no-confirm cargo-tarpaulin
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we have third way to install rust stuff? rustup component, cargo install and now cargo-binstall? It start to be quite messy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify: rustup is for managing the rust toolchain. cargo install is for binary crates (building for sources) and cargo-binstall to avoid building for sources.

@imobachgs imobachgs merged commit a831a16 into master Jun 30, 2023
@imobachgs imobachgs deleted the rust-coverage branch June 30, 2023 14:25
@imobachgs imobachgs mentioned this pull request Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants