Skip to content

Commit 734dfa3

Browse files
committed
improve
Signed-off-by: pipiland2612 <[email protected]>
1 parent c1f0f36 commit 734dfa3

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

scripts/e2e/metrics_summary.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,36 @@ if $DIFF_FOUND; then
4747
echo "Metric differences detected"
4848
echo "DIFF_FOUND=true" >> "$GITHUB_OUTPUT"
4949

50+
# Calculate total changes across all files
51+
total_changes=0
52+
for summary_file in "${summary_files[@]}"; do
53+
changes=$(grep "**Total Changes:**" "$summary_file" | awk '{print $3}')
54+
total_changes=$((total_changes + changes))
55+
done
56+
5057
# Combine all summaries into one
51-
echo "## Metrics Comparison Summary" > "$METRICS_DIR/combined_summary.md"
52-
echo "" >> "$METRICS_DIR/combined_summary.md"
58+
combined_file="$METRICS_DIR/combined_summary.md"
59+
echo "## Metrics Comparison Summary" > "$combined_file"
60+
echo "" >> "$combined_file"
61+
echo "Total changes across all snapshots: $total_changes" >> "$combined_file"
62+
echo "" >> "$combined_file"
63+
echo "<details>" >> "$combined_file"
64+
echo "<summary>Detailed changes per snapshot</summary>" >> "$combined_file"
65+
echo "" >> "$combined_file"
5366

5467
if [ ${#summary_files[@]} -gt 0 ]; then
5568
for summary_file in "${summary_files[@]}"; do
5669
echo "Appending $summary_file to combined summary"
5770
{
5871
echo "### $(basename "$summary_file" .md)"
5972
cat "$summary_file"
60-
} >> "$METRICS_DIR/combined_summary.md"
61-
echo "" >> "$METRICS_DIR/combined_summary.md"
73+
} >> "$combined_file"
74+
echo "" >> "$combined_file"
6275
done
6376
fi
6477

65-
echo -e "\n\n➡️ [View full metrics file]($LINK_TO_ARTIFACT)" >> "$METRICS_DIR/combined_summary.md"
78+
echo "</details>" >> "$combined_file"
79+
echo -e "\n\n➡️ [View full metrics file]($LINK_TO_ARTIFACT)" >> "$combined_file"
6680
else
6781
echo "No metric differences detected"
6882
fi

0 commit comments

Comments
 (0)