Skip to content

Commit d219850

Browse files
marioevzCarsons-Eels
authored andcommitted
fix(ci): Clean during coverage script (ethereum#1610)
* fix(ci): Clean during coverage script * fix
1 parent 2bdef79 commit d219850

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

.github/workflows/coverage.yaml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -172,35 +172,32 @@ jobs:
172172
source $GITHUB_ENV
173173
files=$(echo "$CHANGED_TEST_FILES" | tr ',' '\n')
174174
175-
mkdir -p fixtures/state_tests
176-
mkdir -p fixtures/eof_tests
177-
mkdir -p fixtures/blockchain_tests
175+
# Include basic evm operations into coverage by default
176+
# As when we translate from yul/solidity some dup/push opcodes could become untouched
177+
files="$files tests/homestead/coverage/test_coverage.py"
178178
179-
echo "uv run fill $files --until=Cancun --evm-bin evmone-t8n >> filloutput.log 2>&1"
180-
uv run fill $files --until=Cancun --evm-bin evmone-t8n > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
179+
echo "uv run fill $files --clean --until=Cancun --evm-bin evmone-t8n >> filloutput.log 2>&1"
180+
uv run fill $files --clean --until=Cancun --evm-bin evmone-t8n > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
181181
182182
if grep -q "FAILURES" filloutput.log; then
183183
echo "Error: failed to generate .py tests."
184184
exit 1
185185
fi
186186
187+
mkdir -p fixtures/blockchain_tests
188+
mkdir -p fixtures/state_tests
187189
filesBlock=$(find fixtures/blockchain_tests -type f -name "*.json")
188190
filesState=$(find fixtures/state_tests -type f -name "*.json")
189-
filesEOF=$(find fixtures/eof_tests -type f -name "*.json")
190-
if [ -z "$filesState" ] && [ -z "$filesEOF" ] && [ -z "$filesBlock" ]; then
191+
if [ -z "$filesState" ] && [ -z "$filesBlock" ]; then
191192
echo "Error: No supported filled JSON files found in fixtures."
192193
exit 1
193194
fi
194195
195-
# Include basic evm operations into coverage by default
196-
# As when we translate from yul/solidity some dup/push opcodes could become untouched
197-
uv run fill tests/homestead/coverage/test_coverage.py --until=Cancun --evm-bin evmone-t8n
198196
199197
PATCH_TEST_PATH=${{ github.workspace }}/evmtest_coverage/coverage/PATCH_TESTS
200198
mkdir -p $PATCH_TEST_PATH
201199
find fixtures/blockchain_tests -type f -name "*.json" -exec bash -c 'cp "$0" "$1/blockchain_$(basename "$0")"' {} "$PATCH_TEST_PATH" \;
202200
find fixtures/state_tests -type f -name "*.json" -exec cp {} $PATCH_TEST_PATH \;
203-
find fixtures/eof_tests -type f -name "*.json" -exec cp {} $PATCH_TEST_PATH \;
204201
205202
- name: Parse and fill introduced test sources from before the PR
206203
if: ${{ steps.changed-tests.outputs.tests_any_changed == 'true' && env.converted_skip == 'true' }}
@@ -229,13 +226,10 @@ jobs:
229226
230227
rm -r fixtures
231228
rm filloutput.log
232-
mkdir -p fixtures/blockchain_tests
233-
mkdir -p fixtures/state_tests
234-
mkdir -p fixtures/eof_tests
235229
236230
if [ -n "$files_fixed" ]; then
237-
echo "uv run fill $files_fixed --until=Cancun --evm-bin evmone-t8n >> filloutput.log 2>&1"
238-
uv run fill $files_fixed --until=Cancun --evm-bin evmone-t8n > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
231+
echo "uv run fill $files_fixed --clean --until=Cancun --evm-bin evmone-t8n >> filloutput.log 2>&1"
232+
uv run fill $files_fixed --clean --until=Cancun --evm-bin evmone-t8n > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
239233
240234
if grep -q "FAILURES" filloutput.log; then
241235
echo "Error: failed to generate .py tests from before the PR."
@@ -250,16 +244,16 @@ jobs:
250244
echo "No tests affected from before the patch!"
251245
fi
252246
247+
mkdir -p fixtures/blockchain_tests
248+
mkdir -p fixtures/state_tests
253249
filesBlock=$(find fixtures/blockchain_tests -type f -name "*.json")
254250
filesState=$(find fixtures/state_tests -type f -name "*.json")
255-
filesEOF=$(find fixtures/eof_tests -type f -name "*.json")
256251
257252
BASE_TEST_PATH=${{ github.workspace }}/evmtest_coverage/coverage/BASE_TESTS
258253
mkdir -p $BASE_TEST_PATH
259254
260255
find fixtures/blockchain_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
261256
find fixtures/state_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
262-
find fixtures/eof_tests -type f -name "*.json" -exec cp {} $BASE_TEST_PATH \;
263257
for file in $BASE_TEST_PATH/*.json; do
264258
if [ -e "$file" ]; then
265259
mv "$file" "${file%.json}_$PREV_COMMIT.json"

0 commit comments

Comments
 (0)