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:
102102  #  Unit Tests
103103  # ################
104104  - label : " 🔬 Unit Tests" 
105+     key : unit-tests 
105106    command : " .buildkite/commands/run-unit-tests.sh" 
106107    plugins :
107108      - $CI_TOOLKIT 
108109      - $TEST_COLLECTOR  :
109110          << : *test_collector_common_params 
110111          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" 
111115    artifact_paths :
112116      - " **/build/test-results/merged-test-results.xml" 
113117      - " **/build/reports/kover/*.xml" 
114118
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+ 
115127  # ################
116128  #  Instrumented (aka UI) Tests
117129  # ################
Original file line number Diff line number Diff line change 55
66export  CI_TOOLKIT=" automattic/a8c-ci-toolkit#5.3.1" 
77export  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