test: add dual DB engine test coverage with RocksDB support#12
Open
vividctrlalt wants to merge 7 commits intodevelopfrom
Open
test: add dual DB engine test coverage with RocksDB support#12vividctrlalt wants to merge 7 commits intodevelopfrom
vividctrlalt wants to merge 7 commits intodevelopfrom
Conversation
- Refactor config validation to support dual-engine (LevelDB/RocksDB) test override - Add BaseMethodTest for per-method Spring context isolation - Unify DB tests with parameterized dual-engine coverage - Migrate 176+ BaseTest subclasses to support dual DB engine override - Fix flaky tests (TrieTest, ConditionallyStopTest, NeedBeanCondition null safety) - Add ARM64 RocksDB engine test support - Add RocksDB engine test step to PR check workflow - Centralize config file constants in TestEnv
…rride Replace withDbEngineOverride() CLI injection with Gradle systemProperty 'storage.db.engine' which ConfigFactory.load() merges automatically. Rename TestEnv back to TestConstants to minimize review diff.
Restore 212 test files to develop state. The DB engine override is now handled by Gradle systemProperty injection via Typesafe Config, so individual test files no longer need withDbEngineOverride() wrapping or TestConstants->TestEnv rename.
Test conflicts with Gradle system property injection on ARM64 CI. The -Dstorage.db.engine=ROCKSDB override makes LEVELDB rejection tests impossible to run on real ARM64 environments.
testConfigStorageDefaults expects LEVELDB but ARM64 CI injects -Dstorage.db.engine=ROCKSDB. Use system property as expected value.
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.
Summary
java-tron supports both LevelDB and RocksDB, but the test suite only ran with the default engine (LevelDB). This PR adds dual DB engine test coverage so the same business tests can run under both engines, and fixes several related issues.
What changed
testWithRocksDbtask sets-Dstorage.db.engine=ROCKSDB, whichConfigFactory.load()merges automatically — no code changes needed in individual testsStorage.getDbEngineFromConfig()to explicitArgs.validateConfig(), called inFullNode.main()DbDataSourceImplTestwith@RunWith(Parameterized.class)to run common DB operations against both LevelDB and RocksDB, eliminating ~400 lines of duplicate codeBaseMethodTest: New base class for tests requiring per-method Spring context isolationTrieTest,ConditionallyStopTest,NeedBeanConditionnull-safety,NativeMessageQueueshutdown hooktestWithRocksDbstep topr-check.ymlfor x86_64 buildsWhy
Test plan
./gradlew :framework:test— all existing tests pass./gradlew :framework:checkstyleTest— clean