File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash -eu
2
+
3
+ # Check if unit tests failed (matches both hard_failed and soft_failed outcomes)
4
+ if buildkite-agent step get outcome --step unit-tests | grep -q " failed" ; then
5
+ comment_on_pr --id claude-test-analysis " $( cat << EOF
6
+
7
+ ## 🤖 Test Failure Analysis
8
+
9
+ Your tests failed. Claude has analyzed the failures - <a href=\"${BUILDKITE_BUILD_URL} /annotations#annotation-claude-analysis-${BUILDKITE_BUILD_ID} \" target=\"_blank\">check the annotation</a> for details.
10
+ EOF
11
+ ) "
12
+
13
+ else
14
+ # Remove the comment if tests are now passing
15
+ comment_on_pr --id claude-test-analysis --if-exist delete
16
+ fi
Original file line number Diff line number Diff line change @@ -102,16 +102,28 @@ steps:
102
102
# Unit Tests
103
103
# ################
104
104
- label : " 🔬 Unit Tests"
105
+ key : unit-tests
105
106
command : " .buildkite/commands/run-unit-tests.sh"
106
107
plugins :
107
108
- $CI_TOOLKIT
108
109
- $TEST_COLLECTOR :
109
110
<< : *test_collector_common_params
110
111
api-token-env-name : " BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_WORDPRESS"
112
+ - $CLAUDE_PLUGIN :
113
+ api_key : " $ANTHROPIC_API_KEY"
114
+ buildkite_api_token : " $BUILDKITE_TOKEN_FOR_CLAUDE"
111
115
artifact_paths :
112
116
- " **/build/test-results/merged-test-results.xml"
113
117
- " **/build/reports/kover/*.xml"
114
118
119
+ - label : " 💬 Comment Claude Analysis"
120
+ command : .buildkite/commands/comment-claude-analysis.sh
121
+ depends_on : unit-tests
122
+ allow_dependency_failure : true
123
+ if : build.pull_request.id != null
124
+ plugins :
125
+ - $CI_TOOLKIT
126
+
115
127
# ################
116
128
# Instrumented (aka UI) Tests
117
129
# ################
Original file line number Diff line number Diff line change 5
5
6
6
export CI_TOOLKIT=" automattic/a8c-ci-toolkit#5.3.1"
7
7
export TEST_COLLECTOR=" test-collector#v1.10.1"
8
+ export CLAUDE_PLUGIN=" claude-summarize#v1.1.0"
You can’t perform that action at this time.
0 commit comments