-
Notifications
You must be signed in to change notification settings - Fork 79
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
Implement OnExecHook VM API #3460
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3460 +/- ##
==========================================
- Coverage 86.13% 86.10% -0.04%
==========================================
Files 331 331
Lines 38470 38564 +94
==========================================
+ Hits 33138 33207 +69
- Misses 3804 3827 +23
- Partials 1528 1530 +2 ☔ View full report in Codecov by Sentry. |
@Furetur, any update on this? See also the related comments (#3462 (comment), #3462 (comment)). |
Also please, pay attention to the PR workflows. Linter job is failing and commit sign-off is required for every commit. |
Hello, @AnnaShaleva! Thanks for your comments, especially the ones about workflows. I am currently overloaded with work but I'll do my best to address your comments over the next few days. |
@AnnaShaleva could you please approve the workflow? |
afd3ac3
to
243ebc4
Compare
Fixed the 'lint' job (locally). @AnnaShaleva could you please rerun the workflows? Also, previously the 'coverage' job failed because some token was null. I believe that it was not because of my code |
It's just the problem with our Coverage job itself, it doesn't work with outer contributions. So you're right, it's not your fault. |
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.
Otherwise LGTM.
It's a feature! |
87f9317
to
a192f77
Compare
Seems like I've fixed all the comments, or are there any that I've missed? |
Also please note that unit-tests are failing:
|
@Furetur, could you please update the #3460 (comment) and fix failing tests? This PR is ready to go otherwise, and then we'll continue with #3462. |
Also, please, add "Close #3415" entry to the PR/commit message for proper GH linking. |
543e2db
to
122cd59
Compare
Done |
Sorry for the failing unit tests. I've probably "refactored" them a little bit before committing and forgot to rerun them |
Previously the CodeCov job failed because my commit decreased the overall coverage of the entire project. I don't think that my change could have caused those changes But I've added a test to |
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.
Otherwise LGTM.
Refs nspcc-dev#3415 This commit introduces a small new change that implements the Hooks API and more specifically the OnExecHook. This feature can be used to implement test coverage collection, tracing, breakpoints, and etc. To be more specific, this commit: 1. adds a new `hooks` field to the `VM` (this field contains the OnExecHook function) 2. sets the default value of this hook to be a NOP function 3. adds the `VM.SetOnExecHook` method Signed-off-by: Furetur <[email protected]>
Extracted the additional test into a separate PR |
Problem
This MR implements the proposed Hooks API from #3415 that can be used for coverage collection, tracing, breakpoints, and etc
Solution
This is a very small change. The main points are as follows:
hooks
is a structure meant to store all of the VM hooks:VM.SetOnExecHook
method is added to register hooks