Skip to content

Commit 41b3ef6

Browse files
committed
[scout] fix missing failed test annotations in BK (#239959)
## Summary We are removing scout reports to avoid ingesting the same data twice, but it was also removing failed test artifacts and causing missing annotations. See this failed [build](https://buildkite.com/elastic/kibana-on-merge/builds/80159#) This PR updates the removal logic so that we keep failed test artifacts to be uploaded and later used for BK annotations. <img width="1275" height="416" alt="image" src="https://github.com/user-attachments/assets/ccf10218-5ad4-4649-aa90-d4e9b912915a" /> (cherry picked from commit 1a54d44)
1 parent 937a80e commit 41b3ef6

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.buildkite/scripts/steps/test/scout_configs.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,17 @@ upload_events_if_available() {
100100
echo "⚠️ Upload failed for $config_path ($mode) with exit code $UPLOAD_EXIT_CODE"
101101
fi
102102

103-
# Clean up reports directory after upload attempt
104-
echo "🧹 Cleaning up Scout reports directory"
105-
rm -rf .scout/reports
103+
# Clean up events reports to avoid double ingestion, but preserve failure reports
104+
echo "🧹 Cleaning up Scout events reports (preserving failure reports for annotations)"
105+
# Only remove events reports, not failure reports
106+
if [ -d ".scout/reports" ]; then
107+
for dir in .scout/reports/scout-playwright-*; do
108+
if [ -d "$dir" ] && [[ "$dir" != *"scout-playwright-test-failures-"* ]]; then
109+
rm -rf "$dir"
110+
fi
111+
done
112+
fi
113+
# Keep .scout/reports/scout-playwright-test-failures-* and .scout/test-artifacts/ for failed test reporter
106114
else
107115
echo "❌ No Scout reports found for $config_path ($mode)"
108116
fi

0 commit comments

Comments
 (0)