Skip to content

refactor(test): cleanup of /libraries test structure and documentation #16103

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

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

aliersh
Copy link
Contributor

@aliersh aliersh commented May 23, 2025

This PR refactors a portion of the test suite within the /libraries folder as part of a broader effort to standardize structure, documentation, and formatting across the codebase.

Changes applied to each file:

  • Consolidated shared test initialization into dedicated *_TestInit contracts
  • Organized test functions into logically separated contracts inheriting from TestInit
  • Added @title and @notice tags to all test contracts
  • Added function-level @notice comments describing expected behavior under test
  • Replaced @dev tags with @notice where appropriate
  • Enforced a 100-character limit for inline comments

Progress

Refactored 10 of 15 test files (66.7% complete)

  • Blueprint.t.sol
  • Bytes.t.sol
  • Constants.t.sol
  • DeployUtils.t.sol
  • Encoding.t.sol
  • EOA.t.sol
  • GasPayingToken.t.sol
  • Hashing.t.sol
  • MerkleTrie.t.sol
  • RLPReader.t.sol
  • RLPWriter.t.sol
  • SafeCall.t.sol
  • StaticConfig.t.sol
  • Storage.t.sol
  • TransientContext.t.sol

More /libraries files will be added to this PR progressively until the full folder is covered.

aliersh added 4 commits May 23, 2025 11:22
- rename test contract to Constants_Constants_Test to follow naming convention
- add @title and @notice tags to test contract
- consolidate test initialization into a single StaticConfig_TestInit contract
- organize individual test functions into separate contracts inheriting from TestInit
- refactor test function names to follow naming convention
- add @title and @notice tags to all test contracts
- convert @dev tags to @notice where appropriate
- ensure comment lines stay within 100 character limit
- consolidate test initialization into a single DeployUtils_TestInit contract
- organize individual test functions into separate contract inheriting from TestInit
- add @title and @notice tags to test contract
- ensure comment lines stay within 100 character limit
- consolidate test initialization into a single GasPayingToken_TestInit contract
- organize individual test functions into separate contracts inheriting from TestInit
- group tests not directly tied to a base contract function into GasPayingToken_Unclassified_Test
- refactor test function names to follow naming convention
- add @title and @notice tags to all test contracts
- convert @dev tags to @notice where appropriate
- ensure comment lines stay within 100 character limit
Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.24%. Comparing base (8145253) to head (b758ab9).
Report is 6 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #16103       +/-   ##
============================================
+ Coverage    82.34%   96.24%   +13.89%     
============================================
  Files          161      106       -55     
  Lines         8812     4575     -4237     
============================================
- Hits          7256     4403     -2853     
+ Misses        1416      172     -1244     
+ Partials       140        0      -140     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 96.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 55 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

aliersh added 5 commits May 27, 2025 10:33
- add @title and @notice tags to all test contracts
- reorder test functions to match the order of definitions in the base contract
…tion

- consolidate test initialization into a single TransientContext_TestInit contract
- organize individual test functions into separate contracts inheriting from TestInit
- group tests not directly tied to a base contract function into TransientContext_Unclassified_Test
- add @title and @notice tags to all test contracts
- ensure comment lines stay within 100 character limit
- consolidate test initialization into a single SafeCall_TestInit contract
- organize individual test functions into separate contracts inheriting from TestInit
- refactor test function names to follow naming convention
- add @title and @notice tags to all test contracts
- convert @dev tags to @notice where appropriate
- ensure comment lines stay within 100 character limit
- consolidate test initialization into a single Blueprint_TestInit contract
- organize individual test functions into separate contracts inheriting from TestInit
- group tests not directly tied to a base contract function or are testing multiple functions into Blueprint_Unclassified_Test
- refactor test function names to follow naming convention
- reorder test functions to match the order of definitions in the base contract
- add @title and @notice tags to all test contracts
- ensure comment lines stay within 100 character limit
- add @title and @notice tags to all test contracts
- add function-level @notice comments describing expected behavior under test
- ensure comment lines stay within 100 character limit
@aliersh aliersh force-pushed the ari/libraries-tests-cleanup branch from 17eacb1 to 872f962 Compare May 27, 2025 16:45
- add @title and @notice tags to all test contracts
- add function-level @notice comments describing expected behavior under test
- ensure comment lines stay within 100 character limit
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.

1 participant