Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .buildkite/commands/comment-claude-analysis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -eu

# Check if unit tests failed (matches both hard_failed and soft_failed outcomes)
if buildkite-agent step get outcome --step unit-tests | grep -q "failed"; then
comment_on_pr --id claude-test-analysis "## 🤖 Test Failure Analysis

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."
else
# Remove the comment if tests are now passing
comment_on_pr --id claude-test-analysis --if-exist delete
fi
12 changes: 12 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,27 @@ steps:
steps:

- label: "Unit tests"
key: unit-tests
command: .buildkite/commands/run-unit-tests.sh
plugins:
- $CI_TOOLKIT
- $TEST_COLLECTOR :
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS"
- $CLAUDE_PLUGIN:
api_key: "$ANTHROPIC_API_KEY"
buildkite_api_token: "$BUILDKITE_TOKEN_FOR_CLAUDE"
artifact_paths:
- "**/build/test-results/merged-test-results.xml"

- label: "💬 Comment Claude Analysis"
command: .buildkite/commands/comment-claude-analysis.sh
depends_on: unit-tests
allow_dependency_failure: true
if: build.pull_request.id != null
plugins:
- $CI_TOOLKIT

- label: "Instrumented tests"
command: .buildkite/commands/run-instrumented-tests.sh
plugins:
Expand Down
1 change: 1 addition & 0 deletions .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

export CI_TOOLKIT="automattic/a8c-ci-toolkit#5.4.0"
export TEST_COLLECTOR="test-collector#v1.10.1"
export CLAUDE_PLUGIN="claude-summarize#v1.1.0"