Daily Go Test Parallelizer
Adds t.Parallel to safe Go tests, using a daily round-robin analysis.
- Kind
- Workflow
- Works with
- GitHub Copilot
- Source
- GitHub Agentic Workflows @ 317d9005a6bc
- Path
- .github/workflows/daily-go-test-parallelizer.md
- License
- MIT
- Jobs
- Testing
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
# Daily Go Test Parallelizer
Analyze up to twenty-five Go test files per run and add `t.Parallel()` only where parallel execution is demonstrably safe.
## Select a file
1. Use `grep` to list tracked `*_test.go` files containing top-level `Test` functions. Exclude `vendor/` and generated files, then sort paths lexicographically.
2. Read `/tmp/gh-aw/cache-memory/go-test-parallelizer/state.json` when it exists. It has this shape:
`{"last_file":"path/to/file_test.go"}`.
3. Select up to 25 consecutive paths starting after `last_file`, wrapping to the first path. If the cache is absent, malformed, or names a removed file, start from the first path.
4. Analyze and modify only this selected batch (maximum 25 files).
5. Minimize token usage: avoid re-reading files you already analyzed, and do not paste full file contents into notes or outputs.
## Analyze safety
Add `t.Parallel()` at the start of eligible top-level tests. Also add it to eligible table-driven subtests.
For Go 1.22+ semantics, do not add redundant loop-variable rebinding (`tt := tt`, `cmd := cmd`) unless a case truly needs an additional local copy for correctness.
…