Skip to content

fix(tests): align test contracts with new validation script rules #16561

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

Merged
merged 2 commits into from
Jun 26, 2025

Conversation

aliersh
Copy link
Contributor

@aliersh aliersh commented Jun 24, 2025

This PR updates several test files to pass the new validation rules introduced in the test-validation script.

Summary of Changes

  • Contract Renaming:

    • Updated contract names to match expected validation patterns (e.g., <Contract>_<Function>_Test)
    • Renamed contracts such as SystemConfig_Test to SystemConfig_SuperchainConfig_Test and fixed pluralization issues like SupportsInterfacesSupportsInterface
  • Function Name Alignment:

    • Renamed functions within test contracts to match their respective contract names (e.g., test_supportsInterfaces_succeedstest_supportsInterface_succeeds)
  • Consolidation of Test Logic:

    • Merged separate contracts into main test contracts where appropriate (e.g., consolidated L2 withdrawal tests into SequencerFeeVault_Withdraw_Test)
    • Introduced internal helper functions to reduce duplication
  • Validation Script Updates:

    • Removed exclusions for test files that now follow validation rules
    • Updated comments for excluded files to reflect current validation status

@aliersh aliersh requested a review from a team as a code owner June 24, 2025 16:13
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.24%. Comparing base (59ffcfd) to head (7679be0).
Report is 19 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #16561       +/-   ##
============================================
+ Coverage    81.76%   96.24%   +14.48%     
============================================
  Files          161      106       -55     
  Lines         9277     4584     -4693     
============================================
- Hits          7585     4412     -3173     
+ Misses        1535      172     -1363     
+ Partials       157        0      -157     
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.

- Renamed test contracts to match expected naming patterns (e.g., <Contract>_<Function>_Test)
- Updated function names to align with contract names and validation expectations
- Merged standalone test contracts into primary test contracts to reduce fragmentation
- Refined test setup logic by introducing shared helper functions
- Removed test files from exclusion list in validation script now that they conform
- Adjusted comments in the validation script to reflect current file status
@aliersh aliersh force-pushed the ari/tests-cleanup branch from 1232578 to 6ff1fd4 Compare June 24, 2025 18:04
- Rename SystemConfig_Uncategorized_Test to SystemConfig_SuperchainConfig_Test to follow proper naming conventions
@JosepBove
Copy link
Member

LGTM; It would be nice to have a document somewhere explaining the changes and sharing it between the teams that work on contracts. (Probably in #smart-contracts in Discord)

@aliersh aliersh enabled auto-merge June 26, 2025 13:53
@aliersh aliersh added this pull request to the merge queue Jun 26, 2025
Merged via the queue into develop with commit c3ac9d0 Jun 26, 2025
63 checks passed
@aliersh aliersh deleted the ari/tests-cleanup branch June 26, 2025 14:31
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