Skip to content
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

ci: update contracts tests to split by file #11797

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,16 @@ jobs:
- run:
name: run tests
command: |
TESTS=$(forge test --list | grep -E '^\s{4}' | awk '{print $1}' | circleci tests split --split-by=timings | paste -sd "|" -)
forge test --match-test "$TESTS"
# Find all test files
TEST_FILES=$(find ./test -name "*.t.sol")
# Split the tests by timings
TEST_FILES=$(echo "$TEST_FILES" | circleci tests split --split-by=timings)
# Strip the leading "./test/" from each file path
TEST_FILES=$(echo "$TEST_FILES" | sed 's|./test/||')
# Generate the match path
MATCH_PATH="./test/{$(echo "$TEST_FILES" | paste -sd "," -)}"
# Run the tests
forge test --match-path "$MATCH_PATH"
environment:
FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock
Expand Down