Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grcov and codecov reports. #1174

Open
ruseinov opened this issue Apr 26, 2024 · 13 comments
Open

Add grcov and codecov reports. #1174

ruseinov opened this issue Apr 26, 2024 · 13 comments
Assignees

Comments

@ruseinov
Copy link
Collaborator

ruseinov commented Apr 26, 2024

Add GitHub CI automation to see the code coverage diffs on pull requests. Once it is setup, we can track it and ensure we improve code coverage

@Gerson2102
Copy link

Gerson2102 commented Jul 29, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a junior software developer from the Dojo Coding community with contributions to several OnlyDust projects. Including Madara, Cairo native, kakarot-rpc, and Giza. All the projects where I contributed are in Rust, so I have been dealing with this language for a while. You can check my OD profile here: https://app.onlydust.com/u/Gerson2102

How I plan on tackling this issue

I will start by doing a research on how to set up these kind of things in a repo. Watching videos about how to set up this in a github repo. And asking for some resources through the telegram groups if im too stuck solving this.

@josephpdf
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am new to the field of OSS, I am a student in the IT career, doing my final graduation project.
Honestly I have no experience, but I am willing to put in the effort to get the issue out.

How I plan on tackling this issue

I would have to start researching how to get started with these types of contributions and I should also research how to configure things like this in a repository.
I'll look for videos, documentation or anything I need to get this set up.
I will seek communications with maintainers or experts on the subject.

@Mystic-Nayy
Copy link

Can I work on this?

Copy link

onlydustapp bot commented Jul 29, 2024

Hi @Gift-Naomi!
Maintainers during the ODHack #6.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

@jrmncos
Copy link
Contributor

jrmncos commented Jul 30, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a Software Engineer backend with more than 5years of experience (but In web2 ) I'm newie here :) but I can do this one!

How I plan on tackling this issue

I'll suggest to add source based coverage like cargo-llvm-cov, because is more accurate inorder to obtain the coverage. I can implement the feature with grcov too. I already did both cases with rust before

@frol
Copy link
Collaborator

frol commented Jul 30, 2024

I selected @jrmncos as he has the most relevant experience.

@jrmncos Another team has recently developed wasmcov support for NEAR Wasm contracts. It might be useful or could be partially useful to test the parts of SDK that are only executed from contracts (e.g. example folder is used in CI testing as well, so we can collect code coverage metadata from there as well)

@jrmncos
Copy link
Contributor

jrmncos commented Jul 30, 2024

hey @frol thanks. I will take a look to wasmcov too

@frol
Copy link
Collaborator

frol commented Aug 2, 2024

@jrmncos Hey, how is your progress so far? If it is not going well, let's unassign the issue, so someone else can give it a try

@jrmncos
Copy link
Contributor

jrmncos commented Aug 2, 2024

hey @frol I will share a draft by today

@jrmncos
Copy link
Contributor

jrmncos commented Aug 2, 2024

hey @frol I dedicated a lot of time to integrate wasmcov to the repo, but I had a lot of issues but now I'm in a rabbit hole that doesn't depend on us.

Wasmcov requires rustc nightly, the repo said something like 'The tool uses the nightly Rust toolchain for building and running'

I'm using rustc nighly with following config:

`jrmncos@ger ~ % rustc --version --verbose
rustc 1.82.0-nightly (8e86c9567 2024-08-01)
binary: rustc
commit-hash: 8e86c9567154dc5a9ada15ab196d23eae2bd7d89
commit-date: 2024-08-01
host: aarch64-apple-darwin
release: 1.82.0-nightly
LLVM version: 19.1.0`

and my llvm tools has the versions

`jrmncos@ger~ % clang --version
Homebrew clang version 18.1.8
Target: arm64-apple-darwin23.1.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin`
jrmncos@ger ~ % llvm-config --version
18.1.8

Internally the code of wasmcov tries to find llvm tools that matches with LLVM version in rustc, in this case 19. The error is:

`Failed to initialize LLVM tooling: Found clang version 18, but expected 19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
`

But, there isn't any public release of that tool. You can verify it here: https://releases.llvm.org/ 19 will be the next release

Also I already tried it modifying the rustc version.

I was talking by Telegram with the main mantainer of Wasmcov and he will help me next Monday.

By the other hand, I already try with the tool https://github.com/taiki-e/cargo-llvm-cov and I was able to get a report. I can continue with the work with that tool if you agree while we try to get more help with the owner of wasmcov.

@frol
Copy link
Collaborator

frol commented Aug 3, 2024

@jrmncos Consider using a bit older nightly version of the compiler (maybe even 6 months old one). Indeed, codecoverage tooling in Rust requires nightly features, but that is ok, we just need to pin specific version that works

@jrmncos
Copy link
Contributor

jrmncos commented Aug 3, 2024

thanks @jrmncos I'll try with that

@jrmncos
Copy link
Contributor

jrmncos commented Aug 7, 2024

I still working on this one. I'm waiting the next release of wasmcov that solves the error related with versions of rustc. In the meanwhile I was working with a local version of wasmcov with the fix and I was able to generate the .profdata files for each directory of /examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: NEW❗
Development

No branches or pull requests

6 participants