Skip to content

Commit

Permalink
check patched tests coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Jul 11, 2024
1 parent f5797b5 commit edc0e09
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Evmone Coverage Report
on:
pull_request:
paths:
- 'converted-ethereum-tests.txt' # This triggers the workflow only for changes in file.txt
- 'tests/**' # This triggers the workflow for any changes in the tests folder

jobs:
evmone-coverage-diff:
Expand Down Expand Up @@ -74,14 +74,16 @@ jobs:
- name: Parse converted tests from converted-ethereum-tests.txt
run: |
echo "New lines introduced in converted-ethereum-tests.txt:"
lines=$(git diff origin/${{ github.base_ref }} HEAD -- converted-ethereum-tests.txt | grep "^+" | grep -v "^+++")
files=$(echo "$lines" | grep -oP '(?<=\+).+\.json')
if [ -z "$files" ]; then
echo "Error: No new JSON files found in converted-ethereum-tests.txt"
exit 1
lines=$(git diff origin/${{ github.base_ref }} HEAD -- converted-ethereum-tests.txt | grep "^+" | grep -v "^+++" || true)
if [ -z "$lines" ]; then
echo "No new lines in converted-ethereum-tests.txt, check updates instead:"
echo "converted_skip=true" >> $GITHUB_ENV
exit 0
else
echo "converted_skip=false" >> $GITHUB_ENV
fi
files=$(echo "$lines" | grep -oP '(?<=\+).+\.json')
for file in $files; do
echo $file
done
Expand Down Expand Up @@ -118,7 +120,7 @@ jobs:
exit 1
fi
done
# This command diffs the .py scripts introduced by a PR
- name: Parse and fill introduced test sources
Expand Down Expand Up @@ -182,6 +184,10 @@ jobs:
find fixtures/state_tests -type f -name "*.json" -exec cp {} $PATCH_TEST_PATH \;
find fixtures/eof_tests -type f -name "*.json" -exec cp {} $PATCH_TEST_PATH \;
if [ "${{ env.converted_skip }}" == 'true' ]; then
echo "Try to detect the same files in revision before PR"
fi
- name: Print tests that will be covered
if: ${{ env.retesteth_skip == 'false' || matrix.driver == 'native' }}
run: |
Expand Down
2 changes: 0 additions & 2 deletions tests/homestead/coverage/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def test_coverage(
+ Op.PUSH1(0x0D)
+ Op.PUSH1(0x0E)
+ Op.SWAP1()
+ Op.DUP1()
+ Op.DUP2()
+ Op.PUSH0()
+ Op.PUSH2(0x0102)
+ Op.PUSH3(0x010203)
Expand Down

0 comments on commit edc0e09

Please sign in to comment.