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

feat: adding llvm source based coverage #1236

Merged
merged 18 commits into from
Aug 13, 2024

Conversation

jrmncos
Copy link
Contributor

@jrmncos jrmncos commented Aug 8, 2024

#1174
Adding coverage to all directories declared in members excepting /examples
The changes were tested locally and the file generated by llvm-cov (llvm-cov-output.lcov) can be parsed as html and it's displaying the coverage correctly. Also the step Generate code coverage is running successfully.

As a final step to fully test this change is to setup the variable ${{ secrets.CODECOV_TOKEN }} in the repo settings. More info here: https://docs.codecov.com/docs/quick-start#getting-started If someone can set that variable it would be great.
I did it in my forked repo, and I received an email with something like Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

BTW, I have been dedicating most part of my time and effort to test the directory /examples with the tool wasmcov #1233 . I was able to generate the .profdata files for each directory, and maybe the next step it's to merge it and to integrate it with the changes of this PR. I'm working with @bbarwik was helping me to integrate the tool and I'm waiting for the next release that fix some bugs.

I would like to close this one and to continue working on #1233 with an accurate plan to ingrate /examples directory

@race-of-sloths include

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@jrmncos jrmncos marked this pull request as ready for review August 8, 2024 03:44
@jrmncos
Copy link
Contributor Author

jrmncos commented Aug 8, 2024

@frol this is ready for review :)

Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

@jrmncos Could you, please, also provide a link for a CI test run on your fork? It would be great to see that it fully works before we merge it into the master (I'd like to avoid us debugging CI in production)

Comment on lines +20 to +24
- name: Install Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Install LLVM
run: brew install llvm
Copy link
Collaborator

Choose a reason for hiding this comment

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

It will take too much time on every CI run. Can we use Linux as a host? It will be much faster to install it there.

Copy link
Contributor Author

@jrmncos jrmncos Aug 12, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey @frol I tried with ubuntu, and the longer step, that is 'Generate code coverage' it takes 7m:48seg https://github.com/near/near-sdk-rs/actions/runs/10360531522/job/28679132518
and with mac os 5m 36s
https://github.com/near/near-sdk-rs/actions/runs/10360643219/job/28679480453?pr=1236\

Even with the installation of Brew the total time of macos is still less. Also, the longer step in the GitHub actions pipelines it's Test core and it takes > 8m (this is the total time of coverage)

I tried using - uses: Swatinem/rust-cache@v1
as cache but has not improved the total time

Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

<10 minutes for code-coverage is not that bad. Let's see it in action!

@race-of-sloths invite

@race-of-sloths
Copy link

race-of-sloths commented Aug 13, 2024

@jrmncos Thank you for your contribution! Your pull request is now a part of the Race of Sloths!
New Sloth joined the Race! Welcome!

Shows profile picture for the author of the PR

Current status: executed
Reviewer Score
@race-of-sloths 2

Your contribution is much appreciated with a final score of 2!
You have received 30 (20 base + 10 weekly bonus) Sloth points for this contribution

Another weekly streak completed, well done @jrmncos! To keep your weekly streak and get another bonus make pull request next week! Looking forward to see you in race-of-sloths

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@frol frol merged commit 66918f3 into near:master Aug 13, 2024
30 checks passed
@race-of-sloths
Copy link

🥁 Score it!

@frol, please score the PR with @race-of-sloths score [1/2/3/5/8/13]. The contributor deserves it.
If no scoring is provided within 24 hours, this PR will be scored as 2 🦥

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.

4 participants