Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(levm): daily report levm tests & diff #1668

Merged
merged 49 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a886f56
draft: first attempt
fkrause98 Jan 6, 2025
60be01c
draft: fix yml
fkrause98 Jan 6, 2025
ed2e329
draft: use debug channels only
fkrause98 Jan 6, 2025
84dc25c
draft: fix yml
fkrause98 Jan 6, 2025
0fcc71d
draft: fix yml
fkrause98 Jan 6, 2025
55fae00
draft: fix yml
fkrause98 Jan 6, 2025
c33b7d9
draft: swap order yml
fkrause98 Jan 6, 2025
b0b6bd2
draft: avoid using docker registry
fkrause98 Jan 6, 2025
40af017
draft: fix docker build command
fkrause98 Jan 6, 2025
ecd7b52
draft: checkout code
fkrause98 Jan 6, 2025
c375187
draft: yml
fkrause98 Jan 6, 2025
70bd308
draft: fix wrong path in yml
fkrause98 Jan 7, 2025
8f4b645
draft: fix artifact upload
fkrause98 Jan 7, 2025
05f34ef
draft: download md with name instead of pattern
fkrause98 Jan 7, 2025
8e0b77f
draft: use name instead of pattern to download artifact
fkrause98 Jan 7, 2025
47932c6
draft: fix yml
fkrause98 Jan 7, 2025
cd79fd6
draft: run every test
fkrause98 Jan 7, 2025
99999fd
draft: add diff publishing script
fkrause98 Jan 7, 2025
06cff05
draft: cache docker images
fkrause98 Jan 7, 2025
52daf51
draft: image matrix
fkrause98 Jan 7, 2025
857a6d9
draft: require docker image step before hive test
fkrause98 Jan 7, 2025
98fdee4
draft: build docker images with matrix
fkrause98 Jan 7, 2025
6fda087
draft: build docker images with matrix
fkrause98 Jan 7, 2025
ae33975
draft: fix docker build command
fkrause98 Jan 7, 2025
689f886
draft: fix docker hive command
fkrause98 Jan 7, 2025
04ecda9
draft: fix missing checkout source step
fkrause98 Jan 7, 2025
6e39de0
draft: properly name docker images
fkrause98 Jan 7, 2025
c5af8a7
draft: fix docker images artifacts
fkrause98 Jan 7, 2025
cc1b4f8
draft: fix docker artifact upload
fkrause98 Jan 7, 2025
52d11f3
draft: debug tar
fkrause98 Jan 7, 2025
84a3e44
draft: debug
fkrause98 Jan 7, 2025
5662fb6
draft: debug
fkrause98 Jan 7, 2025
b69dd6b
draft: debug
fkrause98 Jan 7, 2025
b03d60f
draft: fix yml
fkrause98 Jan 7, 2025
e48f8e6
draft: run every hive test step-by-step
fkrause98 Jan 7, 2025
a588240
draft: re-tag docker image
fkrause98 Jan 7, 2025
d4237d9
feat: publish diff to slack
fkrause98 Jan 8, 2025
1c9a206
fix: remove unexpected redirect
fkrause98 Jan 8, 2025
f18c297
fix: remove set
fkrause98 Jan 8, 2025
c3bd01e
fix: wrong script path
fkrause98 Jan 8, 2025
05c1120
fix: script
fkrause98 Jan 8, 2025
217fc8e
fix: properly cat diff markdown
fkrause98 Jan 8, 2025
5e09a3c
feat: update script
fkrause98 Jan 8, 2025
c69f173
script: remove set
fkrause98 Jan 9, 2025
da99b36
script: use bash instead of sh
fkrause98 Jan 9, 2025
223c903
feat: prepare for PR review
fkrause98 Jan 9, 2025
2d9bd92
Merge branch 'main' into compare_levm_results
fkrause98 Jan 9, 2025
a977c8a
fix: prepare for PR review
fkrause98 Jan 9, 2025
2fc31cc
Merge branch 'main' into compare_levm_results
fkrause98 Jan 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/scripts/levm_revm_diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/bin/bash

if [ "$#" -ne 2 ]; then
echo "Usage: $0 <revm_file> <levm_file>"
exit 1
fi

revm_file=$1
levm_file=$2

# Check if files exist
if [ ! -f "$revm_file" ]; then
echo "Error: Revm file '$revm_file' not found"
exit 1
fi

if [ ! -f "$levm_file" ]; then
echo "Error: LEVM file '$levm_file' not found"
exit 1
fi

# Create a temporary file
TEMP_FILE=$(mktemp)
trap 'rm -f $TEMP_FILE' EXIT

get_last_section() {
tac "$1" | sed -n "1,/\*Total:/p" | tac
}

parse_results() {
while IFS= read -r line; do
if [[ $line =~ ^[[:space:]]*[^*] && $line =~ : ]]; then
name=$(echo "$line" | cut -d':' -f1 | tr -d '\t' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
values=$(echo "$line" | cut -d':' -f2 | tr -d ' ')
passed=$(echo "$values" | cut -d'/' -f1)
total=$(echo "$values" | cut -d'/' -f2 | cut -d'(' -f1)
percentage=$(echo "$values" | grep -o "[0-9.]*%" | tr -d '%')
echo "$name|$passed|$total|$percentage"
fi
done < <(get_last_section "$1")
}

revm_results=$(parse_results "$revm_file")
levm_results=$(parse_results "$levm_file")

found_differences=false

echo "$revm_results" > "$TEMP_FILE"

while IFS='|' read -r name revm_passed revm_total revm_percentage; do
if [ -n "$name" ]; then
levm_line=$(echo "$levm_results" | grep "^$name|" || true)
if [ -n "$levm_line" ]; then
levm_passed=$(echo "$levm_line" | cut -d'|' -f2)
levm_total=$(echo "$levm_line" | cut -d'|' -f3)
levm_percentage=$(echo "$levm_line" | cut -d'|' -f4)

if [ "$levm_passed" != "$revm_passed" ]; then
if [ "$found_differences" = false ]; then
echo "Found differences between LEVM and revm: :warning:"
echo
found_differences=true
fi
if [ "$levm_passed" -gt "$revm_passed" ]; then
echo "• *$name* (improvement :arrow_up:):"
else
echo "• *$name* (regression :arrow_down:):"
fi
echo " - Revm: $revm_passed/$revm_total ($revm_percentage%)"
echo " - LEVM: $levm_passed/$levm_total ($levm_percentage%)"
echo 1 >> "$TEMP_FILE.diff"
fi
else
if [ "$found_differences" = false ]; then
echo "Found differences between LEVM and revm: :warning:"
echo
found_differences=true
fi
echo "• *$name*: Test present in revm but missing in LEVM :x:"
echo 1 >> "$TEMP_FILE.diff"
fi
fi
done < "$TEMP_FILE"

if [ ! -f "$TEMP_FILE.diff" ]; then
echo "No differences found between revm and LEVM implementations! :white_check_mark:"
fi
2 changes: 1 addition & 1 deletion .github/scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
curl -X POST $url \
-H 'Content-Type: application/json; charset=utf-8' \
--data @- <<EOF
$(jq -n --arg text "$(cat results.md)" '{
$(jq -n --arg text "$(cat results_default.md)" '{
"blocks": [
{
"type": "header",
Expand Down
22 changes: 22 additions & 0 deletions .github/scripts/publish_diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
curl -X POST $url \
-H 'Content-Type: application/json; charset=utf-8' \
--data @- <<EOF
$(jq -n --arg text "$(cat results_default.md)" '{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Daily Hive Coverage report"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": $text
}
}
]
}')
EOF
2 changes: 1 addition & 1 deletion .github/scripts/publish_levm_hive.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
curl -X POST $url \
-H 'Content-Type: application/json; charset=utf-8' \
--data @- <<EOF
$(jq -n --arg text "$(cat results.md)" '{
$(jq -n --arg text "$(cat results_levm.md)" '{
"blocks": [
{
"type": "header",
Expand Down
22 changes: 22 additions & 0 deletions .github/scripts/publish_revm_levm_diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
curl -X POST $url \
-H 'Content-Type: application/json; charset=utf-8' \
--data @- <<EOF
$(jq -n --arg text "$(cat diff.md)" '{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Hive tests revm vs levm diff"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": $text
}
}
]
}')
EOF
42 changes: 38 additions & 4 deletions .github/workflows/daily_reports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
with:
name: ${{ matrix.test.file_name }}_${{ matrix.vm }}_logs
path: hive/workspace/logs/*-*.json
if-no-files-found: error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice


hive-report:
name: Generate report and upload to slack (${{ matrix.vm }})
Expand Down Expand Up @@ -89,6 +90,13 @@ jobs:
- name: Generate the hive report
run: cargo run -p hive_report > results.md

- name: Upload ${{matrix.vm}} result
uses: actions/upload-artifact@v4
with:
name: results_${{matrix.vm}}.md
path: results.md
if-no-files-found: error

- name: Post results in summary
run: |
echo "# Hive coverage report (${{ matrix.vm }})" >> $GITHUB_STEP_SUMMARY
Expand All @@ -114,6 +122,32 @@ jobs:
sh .github/scripts/publish_levm_hive.sh
fi

hive-diff-report:
name: Post tests diff to levm slack
needs: hive-report
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Download results (levm)
uses: actions/download-artifact@v4
with:
name: results_levm.md

- name: Download results (revm)
uses: actions/download-artifact@v4
with:
name: results_revm.md

- name: Post results diff in LEVM channel
env:
url: ${{ secrets.LEVM_SLACK_WEBHOOK }}
run: |
bash .github/scripts/levm_revm_diff.sh results_revm.md results_levm.md >> diff.md
cat diff.md >> $GITHUB_STEP_SUMMARY
bash .github/scripts/publish_revm_levm_diff.sh

levm-test:
name: Generate Report for LEVM EF Tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -144,10 +178,10 @@ jobs:
echo "# Daily LEVM EF Tests Run Report" >> $GITHUB_STEP_SUMMARY
cat cmd/ef_tests/levm/levm_ef_tests_summary_github.txt >> $GITHUB_STEP_SUMMARY

- name: Post results to ethrex L2 slack channel
env:
url: ${{ secrets.ETHREX_L2_SLACK_WEBHOOK }}
run: sh .github/scripts/publish_levm_ef_tests_summary.sh
# - name: Post results to ethrex L2 slack channel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why comment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't want to post to this channel for now, but I might be wrong, I have to double check with @ilitteri

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can remove these commented lines and add them later.

# env:
# url: ${{ secrets.ETHREX_L2_SLACK_WEBHOOK }}
# run: sh .github/scripts/publish_levm_ef_tests_summary.sh

- name: Post results to levm slack channel
env:
Expand Down
Loading