svm: modularize integration test runner#3183
Merged
2501babe merged 2 commits intoanza-xyz:masterfrom Oct 18, 2024
Merged
Conversation
dfdd145 to
bba6cc5
Compare
bba6cc5 to
3770b43
Compare
3770b43 to
c8d7b5a
Compare
brooksprumo
approved these changes
Oct 18, 2024
brooksprumo
left a comment
There was a problem hiding this comment.
![]()
The refactor/modularization looks correct to me. Thanks!
ray-kast
pushed a commit
to abklabs/agave
that referenced
this pull request
Nov 27, 2024
* modularize test execution * rewrite svm inspect test with new runner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
the way the integration test runner is structured, the bank and batch processor are constructed, execute a test entry, run checks as defined by the entry, and then nothing is returned. this makes it difficult to do more bespoke things, like test inspected accounts or look into the final program cache, which we may not want to support in
SvmTestEntrySummary of Changes
introduce
SvmTestEnvironmentand splitexecute_test_entryintocreateandexecute. update mock bank state after a batch finishes executing. this allows more complex tests to test things on the test environment after execution, and even to run multiple batches with the same environmentnote that, despite the large diff, no code actually changed with the test runner (the first commit) other than the addition of this at the end of
execute:otherwise the functions
createandexecuteinSvmTestEnvironmentare line-for-line identical with the previousexecute_test_entrythe second commit rewrites the
svm_inspect_accounttest to use this new pattern and should be reviewed more closely, although no functionality has changed other than using the actual system program instead of the bpf transfer program, which added nothing to the test. the new pattern means thatsvm_inspect_accountnow validates transaction execution status and all final account states implicitly, in addition to the explicit inspected accounts checks