-
Notifications
You must be signed in to change notification settings - Fork 322
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
Integrate test coverage with nile-coverage #494
Integrate test coverage with nile-coverage #494
Conversation
I made the PR ready for review, just adding the tox coverage environment because only an organization admin can add the integration with codecov.io (badge included). As it is, this PR allows run coverage using This can be tested locally already after cairo-lang 0.10.1 release. NOTE: merging this PR will close #455, even when we don't have the integration with CI and the Badge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good! let's wait for @frangio for the setup. will try it out.
@@ -29,6 +29,18 @@ extras = | |||
commands = | |||
pytest {posargs} | |||
|
|||
[testenv:coverage] | |||
description = Invoke nile-coverage to generate coverage report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a rule to require PRs to maintain the coverage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed this would be part of the CI action that I have no permission to add (integrating with codecov). I left that part to @frangio (because the solidity contracts repo is also integrated with codecov and this check), but I can work on it if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this should be handled by Codecov.
@@ -29,6 +29,18 @@ extras = | |||
commands = | |||
pytest {posargs} | |||
|
|||
[testenv:coverage] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make sense to run the tests a second time? should we simply run coverage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think running coverage is enough because the VM used for this is almost the same one that comes default with cairo (the difference, for now, is just storing the touched program counters), so tests are run for coverage in the same environment in practice.
I forgot to add that this plugin requires python 3.9 (it doesn't work with 3.8 because of these str functions). I will remove these functions and add support for 3.8 tomorrow because it still makes sense in my opinion. |
This should be fixed in version 0.2.1 (set in last commit). |
…eat/integrate-coverage-#455
I've installed the Codecov GitHub App in this repository. I think you still need to set up Step 4 in this guide. (Note that the CODECOV_TOKEN is not necessary because we are using GitHub Actions, this is mentioned in Step 2.) |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #494 +/- ##
=======================================
Coverage ? 96.82%
=======================================
Files ? 28
Lines ? 1419
Branches ? 0
=======================================
Hits ? 1374
Misses ? 45
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
If you prefer, you can disable the Codecov comment in the config file. See our configuration and the docs. |
That config is part of the PR already ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few questions!
Co-authored-by: Martín Triay <martriay@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there :)
…/cairo-contracts into feat/integrate-coverage-#455
Co-authored-by: Martín Triay <martriay@gmail.com>
Fixes #455
PR Checklist