Skip to content

Commit fc71417

Browse files
committed
feat: enhance coverage failure error messaging
- Add detailed coverage analysis with current vs required percentages - Show coverage gap calculation (how much more coverage is needed) - List specific test classes being validated - Provide clear step-by-step instructions to fix coverage issues - Add detailed test result breakdown (passed/failed/skipped counts) - Include next steps for developers to improve test coverage - Make error messages more actionable and informative
1 parent 3c4c36b commit fc71417

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

.github/workflows/create-release.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ jobs:
176176
if echo "$TEST_RESULT" | jq -e '.result.summary' > /dev/null 2>&1; then
177177
SUMMARY=$(echo "$TEST_RESULT" | jq -r '.result.summary')
178178
echo "Test Summary: $SUMMARY"
179+
180+
# Show detailed test counts
181+
PASSING=$(echo "$TEST_RESULT" | jq -r '.result.summary.passing // 0')
182+
FAILING=$(echo "$TEST_RESULT" | jq -r '.result.summary.failing // 0')
183+
SKIPPED=$(echo "$TEST_RESULT" | jq -r '.result.summary.skipped // 0')
184+
TESTS_RAN=$(echo "$TEST_RESULT" | jq -r '.result.summary.testsRan // 0')
185+
186+
echo "📈 Test Results: $PASSING passed, $FAILING failed, $SKIPPED skipped (Total: $TESTS_RAN)"
179187
fi
180188
181189
# Extract coverage percentage - try multiple possible locations in the JSON
@@ -194,8 +202,30 @@ jobs:
194202
if [ -n "$COVERAGE" ]; then
195203
MIN_COVERAGE=75
196204
if (( $(echo "$COVERAGE < $MIN_COVERAGE" | bc -l) )); then
197-
echo "❌ ERROR: Code coverage $COVERAGE% is below minimum requirement of $MIN_COVERAGE%"
198-
echo "💡 Consider adding more test methods or improving existing test coverage"
205+
echo ""
206+
echo "❌ COVERAGE FAILURE: Code coverage $COVERAGE% is below minimum requirement of $MIN_COVERAGE%"
207+
echo ""
208+
echo "📊 COVERAGE ANALYSIS:"
209+
echo " Current Coverage: $COVERAGE%"
210+
echo " Required Coverage: $MIN_COVERAGE%"
211+
echo " Coverage Gap: $((MIN_COVERAGE - COVERAGE))%"
212+
echo ""
213+
echo "🔍 TEST CLASSES BEING VALIDATED:"
214+
echo " - NebulaAdapter_Test"
215+
echo " - RestLibTests"
216+
echo ""
217+
echo "💡 TO FIX THIS ISSUE:"
218+
echo " 1. Add more test methods to cover uncovered code paths"
219+
echo " 2. Improve existing test methods to cover more scenarios"
220+
echo " 3. Review uncovered lines in the test results above"
221+
echo " 4. Ensure all public methods and critical code paths are tested"
222+
echo ""
223+
echo "📋 NEXT STEPS:"
224+
echo " - Check the detailed coverage information in the test output above"
225+
echo " - Look for 'uncoveredLines' in the JSON output to see which lines need testing"
226+
echo " - Add test methods for any missing scenarios"
227+
echo " - Re-run the workflow after improving test coverage"
228+
echo ""
199229
exit 1
200230
else
201231
echo "✅ SUCCESS: Code coverage $COVERAGE% meets minimum requirement of $MIN_COVERAGE%"

0 commit comments

Comments
 (0)