Skip to content

filter Foundry test contracts in the baseline runner - #19

Open
mkzung wants to merge 1 commit into
scabench-org:mainfrom
mkzung:fix/filter-test-contracts
Open

filter Foundry test contracts in the baseline runner#19
mkzung wants to merge 1 commit into
scabench-org:mainfrom
mkzung:fix/filter-test-contracts

Conversation

@mkzung

@mkzung mkzung commented Jul 9, 2026

Copy link
Copy Markdown

Fixes #12.

The baseline runner drops files with test in the name, but that misses Foundry test contracts like Counter.t.sol (no test substring) and contracts under a test/ directory, so they get analyzed as sources and inflate the file count / findings.

I pulled the filter into a small is_test_file() helper that also catches *.t.sol and test//tests/ directories. It matches on the repo-relative path (so a data root whose own path contains test cannot filter every file), and it only ever excludes more files - nothing the old check already dropped gets re-included, so baselines can't silently grow.

$ python -m pytest tests/test_baseline_filter.py -q
12 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.

Testing contracts are not always correctly filtered in the baseline runner

1 participant