Skip to content

refactor(config): merge test config files#6788

Open
317787106 wants to merge 6 commits into
tronprotocol:release_v4.8.2from
317787106:feature/simply_config
Open

refactor(config): merge test config files#6788
317787106 wants to merge 6 commits into
tronprotocol:release_v4.8.2from
317787106:feature/simply_config

Conversation

@317787106
Copy link
Copy Markdown
Collaborator

@317787106 317787106 commented May 20, 2026

What does this PR do?

Consolidates test configuration files by deleting four redundant config files (args-test.conf, config-test-index.conf, config-test-mainnet.conf, config-test-storagetest.conf) and standardizing tests to use a single shared config-test.conf. Also renames config-localtest.conf to config-shield.conf to better reflect its purpose (shielded-transfer tests), and removes the hardcoded seed node list from config-test.conf since unit tests have no need for P2P connectivity.

Specifically:

  • Delete 4 redundant test config files (~940 lines removed)
  • Rename config-localtest.confconfig-shield.conf
  • Remove NET_CONF, MAINNET_CONF, LOCAL_CONF, STORAGE_CONF, INDEX_CONF from TestConstants; add SHIELD_CONF
  • Update all affected test classes to reference TestConstants.TEST_CONF or TestConstants.SHIELD_CONF instead of bare string literals
  • Clear seed node IPs from config-test.conf; adjust ArgsTest seed-node assertion from 11 → 0

Why are these changes required?

The previous test suite maintained five separate .conf files that largely duplicated each other, making it hard to know which config to use for a new test and causing drift over time (e.g., config-test-mainnet.conf contained mainnet genesis/seed data that is irrelevant and potentially misleading in a unit-test context). Centralizing to one default test config (config-test.conf) and one purpose-specific config (config-shield.conf) reduces maintenance overhead and eliminates accidental coupling to live-network parameters in tests.

This PR has been tested by:

  • Unit Tests

Extra details

StorageTest gains additional coverage to compensate for the removal of config-test-storagetest.conf-dependent tests that were folded into the unified config.

@github-actions github-actions Bot requested a review from halibobo1205 May 20, 2026 05:34
Comment thread framework/src/test/java/org/tron/core/config/args/StorageTest.java Outdated
Comment thread framework/src/test/java/org/tron/core/config/args/ArgsTest.java Outdated
@barbatos2011
Copy link
Copy Markdown
Contributor

Follow-up observation, not blocking: although this PR deletes four redundant config files (-996 lines, well-deserved cleanup), the consolidated config-test.conf itself drops only 18 lines (387 → 369), and the renamed config-shield.conf drops 17. So the consolidation eliminates file drift risk but doesn't reduce per-test config-load surface — each of the ~21 affected tests still loads a 369-line conf, mostly boilerplate it doesn't read.

That's a real, but smaller, win. Worth being explicit in the PR description:

Note: this PR consolidates files but does not slim the unified config-test.conf (~369 lines) itself. Per-test inline overrides via ConfigFactory.parseString are a follow-up.

Otherwise reviewers (and future contributors) may expect the consolidation step alone to address the boilerplate problem, when in fact the boilerplate just got concentrated in one place.

Concrete follow-up path, if someone wants to pursue it later: tests with narrow needs (e.g. AssetUpdateHelperTest, StorageTest, ApiUtilTest) can move to inline ConfigFactory.parseString(...).withFallback(ConfigFactory.defaultReference()) and shed their dependency on TEST_CONF entirely. reference.conf already provides the safety net thanks to PR #6615.

Comment thread framework/src/test/resources/config-shield.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants