-
Notifications
You must be signed in to change notification settings - Fork 83
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
Use an abstract VM trait for integration tests #1265
Conversation
b6fe311
to
aec4406
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## alex/1236-abstract-vm-trait-easy-tests #1265 +/- ##
========================================================================
Coverage 90.64% 90.64%
========================================================================
Files 133 133
Lines 27019 26908 -111
========================================================================
- Hits 24492 24392 -100
+ Misses 2527 2516 -11
|
af4231d
to
1653d6a
Compare
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.
@anorth this is a WIP but the entire util functionality has been refactored to work with the abstract VM.
I'm partway through refactoring the tests themselves to rely solely on the abstracted trait rather than methods on TestVM
but am running into considerable friction around ExpectInvocation logic which seems to be quite central to some of the tests.
1653d6a
to
b65e7f5
Compare
0732bfe
to
11d9ae0
Compare
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 reviewed about half of this, enough to generate a few requested changes.
It would be ok not to convert all the tests at once. E.g. where there are some new trait methods required for state hacking, we can just mark those tests for follow-up (and file an issue to finish them off), and get them in a new PR. In fact I'd perhaps prefer that this PR only addressed a few of the smaller tests while we settle on the patterns, making it easier to review, land, and then build upon.
I reckon that things like v.assert_state_invariants
should be able to be extracted as helper functions, rather than methods. Then we can call them regardless of the VM in use. I think we should start off assuming that we do want those kind of checks to run all the time, though I could be convinced they're not wanted when using the real VM for some reason.
81a72c2
to
851f492
Compare
851f492
to
bf1e378
Compare
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.
Thanks. We need to think about how to make this structure more ergonomic. Since the #[test]
methods are mostly uniform boilerplate, perhaps we'll be able to make a macro #[vmtest]
or similar that automates that little wrapper function. But we also need to think about moving the test bodies out to be importable elsewhere.
Outstanding items are tracked in #1294 |
WIP: Expect invocations not working anymore. Will need a way to abstract over expectations#1236
Tracking branch of end-state. This will be broken up and reviewed in chunks:
#1285
#1288
#1289