Skip to content

Commit

Permalink
rename test
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Aug 7, 2024
1 parent 60c5552 commit bdf43f8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,30 @@ jobs:

- name: Fetch github branches and detect introduces .py files
run: |
py_files=()
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
# Fetch changes when PR comes from remote repo
git fetch origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/head:refs/remotes/origin/PR-${{ github.event.pull_request.number }}
files=$(git diff --name-status origin/${{ github.base_ref }}...origin/PR-${{ github.event.pull_request.number }} -- tests/ | grep -E '^[AM]' | grep '\.py$')
gitdiff=$(git diff --name-status origin/${{ github.base_ref }}...origin/PR-${{ github.event.pull_request.number }} -- tests/)
else
# Fetch the base branch and the head branch
git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
git fetch origin ${{ github.head_ref }}:refs/remotes/origin/${{ github.head_ref }}
files=$(git diff --name-status origin/${{ github.base_ref }}...origin/${{ github.head_ref }} -- tests/ | grep -E '^[AM]' | grep '\.py$')
gitdiff=$(git diff --name-status origin/${{ github.base_ref }}...origin/${{ github.head_ref }} -- tests/)
fi
# Eliminate git diff chars, select only .py paths
echo "Collect the changed .py files"
py_files=()
while read -r line; do
file_fixed=$(echo "$line" | cut -c 3-)
py_files+=("$file_fixed")
done <<< "$files"
echo "git diff:"
echo "$gitdiff"
paths=$(echo "$gitdiff" | grep -oE '/[^[:space:]]+')
while IFS= read -r line; do
py_files+=("tests/$line")
done <<< "$paths"
echo "Extracted file paths:"
for path in "${py_files[@]}"; do
echo "$path"
done
echo "Prepare the NEW_TESTS variable"
py_files_str=$(IFS=,; echo "${py_files[*]}")
Expand Down
1 change: 1 addition & 0 deletions tests/cancun/eip1153_tstore/test_tstorage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""
touch
abstract: Tests [EIP-1153: Transient Storage Opcodes](https://eips.ethereum.org/EIPS/eip-1153)
Test [EIP-1153: Transient Storage Opcodes](https://eips.ethereum.org/EIPS/eip-1153). Ports
and extends some tests from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CallDestType(Enum):
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])
@pytest.mark.parametrize("call_dest_type", [CallDestType.REENTRANCY, CallDestType.EXTERNAL_CALL])
def test_tstore_reentrancy(
def test_tstore_reentrancy_rename(
state_test: StateTestFiller,
pre: Alloc,
call_type: Op,
Expand Down
6 changes: 6 additions & 0 deletions tests/homestead/coverage/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def test_coverage(
+ Op.PUSH1(0x0D)
+ Op.PUSH1(0x0E)
+ Op.SWAP1()
+ Op.DUP1()
+ Op.DUP2()
+ Op.PUSH0()
+ Op.PUSH2(0x0102)
+ Op.PUSH3(0x010203)
+ Op.PUSH4(0x01020304)
+ Op.POP(0x01)
# lllc tests insert codecopy when using lll(seq())
+ Op.CODECOPY(0, 16, 4),
Expand Down

0 comments on commit bdf43f8

Please sign in to comment.