Skip to content

Commit

Permalink
both retesteth and native coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Jun 13, 2024
1 parent 3b67f3b commit 551536f
Showing 1 changed file with 59 additions and 22 deletions.
81 changes: 59 additions & 22 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ jobs:
echo $file
done
BASE_TESTS_PATH=${{ github.workspace }}/evmtest_coverage/coverage/BASE_TESTS
mkdir -p $BASE_TESTS_PATH
BASE_TESTS_PATH_RETESTETH=${{ github.workspace }}/evmtest_coverage/coverage_retesteth/BASE_TESTS
BASE_TESTS_PATH_NATIVE=${{ github.workspace }}/evmtest_coverage/coverage_native/BASE_TESTS
mkdir -p $BASE_TESTS_PATH_RETESTETH
mkdir -p $BASE_TESTS_PATH_NATIVE
for file in $files; do
cp ${{ github.workspace }}/testpath/$file $BASE_TESTS_PATH
cp ${{ github.workspace }}/testpath/$file $BASE_TESTS_PATH_RETESTETH
cp ${{ github.workspace }}/testpath/$file $BASE_TESTS_PATH_NATIVE
if [[ "$file" == *"GeneralStateTests"* ]]; then
base_name=$(basename "$file")
legacy_file_name="legacy_$base_name"
cp ${{ github.workspace }}/legacytestpath/Cancun/$file $BASE_TESTS_PATH/$legacy_file_name
cp ${{ github.workspace }}/legacytestpath/Cancun/$file $BASE_TESTS_PATH_RETESTETH/$legacy_file_name
cp ${{ github.workspace }}/legacytestpath/Cancun/$file $BASE_TESTS_PATH_NATIVE/$legacy_file_name
fi
done
Expand Down Expand Up @@ -122,53 +126,86 @@ jobs:
exit 1
fi
mkdir -p ${{ github.workspace }}/evmtest_coverage/coverage/PATCH_TESTS
find fixtures/state_tests -type f -name "*.json" -exec cp {} ${{ github.workspace }}/evmtest_coverage/coverage/PATCH_TESTS \;
find fixtures/eof_tests -type f -name "*.json" -exec cp {} ${{ github.workspace }}/evmtest_coverage/coverage/PATCH_TESTS \;
PATCH_TESTS_PATH_RETESTETH=${{ github.workspace }}/evmtest_coverage/coverage_retesteth/PATCH_TESTS
PATCH_TESTS_PATH_NATIVE=${{ github.workspace }}/evmtest_coverage/coverage_native/PATCH_TESTS
mkdir -p $PATCH_TESTS_PATH_RETESTETH
mkdir -p $PATCH_TESTS_PATH_NATIVE
find fixtures/state_tests -type f -name "*.json" -exec cp {} $PATCH_TESTS_PATH_RETESTETH \;
find fixtures/eof_tests -type f -name "*.json" -exec cp {} $PATCH_TESTS_PATH_NATIVE \;
- name: Print tests that will be covered
run: |
echo "Original BASE tests:"
ls ${{ github.workspace }}/evmtest_coverage/coverage/BASE_TESTS
ls ${{ github.workspace }}/evmtest_coverage/coverage_retesteth/BASE_TESTS
echo "--------------------"
echo "Ported PATCH tests:"
ls ${{ github.workspace }}/evmtest_coverage/coverage/PATCH_TESTS
ls ${{ github.workspace }}/evmtest_coverage/coverage_retesteth/PATCH_TESTS
- name: Run coverage of the BASE tests
- name: Run coverage of the BASE tests (retesteth)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage:/tests
run: /entrypoint.sh --mode=cover --driver=native --testpath=/tests/BASE_TESTS --outputname=BASE
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_retesteth:/tests
run: /entrypoint.sh --mode=cover --testpath=/tests/BASE_TESTS --outputname=BASE

- name: Run coverage of the PATCH tests
- name: Run coverage of the PATCH tests (retesteth)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage:/tests
run: /entrypoint.sh --mode=cover --driver=native --testpath=/tests/PATCH_TESTS --outputname=PATCH
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_retesteth:/tests
run: /entrypoint.sh --mode=cover --testpath=/tests/PATCH_TESTS --outputname=PATCH

- name: Run coverage DIFF of the PATCH tests compared to BASE tests
- name: Run coverage DIFF of the PATCH tests compared to BASE tests (retesteth)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage:/tests
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_retesteth:/tests
run: /entrypoint.sh --mode=diff --basefile=coverage_BASE.lcov --patchfile=coverage_PATCH.lcov

- name: Run coverage of the BASE tests (native)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_native:/tests
run: /entrypoint.sh --mode=cover --testpath=/tests/BASE_TESTS --outputname=BASE

- name: Run coverage of the PATCH tests (native)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_native:/tests
run: /entrypoint.sh --mode=cover --testpath=/tests/PATCH_TESTS --outputname=PATCH

- name: Run coverage DIFF of the PATCH tests compared to BASE tests (native)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_native:/tests
run: /entrypoint.sh --mode=diff --basefile=coverage_BASE.lcov --patchfile=coverage_PATCH.lcov

- name: Chmod coverage results
run: |
user=$(whoami)
sudo chown -R $user:$user ${{ github.workspace }}/evmtest_coverage/coverage
sudo chown -R $user:$user ${{ github.workspace }}/evmtest_coverage/coverage_retesteth
sudo chown -R $user:$user ${{ github.workspace }}/evmtest_coverage/coverage_native
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: coverage-diff
path: ${{ github.workspace }}/evmtest_coverage/coverage
name: coverage-results
path: ${{ github.workspace }}/evmtest_coverage

- name: Verify coverage results
- name: Verify coverage results (retesteth)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_retesteth:/tests
run: /check.sh
continue-on-error: true
- name: Verify coverage results (native)
uses: addnab/docker-run-action@v3
with:
image: winsvega/evmone-coverage-script:latest
options: -v ${{ github.workspace }}/evmtest_coverage/coverage:/tests
options: -v ${{ github.workspace }}/evmtest_coverage/coverage_native:/tests
run: /check.sh
continue-on-error: true

0 comments on commit 551536f

Please sign in to comment.