From 1139968c2a72ed53c2fde77d4eb7821370cbfaa9 Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Tue, 23 Jul 2024 12:41:49 +0200 Subject: [PATCH] files --- .github/workflows/coverage.yaml | 38 +++++++++++++++++---------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 04d0f05ce2..9987c8f672 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -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 @@ -139,17 +150,12 @@ 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 @@ -157,7 +163,7 @@ jobs: # 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" @@ -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)