From b583c92c644342969526314ce93f590e12ff3e8d Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sun, 8 Feb 2026 13:14:38 -0800 Subject: [PATCH] fix: only show Failed Tests section when there are actual failures (#8575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description The Playwright test comment was showing a "❌ Failed Tests" section header even when there were only flaky tests (no actual failures). This was confusing because the red X suggested failure when tests actually passed. **Before:** Shows "❌ Failed Tests" section for flaky-only runs **After:** Only shows "❌ Failed Tests" section when there are actual failures; flaky tests are treated as passing ## Related Issue Fixes the misleading comment behavior seen in PR #8573 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8575-fix-only-show-Failed-Tests-section-when-there-are-actual-failures-2fc6d73d36508167889cc252e4e06f2e) by [Unito](https://www.unito.io) --------- Co-authored-by: Alexander Brown --- .../cicd/pr-playwright-deploy-and-comment.sh | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/scripts/cicd/pr-playwright-deploy-and-comment.sh b/scripts/cicd/pr-playwright-deploy-and-comment.sh index 9332e60b7..ed8951034 100755 --- a/scripts/cicd/pr-playwright-deploy-and-comment.sh +++ b/scripts/cicd/pr-playwright-deploy-and-comment.sh @@ -283,34 +283,27 @@ else done unset IFS - # Determine overall status + # Determine overall status (flaky tests are treated as passing) if [ $total_failed -gt 0 ]; then status_icon="❌" - status_text="Failed" - elif [ $total_flaky -gt 0 ]; then - status_icon="⚠️" - status_text="Passed with flaky tests" elif [ $total_tests -gt 0 ]; then status_icon="✅" - status_text="Passed" else status_icon="🕵🏻" - status_text="No test results" fi - # Generate concise completion comment - comment="$COMMENT_MARKER -## 🎭 Playwright Tests: $status_icon **$status_text**" - - # Add summary counts if we have test data - if [ $total_tests -gt 0 ]; then - comment="$comment - -**Results:** $total_passed passed, $total_failed failed, $total_flaky flaky, $total_skipped skipped (Total: $total_tests)" + # Build flaky indicator if any (small subtext, no warning icon) + flaky_note="" + if [ $total_flaky -gt 0 ]; then + flaky_note=" · $total_flaky flaky" fi + + # Generate compact single-line comment + comment="$COMMENT_MARKER +**Playwright:** $status_icon $total_passed passed, $total_failed failed$flaky_note" - # Extract and display failed tests from all browsers - if [ $total_failed -gt 0 ] || [ $total_flaky -gt 0 ]; then + # Extract and display failed tests from all browsers (flaky tests are treated as passing) + if [ $total_failed -gt 0 ]; then comment="$comment ### ❌ Failed Tests"