Refactor and reorganize integration tests in hedera-mirror-web3
module
#8057
Labels
enhancement
Type: New feature
limechain
Work planned for the LimeChain team
technical debt
web3
Area: Web3 API
work package
Limechain Work package
Problem
Currently all integrations tests in
hedera-mirorr-web3
rely on a DB test setup, which is processed inContractCallTestSetup
, which creates a strong dependency between all test data. As a result if we change the ID of a single entity, for example, we might break an existing set of tests or see unexpected results. In addition maintenance and adding new tests with new test data would become harder and harder in the future.Solution
Remove
ContractCallTestSetup
as a central database setup and refactor all integration tests to include their own test data and be self-sufficient without relying on an external setup. Each test should create their own entities and needed data, that would be discarded after the test execution.Some extraction of ContractCallTestSetup logic into the separate integration tests, might be an option, but probably the best approach would be adding new DB test data for each separate test from scratch and reuse as much shared common methods for a data setup, within a given integration test suite, as possible, without the need of specific entities for each test (e.g. tokens, accounts, contracts). Avoid extracting common entities and methods in a parent class, as eventually we would construct the same problem of a common big and complex class with DB setup.
Alternatives
No response
The text was updated successfully, but these errors were encountered: