-
Notifications
You must be signed in to change notification settings - Fork 38
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
Changes from all commits
a886f56
60be01c
ed2e329
84dc25c
0fcc71d
55fae00
c33b7d9
b0b6bd2
40af017
ecd7b52
c375187
70bd308
8f4b645
05f34ef
8e0b77f
47932c6
cd79fd6
99999fd
06cff05
52daf51
857a6d9
98fdee4
6fda087
ae33975
689f886
04ecda9
6e39de0
c5af8a7
cc1b4f8
52d11f3
84a3e44
5662fb6
b69dd6b
b03d60f
e48f8e6
a588240
d4237d9
1c9a206
f18c297
c3bd01e
05c1120
217fc8e
5e09a3c
c69f173
da99b36
223c903
2d9bd92
a977c8a
2fc31cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
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 |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ jobs: | |
with: | ||
name: ${{ matrix.test.file_name }}_${{ matrix.vm }}_logs | ||
path: hive/workspace/logs/*-*.json | ||
if-no-files-found: error | ||
|
||
hive-report: | ||
name: Generate report and upload to slack (${{ matrix.vm }}) | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why comment here? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice