Skip to content

refactor: move test constant out of production code and rename NET_CONF#6555

Merged
kuny0707 merged 12 commits intotronprotocol:developfrom
vividctrlalt:develop
Feb 27, 2026
Merged

refactor: move test constant out of production code and rename NET_CONF#6555
kuny0707 merged 12 commits intotronprotocol:developfrom
vividctrlalt:develop

Conversation

@vividctrlalt
Copy link
Contributor

Summary

  • Move test-only constant TEST_CONF from production Constant.java to new TestConstants.java in the test module (framework/src/test)
  • Rename TESTNET_CONF to NET_CONF for clarity, since config.conf serves all network types (testnet, mainnet, beta)
  • Fix checkstyle: correct import order and line length violations

Changes

  • common/src/main/java/org/tron/core/Constant.java: Remove TEST_CONF, rename TESTNET_CONFNET_CONF
  • framework/src/test/java/org/tron/common/TestConstants.java: New test constants class with TEST_CONF
  • 213 test files: Update Constant.TEST_CONFTestConstants.TEST_CONF, fix import order and line length
  • 4 production files (FullNode, SolidityNode, KeystoreFactory, DynamicArgs): Update Constant.TESTNET_CONFConstant.NET_CONF

Test plan

  • Full framework test suite: BUILD SUCCESSFUL, all tests passed
  • Checkstyle: 0 warnings (import order + line length all fixed)
  • Compilation verified with zero errors

zhao and others added 8 commits February 26, 2026 01:44
- ApiUtilTest: replace Base58 address decoding with raw hex bytes to
  remove dependency on CommonParameter singleton initialization
- BaseNet: add null guards in destroy() to prevent NPE when P2P
  service fails to start due to port conflicts
The root cause of the flaky test is DecodeUtil.addressPreFixByte
being polluted by other tests using testnet config, not the test
itself. The proper fix should be in Args.clearParam() to reset
the address prefix byte.
…T_CONF

Move test-only constant TEST_CONF from production Constant.java to
a new TestConstants class in framework/src/test. Rename TESTNET_CONF
to NET_CONF for clarity since config.conf serves all network types.
Resolve merge conflicts by accepting remote changes and re-applying
our constant renames (TEST_CONF → TestConstants.TEST_CONF,
TESTNET_CONF → NET_CONF). Accept remote deletion of BaseNet.java.
Fix 6 new remote files that referenced old constant names.
Sort TestConstants import alphabetically among other imports.
Wrap lines exceeding 100 chars caused by longer constant name.
- Fix mixed full-width/half-width brackets in description and prerequisites
- Add separator in hardware table for storage options
- Fix incorrect Shasta link text (shastaex.io -> shasta.tronex.io)
- Unify Resources section with consistent description format
- Replace Gitter badge with Discord badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add GitHub Actions workflow that runs on PRs to develop and release
branches with four jobs: PR title/description lint, compilation check,
checkstyle validation for framework and plugins modules, and unit
tests with artifact upload on failure.
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add JDK17 for aarch64 Test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will add JDK 17/aarch64 to the test matrix as well.

steps:
- uses: actions/checkout@v4

- name: Set up JDK 8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add JDK17 for aarch64 Build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Build job now uses a matrix strategy with both JDK 8/x86_64 and JDK 17/aarch64. See the latest commit.

vividcoder and others added 4 commits February 27, 2026 11:22
Add GitHub Actions workflow that runs on PRs to develop and release
branches with four jobs: PR title/description lint, multi-platform
build (JDK 8/x86_64 + JDK 17/aarch64), checkstyle validation for
framework and plugins modules, and unit tests with artifact upload
on failure.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kuny0707 kuny0707 merged commit 3aa591f into tronprotocol:develop Feb 27, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants