-
Couldn't load subscription status.
- Fork 374
switch test_db tests to TraitsTest #1801
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
base: main
Are you sure you want to change the base?
Conversation
d25f382 to
6162fdc
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.
Pull Request Overview
This PR refactors the test_db tests to use a traits-based testing approach, enabling parameterized testing across different Monad and EVM revisions. The changes introduce template-based fixture classes and leverage the TraitsTest infrastructure to run tests against multiple blockchain revision configurations.
Key changes:
- Refactored
traits_test.hppto support customizable template parameters for revision type generation - Converted test fixtures to template-based
TrieDbFixtureTraitsthat work with both Monad and EVM revisions - Migrated specific tests (
call_frames_stress_test,assertion_exception,call_frames_refund) fromDBTesttoDBTraitsTestwith revision-specific logic
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
test/unit/common/include/monad/test/traits_test.hpp |
Made revision type generators accept template parameters to support custom type wrappers |
category/execution/ethereum/db/test/test_db.cpp |
Introduced traits-based test fixtures and converted three tests to support multiple revisions with revision-specific assertions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
342e740 to
33d6807
Compare
| template <typename TDB> | ||
| struct DBTest : public TDB | ||
| { | ||
| }; | ||
|
|
||
| using DBTypes = ::testing::Types<InMemoryTrieDbFixture, OnDiskTrieDbFixture>; | ||
| TYPED_TEST_SUITE(DBTest, DBTypes, RevisionTestNameGenerator); | ||
|
|
||
| template <typename TDB> | ||
| struct DBTraitsTest : public TDB | ||
| { | ||
| }; | ||
|
|
||
| TYPED_TEST_SUITE( | ||
| DBTraitsTest, MonadEvmRevisionDBTypes, RevisionTestNameGenerator); |
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.
Pulled these out to be reused in category/execution/ethereum/state2/test/test_state.cpp
33d6807 to
6a26907
Compare
4884476 to
ef3873e
Compare
ef3873e to
52fa26c
Compare
No description provided.