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

test(vm): Deduplicate multivm tests #3109

Merged
merged 19 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/lib/multivm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@ This crate represents a wrapper over several versions of VM that have been used
glue code that allows switching the VM version based on the externally provided marker while preserving the public
interface. This crate exists to enable the external node to process breaking upgrades and re-execute all the
transactions from the genesis block.

## Developer guidelines

### Adding tests

If you want to add unit tests for the VM wrapper, consider the following:

- Whenever possible, make tests reusable; declare test logic in the [`testonly`](src/versions/testonly/mod.rs) module,
and then instantiate tests using this logic for the supported VM versions. If necessary, extend the tested VM trait so
that test logic can be defined in a generic way. See the `testonly` module docs for more detailed guidelines.
- Do not use an RNG where it can be avoided (e.g., for test contract addresses).
- Avoid using zero / default values in cases they can be treated specially by the tested code.
17 changes: 0 additions & 17 deletions core/lib/multivm/src/versions/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions core/lib/multivm/src/versions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
mod shared;
#[cfg(test)]
mod testonly;
#[cfg(test)]
mod tests;
pub mod vm_1_3_2;
pub mod vm_1_4_1;
pub mod vm_1_4_2;
Expand Down
93 changes: 0 additions & 93 deletions core/lib/multivm/src/versions/testonly.rs

This file was deleted.

Loading
Loading