From 8ac9a65ba67ec8314b3a3a0123ca1eaea4137816 Mon Sep 17 00:00:00 2001 From: Kunal Bhargava Date: Wed, 8 May 2024 19:31:23 +0000 Subject: [PATCH] add details to nightly runner --- .../runtime/tests/run_ledger_tests.sh | 3 ++ .../runtime/tests/run_nightly_tests.sh | 29 +++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/flamenco/runtime/tests/run_ledger_tests.sh b/src/flamenco/runtime/tests/run_ledger_tests.sh index 3fcdc01adb..5e5f51447d 100755 --- a/src/flamenco/runtime/tests/run_ledger_tests.sh +++ b/src/flamenco/runtime/tests/run_ledger_tests.sh @@ -297,6 +297,9 @@ if [[ $ON_DEMAND = 0 ]]; then echo_notice "Finished replay from checkpoint\n" fi +fd_log_file=$(grep "Log at" $LOG) +echo "Log for ledger $LEDGER at $fd_log_file" + if [ $status -ne 0 ] || grep -q "Bank hash mismatch" $LOG; then if [ "$status" -eq "$EXPECTED" ]; then diff --git a/src/flamenco/runtime/tests/run_nightly_tests.sh b/src/flamenco/runtime/tests/run_nightly_tests.sh index 8ca9d0a92a..a8a3ecc324 100755 --- a/src/flamenco/runtime/tests/run_nightly_tests.sh +++ b/src/flamenco/runtime/tests/run_nightly_tests.sh @@ -59,11 +59,11 @@ PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$PKG_CONFIG_PATH make distclean && make clean ./deps.sh nuke -echo "y" | ./deps.sh +dev +echo "y" | ./deps.sh +dev make -j # Run the test -make run-runtime-test-nightly +make run-runtime-test-nightly > ~/run_nightly_tests.txt status=$? # Notify the test status @@ -73,6 +73,31 @@ else end_message="@here Alert: Nightly Ledger Test Failed using Commit \`$COMMIT\` on Branch \`$BRANCH\`" fi +mapfile -t log_infos < <(grep 'Log for ledger' ~/run_nightly_tests.txt) + +for log_info in "${log_infos[@]}"; do + echo $log_info + + if [[ $log_info =~ ledger[[:space:]]+([a-zA-Z0-9-]+) ]]; then + ledger="${BASH_REMATCH[1]}" + fi + + if [[ $log_info =~ Log[[:space:]]at[[:space:]]+\"([^\"]+)\" ]]; then + log_file="${BASH_REMATCH[1]}" + fi + + replay_completed=$(grep "replay completed" "$log_file" | tail -n 1) + + slot=$(grep "recovered slot_bank" "$log_file" | tail -n 1 | awk -F'slot=' '{print $2}' | awk '{print $1}') + + if [[ -n "$replay_completed" ]]; then + info="${replay_completed#*replay completed - }" + end_message+=$'\n'" - Ledger \`$ledger\` Passed: $info" + else + end_message+=$'\n'" - Ledger \`$ledger\` Failed, Log at: \`$log_file\`" + fi +done + json_payload=$(cat <