Skip to content

Conversation

aliersh
Copy link
Contributor

@aliersh aliersh commented Oct 1, 2025

Description

The test validator was failing for library tests because libraries with internal-only functions have empty ABIs (methodIdentifiers: {}). The validator checks function existence by looking at artifact.Abi.Parsed.Methods, which doesn't work for libraries.

Changes

  • Added isLibrary() to detect library artifacts via AST ContractKind
  • Added extractFunctionsFromAST() to extract function names from AST nodes
  • Modified checkFunctionExists() to use AST for libraries, ABI for contracts
  • Added test coverage for the new library validation functions
  • Updated exclusions.toml with library-specific exclusions
  • Added success message when all validations pass

Fixes #16662

@aliersh aliersh requested a review from a team as a code owner October 1, 2025 21:04
@aliersh aliersh requested a review from smartcontracts October 1, 2025 21:04
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.72%. Comparing base (2e0d9ab) to head (ab6313b).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #17690      +/-   ##
===========================================
+ Coverage    74.31%   80.72%   +6.41%     
===========================================
  Files          172      117      -55     
  Lines        10955     6170    -4785     
===========================================
- Hits          8141     4981    -3160     
+ Misses        2670     1189    -1481     
+ Partials       144        0     -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 80.72% <ø> (ø)

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.

@mds1 mds1 enabled auto-merge October 2, 2025 17:28
@aliersh aliersh removed the request for review from smartcontracts October 2, 2025 18:18
- extract functions from AST for libraries (internal functions not in ABI)
- add test coverage for library validation helpers
- update exclusions for library-specific test patterns
- add success message when all validations pass
@aliersh aliersh force-pushed the ari/tests-validator-libraries branch from 76d3b1d to b640254 Compare October 2, 2025 18:25
@mds1 mds1 added this pull request to the merge queue Oct 2, 2025
Merged via the queue into develop with commit e290642 Oct 2, 2025
69 checks passed
@mds1 mds1 deleted the ari/tests-validator-libraries branch October 2, 2025 20:46
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.

Extend lint-forge-tests-check-no-build to handle library artifacts
3 participants