Skip to content

refactor(test): cleanup of /dispute test structure and documentation #16088

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 3 commits into
base: develop
Choose a base branch
from

Conversation

aliersh
Copy link
Contributor

@aliersh aliersh commented May 22, 2025

This PR refactors a portion of the test suite within the /dispute 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 3 of 10 test files (30.0% complete)

  • AnchorStateRegistry.t.sol
  • DelayedWETH.t.sol
  • DisputeGameFactory.t.sol
  • FaultDisputeGame.t.sol
  • LibClock.t.sol
  • LibGameId.t.sol
  • LibPosition.t.sol
  • PermissionedDisputeGame.t.sol
  • SuperFaultDisputeGame.t.sol
  • SuperPermissionedDisputeGame.t.sol

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

- consolidate test initialization into a single DelayedWETH_TestInit contract
- organize individual test functions into separate contracts inheriting from TestInit
- 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 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.24%. Comparing base (69db4d9) to head (a8b748b).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #16088       +/-   ##
============================================
+ Coverage    47.02%   96.24%   +49.21%     
============================================
  Files         1360      106     -1254     
  Lines       109457     4575   -104882     
============================================
- Hits         51472     4403    -47069     
+ Misses       54337      172    -54165     
+ Partials      3648        0     -3648     
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 1254 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 2 commits May 22, 2025 17:33
- consolidate test initialization into a single LibPosition_TestInit contract
- organize individual test functions into separate contracts inheriting from TestInit
- group tests not directly tied to a base contract function into LibPosition_Unclassified_Test
- refactor test function names to follow naming convention
- add @title and @notice tags to all test contracts
- ensure comment lines stay within 100 character limit
…ntation

- rename AnchorStateRegistry_Init contract AnchorStateRegistry_TestInit
- reorder test contract based in the order of the base file
- add @title and @notice tags to all test contracts
- 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