Skip to content

Commit 25e21e0

Browse files
committed
Add test steps details to result summary section
Enhance the test result summary to display individual test steps with their status and timestamps in both console output and GitHub Actions summary. This provides better visibility into test execution details and makes it easier to identify which specific steps passed or failed. Changes: - Add test steps summary to console output after main result box - Include formatted test steps in GitHub Actions summary with markdown formatting - Use consistent yq syntax for parsing steps from e2e report files
1 parent f25b109 commit 25e21e0

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

.github/workflows/dispatch.yaml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,40 @@ jobs:
162162
echo "│ Source: ${{ github.event.client_payload.source }}"
163163
echo "╰─────────────────────────────────────────╯"
164164
165+
# Show test steps if available
166+
if [ -d test-artifacts ]; then
167+
REPORT_FILE=$(find test-artifacts -name "*-e2e-report.yaml" | head -1)
168+
if [ -f "$REPORT_FILE" ] && command -v yq >/dev/null 2>&1; then
169+
echo ""
170+
echo "📋 Test Steps Summary:"
171+
yq '.steps[] | " " + .phase + ": " + .status + " (" + .timestamp + ")"' "$REPORT_FILE" 2>/dev/null | tr -d '"' || echo " No steps data available"
172+
fi
173+
fi
174+
165175
# Create summary for GitHub Actions summary
166-
cat >> $GITHUB_STEP_SUMMARY << EOF
167-
## $STATUS_EMOJI External Test Results - $STATUS_MSG
168-
169-
**Test Details:**
170-
- **Status**: $STATUS_EMOJI $STATUS_MSG
171-
- **Branch**: \`${{ github.event.client_payload.branch }}\`
172-
- **Commit**: \`${{ github.event.client_payload.commit }}\`
173-
- **Source**: ${{ github.event.client_payload.source }}
174-
- **Timestamp**: $(date -d @${{ github.event.client_payload.timestamp }} 2>/dev/null || echo "${{ github.event.client_payload.timestamp }}")
175-
176-
**Artifact**: ${{ github.event.client_payload.artifact_name }}
177-
EOF
176+
{
177+
echo "## $STATUS_EMOJI External Test Results - $STATUS_MSG"
178+
echo ""
179+
echo "**Test Details:**"
180+
echo "- **Status**: $STATUS_EMOJI $STATUS_MSG"
181+
echo "- **Branch**: \`${{ github.event.client_payload.branch }}\`"
182+
echo "- **Commit**: \`${{ github.event.client_payload.commit }}\`"
183+
echo "- **Source**: ${{ github.event.client_payload.source }}"
184+
echo "- **Timestamp**: $(date -d @${{ github.event.client_payload.timestamp }} 2>/dev/null || echo "${{ github.event.client_payload.timestamp }}")"
185+
echo ""
186+
echo "**Artifact**: ${{ github.event.client_payload.artifact_name }}"
187+
188+
# Add test steps to GitHub summary if available
189+
if [ -d test-artifacts ]; then
190+
REPORT_FILE=$(find test-artifacts -name "*-e2e-report.yaml" | head -1)
191+
if [ -f "$REPORT_FILE" ] && command -v yq >/dev/null 2>&1; then
192+
echo ""
193+
echo "### 📋 Test Steps"
194+
echo ""
195+
yq '.steps[] | "- **" + .phase + "**: " + .status + " _(" + .timestamp + ")_"' "$REPORT_FILE" 2>/dev/null | tr -d '"' || echo "No steps data available"
196+
fi
197+
fi
198+
} >> $GITHUB_STEP_SUMMARY
178199
179200
- name: Upload artifacts
180201
if: github.event.client_payload.artifacts

0 commit comments

Comments
 (0)