Skip to content

Commit

Permalink
files
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Jul 23, 2024
1 parent 32acce2 commit 1139968
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,19 @@ jobs:
files=$(git diff --name-status origin/${{ github.base_ref }}...origin/${{ github.head_ref }} -- tests/ | grep -E '^[AM]' | grep '\.py$')
fi
serialized_array=$(IFS=,; echo "${files[*]}")
echo "NEW_TESTS=$serialized_array" >> $GITHUB_ENV
# Eliminate git diff lines, select only .py paths
echo "Detected changed/new files:"
py_files=()
for file in "${files[@]}"; do
if [[ $file == *.py ]]; then
file_fixed=$(echo "$file" | cut -c 3-)
py_files+=("$file_fixed")
echo $file_fixed
fi
done
py_files_str=$(IFS=,; echo "${py_files[*]}")
echo "NEW_TESTS=$py_files_str" >> $GITHUB_ENV
- name: Log in to Docker Hub
uses: docker/login-action@v3
Expand Down Expand Up @@ -139,25 +150,20 @@ jobs:
# This command diffs the .py scripts introduced by a PR
- name: Parse and fill introduced test sources
run: |
source $GITHUB_ENV
IFS=',' read -r -a files <<< "$NEW_TESTS"
python3 -m venv ./venv/
source ./venv/bin/activate
serialized_array=${{ env.NEW_TESTS }}
IFS=',' read -r -a files <<< "$serialized_array"
echo "Modified or new .py files in tests folder:"
for file in "${files[@]}"; do
echo $file
done
# fill new tests
# using `|| true` here because if no tests found, pyspec fill returns error code
mkdir -p fixtures/state_tests
mkdir -p fixtures/eof_tests
# Use a while loop with a here-string to avoid subshell issues
while IFS= read -r line; do
file=$(echo "$line" | cut -c 3-)
echo "Fill: $file"
fill "$file" --until=Cancun --evm-bin evmone-t8n || true >> filloutput.log 2>&1
(fill "$file" --fork=CancunEIP7692 --evm-bin evmone-t8n -k eof_test || true) > >(tee -a filloutput.log filloutputEOF.log) 2>&1
done <<< "$files"
Expand Down Expand Up @@ -192,13 +198,9 @@ jobs:
echo "--------------------"
echo "converted-ethereum-tests.txt seem untouched, try to fill pre-patched version of .py files:"
serialized_array=${{ env.NEW_TESTS }}
IFS=',' read -r -a files <<< "$serialized_array"
echo "Modified or new .py files in tests folder:"
for file in "${files[@]}"; do
echo $file
done
# load introduces .py files
source $GITHUB_ENV
IFS=',' read -r -a files <<< "$NEW_TESTS"
git checkout main
PREV_COMMIT=$(git rev-parse HEAD)
Expand Down

0 comments on commit 1139968

Please sign in to comment.