Skip to content
Merged
Changes from all commits
Commits
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
26 changes: 21 additions & 5 deletions scripts/e2e/metrics_summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,38 @@ if $DIFF_FOUND; then
echo "Metric differences detected"
echo "DIFF_FOUND=true" >> "$GITHUB_OUTPUT"

# Calculate total changes across all files
total_changes=0
for summary_file in "${summary_files[@]}"; do
changes=$(grep -F "**Total Changes:**" "$summary_file" | awk '{print $3}')
total_changes=$((total_changes + changes))
done

# Combine all summaries into one
echo "## Metrics Comparison Summary" > "$METRICS_DIR/combined_summary.md"
echo "" >> "$METRICS_DIR/combined_summary.md"
combined_file="$METRICS_DIR/combined_summary.md"
echo "## Metrics Comparison Summary" > "$combined_file"
{
echo ""
echo "Total changes across all snapshots: $total_changes"
echo ""
echo "<details>"
echo "<summary>Detailed changes per snapshot</summary>"
echo ""
} >> "$combined_file"

if [ ${#summary_files[@]} -gt 0 ]; then
for summary_file in "${summary_files[@]}"; do
echo "Appending $summary_file to combined summary"
{
echo "### $(basename "$summary_file" .md)"
cat "$summary_file"
} >> "$METRICS_DIR/combined_summary.md"
echo "" >> "$METRICS_DIR/combined_summary.md"
} >> "$combined_file"
echo "" >> "$combined_file"
done
fi

echo -e "\n\n➡️ [View full metrics file]($LINK_TO_ARTIFACT)" >> "$METRICS_DIR/combined_summary.md"
echo "</details>" >> "$combined_file"
echo -e "\n\n➡️ [View full metrics file]($LINK_TO_ARTIFACT)" >> "$combined_file"
else
echo "No metric differences detected"
fi
Expand Down
Loading