Commit 8404e91b authored by smartcontracts's avatar smartcontracts Committed by GitHub

ci: update contracts tests to split by file (#11797)

Contracts tests were being split by test name which meant that
Circle CI wouldn't be able to (eventually) be able to properly
split these files by timings. Updates the CI job to split by
file instead.
parent c05f5add
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment