Skip to content

Commit b8dcd37

Browse files
authored
Fix ci-coach workflow: use correct JSON field name for gh CLI and add test performance collection (#6254)
1 parent 3550e31 commit b8dcd37

File tree

2 files changed

+83
-48
lines changed

2 files changed

+83
-48
lines changed

.github/workflows/ci-coach.lock.yml

Lines changed: 65 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/ci-coach.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ steps:
2323
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
run: |
2525
# Download workflow runs for the ci workflow
26-
gh run list --repo ${{ github.repository }} --workflow=ci.yml --limit 100 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,runNumber > /tmp/ci-runs.json
26+
gh run list --repo ${{ github.repository }} --workflow=ci.yml --limit 100 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,number > /tmp/ci-runs.json
2727
2828
# Create directory for artifacts
2929
mkdir -p /tmp/ci-artifacts
@@ -73,11 +73,10 @@ steps:
7373
run: make recompile
7474

7575
- name: Run unit tests
76-
run: go test -v -count=1 -timeout=3m -tags '!integration' -run='^Test' ./...
77-
78-
- name: Run JavaScript tests
79-
run: npm test
80-
working-directory: ./pkg/workflow/js
76+
continue-on-error: true
77+
run: |
78+
mkdir -p /tmp/gh-aw
79+
go test -v -json -count=1 -timeout=3m -tags '!integration' -run='^Test' ./... | tee /tmp/gh-aw/test-results.json
8180
safe-outputs:
8281
create-pull-request:
8382
title-prefix: "[ci-coach] "
@@ -108,12 +107,24 @@ Analyze the CI workflow daily to identify concrete optimization opportunities th
108107
2. **Artifacts**: `/tmp/ci-artifacts/` - Coverage reports and benchmark results from recent successful runs
109108
3. **CI Configuration**: `.github/workflows/ci.yml` - Current CI workflow configuration
110109
4. **Cache Memory**: `/tmp/cache-memory/` - Historical analysis data from previous runs
110+
5. **Test Results**: `/tmp/gh-aw/test-results.json` - JSON output from Go unit tests with performance and timing data
111+
112+
### Test Case Information
113+
The Go test cases are located throughout the repository:
114+
- **Command tests**: `./cmd/gh-aw/*_test.go` - CLI command and main entry point tests
115+
- **Workflow tests**: `./pkg/workflow/*_test.go` - Workflow compilation, validation, and execution tests
116+
- **CLI tests**: `./pkg/cli/*_test.go` - Command implementation tests
117+
- **Parser tests**: `./pkg/parser/*_test.go` - Frontmatter and schema parsing tests
118+
- **Campaign tests**: `./pkg/campaign/*_test.go` - Campaign specification tests
119+
- **Other package tests**: Various `./pkg/*/test.go` files throughout the codebase
120+
121+
The `/tmp/gh-aw/test-results.json` file contains detailed timing and performance data for each test case in JSON format, allowing you to identify slow tests, flaky tests, and optimization opportunities.
111122

112123
### Environment Setup
113124
The workflow has already completed:
114125
-**Linting**: Dev dependencies installed, linters run successfully
115126
-**Building**: Code built with `make build`, lock files compiled with `make recompile`
116-
-**Testing**: Unit tests and JavaScript tests run successfully
127+
-**Testing**: Unit tests run (with performance data collected in JSON format)
117128

118129
This means you can:
119130
- Make changes to code or configuration files

0 commit comments

Comments
 (0)