Skip to content

Commit

Permalink
add details to nightly runner
Browse files Browse the repository at this point in the history
  • Loading branch information
kbhargava-jump committed May 8, 2024
1 parent ddc58e1 commit 8ac9a65
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/flamenco/runtime/tests/run_ledger_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 27 additions & 2 deletions src/flamenco/runtime/tests/run_nightly_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOF
{
"text": "$end_message",
Expand Down

0 comments on commit 8ac9a65

Please sign in to comment.