Skip to content

Commit f982b64

Browse files
feat: add report summary workflow and update smoke tests to upload JSON report
1 parent a30457a commit f982b64

File tree

3 files changed

+130
-39
lines changed

3 files changed

+130
-39
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: report-summary
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifact-name:
7+
required: true
8+
type: string
9+
artifact-path:
10+
required: false
11+
type: string
12+
13+
jobs:
14+
summarize:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Install jq
18+
run: |
19+
sudo apt-get update -y
20+
sudo apt-get install -y jq
21+
22+
- name: Download report artifact
23+
uses: actions/download-artifact@v4
24+
with:
25+
name: ${{ inputs.artifact-name }}
26+
path: ./report_artifacts
27+
28+
- name: Locate report.json
29+
id: locate
30+
run: |
31+
if [ -n "${{ inputs.artifact-path }}" ]; then
32+
REPORT_PATH="${{ inputs.artifact-path }}"
33+
else
34+
REPORT_PATH=$(find report_artifacts -type f -name 'report.json' | head -n1 || true)
35+
fi
36+
echo "REPORT_PATH=$REPORT_PATH" >> $GITHUB_ENV
37+
if [ -z "$REPORT_PATH" ]; then
38+
echo "No report.json found in downloaded artifacts"
39+
exit 1
40+
fi
41+
42+
- name: Add report to summary
43+
if: always()
44+
run: |
45+
{
46+
echo "## Smoke Tests Report"
47+
echo ""
48+
49+
REPORT_FILE="$REPORT_PATH"
50+
if [ -f "$REPORT_FILE" ]; then
51+
PASSED=$(jq -r '.summary.passed // empty' "$REPORT_FILE" 2>/dev/null || true)
52+
FAILED=$(jq -r '.summary.failed // empty' "$REPORT_FILE" 2>/dev/null || true)
53+
SKIPPED=$(jq -r '.summary.skipped // empty' "$REPORT_FILE" 2>/dev/null || true)
54+
ERRORS=$(jq -r '.summary.errors // empty' "$REPORT_FILE" 2>/dev/null || true)
55+
56+
if [ -z "${PASSED}" ] || [ -z "${FAILED}" ] || [ -z "${SKIPPED}" ] || [ -z "${ERRORS}" ]; then
57+
if jq -e '.tests' "$REPORT_FILE" >/dev/null 2>&1; then
58+
PASSED=$(jq '[.tests[] | select(.outcome=="passed")] | length' "$REPORT_FILE")
59+
FAILED=$(jq '[.tests[] | select(.outcome=="failed" or .outcome=="error")] | length' "$REPORT_FILE")
60+
SKIPPED=$(jq '[.tests[] | select(.outcome=="skipped")] | length' "$REPORT_FILE")
61+
ERRORS=$(jq '[.tests[] | select(.outcome=="error")] | length' "$REPORT_FILE")
62+
fi
63+
fi
64+
65+
PASSED=${PASSED:-0}
66+
FAILED=${FAILED:-0}
67+
SKIPPED=${SKIPPED:-0}
68+
ERRORS=${ERRORS:-0}
69+
70+
echo "| Status | Count |"
71+
echo "| ------ | ----- |"
72+
echo "| ✅ Passed | ${PASSED} |"
73+
echo "| ❌ Failed | ${FAILED} |"
74+
echo "| ⚠️ Error | ${ERRORS} |"
75+
echo "| ⏭️ Skipped | ${SKIPPED} |"
76+
echo ""
77+
78+
TOTAL=$((PASSED + FAILED + ERRORS + SKIPPED))
79+
echo "**Total Tests:** $TOTAL"
80+
echo ""
81+
if [ "${FAILED}" -gt 0 ] || [ "${ERRORS}" -gt 0 ]; then
82+
echo "❌ **Some tests failed!** Please check the detailed report."
83+
else
84+
echo "✅ **All tests passed!**"
85+
fi
86+
echo ""
87+
88+
echo ""
89+
echo "### Test results"
90+
echo ""
91+
echo "| Test | Status |"
92+
echo "| ---- | ------ |"
93+
if jq -e '.tests' "$REPORT_FILE" >/dev/null 2>&1; then
94+
jq -r '.tests[] | "\(.nodeid)\t\(.outcome // \"passed\")"' "$REPORT_FILE" | \
95+
while IFS=$'\t' read -r NODEID OUTCOME; do
96+
case "${OUTCOME}" in
97+
passed) ICON="✅ Passed" ;;
98+
failed) ICON="❌ Failed" ;;
99+
error) ICON="⚠️ Error" ;;
100+
skipped) ICON="⏭️ Skipped" ;;
101+
xfailed) ICON="❗ XFailed" ;;
102+
xpassed) ICON="❗ XPassed" ;;
103+
*) ICON="${OUTCOME}" ;;
104+
esac
105+
ESC_NODEID=$(printf '%s' "${NODEID}" | sed 's/`/\\`/g' | sed 's/|/\\|/g')
106+
echo "| \`${ESC_NODEID}\` | ${ICON} |"
107+
done
108+
else
109+
echo "No per-test details available in report.json"
110+
fi
111+
else
112+
echo "❌ No report.json file was generated"
113+
fi
114+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/smoke_tests.yml

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -170,44 +170,17 @@ jobs:
170170
name: smoke-tests-report
171171
path: |
172172
report.html
173-
- name: "Add report to summary"
173+
- name: "upload json report"
174174
if: always()
175-
run: |
176-
{
177-
echo "## Smoke Tests Report"
178-
echo ""
179-
180-
# Check if JSON report exists
181-
if [ -f "report.json" ]; then
182-
# Parse JSON report
183-
PASSED=$(jq '.summary.passed // 0' report.json)
184-
FAILED=$(jq '.summary.failed // 0' report.json)
185-
SKIPPED=$(jq '.summary.skipped // 0' report.json)
186-
ERROR=$(jq '.summary.errors // 0' report.json)
187-
188-
# Add summary stats
189-
echo "| Status | Count |"
190-
echo "| ------ | ----- |"
191-
echo "| ✅ Passed | ${PASSED:-0} |"
192-
echo "| ❌ Failed | ${FAILED:-0} |"
193-
echo "| ⚠️ Error | ${ERROR:-0} |"
194-
echo "| ⏭️ Skipped | ${SKIPPED:-0} |"
195-
echo ""
196-
197-
# Add test result details if available
198-
TOTAL=$((${PASSED:-0} + ${FAILED:-0} + ${ERROR:-0} + ${SKIPPED:-0}))
199-
echo "**Total Tests:** $TOTAL"
200-
echo ""
201-
if [ "${FAILED:-0}" -gt 0 ] || [ "${ERROR:-0}" -gt 0 ]; then
202-
echo "❌ **Some tests failed!** Please check the detailed report."
203-
else
204-
echo "✅ **All tests passed!**"
205-
fi
206-
echo ""
175+
id: upload-report-json
176+
uses: actions/upload-artifact@v4
177+
with:
178+
name: smoke-tests-report-json
179+
path: |
180+
report.json
207181
208-
# Add link to full report artifact
209-
echo "📄 [Download Full HTML Report](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts/${{ steps.upload-report.outputs.artifact-id }})"
210-
else
211-
echo "❌ No report.json file was generated"
212-
fi
213-
} >> "$GITHUB_STEP_SUMMARY"
182+
call-report-summary:
183+
needs: validation-run-tests
184+
uses: ./.github/workflows/report-summary.yml
185+
with:
186+
artifact-name: smoke-tests-report-json

tests/validation/functional/local/audio/test_ffmpeg_audio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def test_local_ffmpeg_audio(
5050
"sdk_port"
5151
]
5252

53+
# PCM 8 (pcm_s8) is not supported by the MCM FFmpeg plugin. Skip those cases.
54+
if audio_files_25_03[audio_type]["format"] == "pcm_s8":
55+
pytest.skip("PCM 8 is not supported by Media Communications Mesh FFmpeg plugin!")
56+
5357
audio_format = audio_file_format_to_format_dict(
5458
str(audio_files_25_03[audio_type]["format"])
5559
) # audio format

0 commit comments

Comments
 (0)