Repository navigation
feat: add Go test-runner MCP plugin - #23
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2129044630
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| } | ||
| for _, p := range o.Packages { | ||
| if p == "" || strings.HasPrefix(p, "-") || strings.ContainsAny(p, "\x00\r\n") || strings.HasSuffix(p, ".go") { |
There was a problem hiding this comment.
Accept package paths ending in .go
A valid package directory or import path may end in .go; Go 1.24.3 accepts go list -- ./pkg.go, and go help packages states that a path beginning with . denotes the package in that directory. This check rejects such packages, and it also makes a generated rerun unusable when a failed package's resolved import path ends in .go, because passing the returned object back through parseOptions fails before execution. Distinguish actual Go file lists using discovery results rather than the string suffix.
AGENTS.md reference: AGENTS.md:L38-L38
Useful? React with 👍 / 👎.
…rails - An all-skipped run reports `passed` with only `tests.skipped`, not `no_tests` - Restore the notes lost in the Japanese localization: no_tests is not proof, counts include parent tests and subtests, error/timeout/cancelled are never a clean run, no automatic retries, broaden testing only when warranted - Drop the README sentence that only explained the old -codex skill name Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80e4c15195
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| o.Run, ok = v.(string) | ||
| if !ok || strings.ContainsRune(o.Run, 0) { | ||
| return o, fmt.Errorf("run must be a string without NUL bytes") |
There was a problem hiding this comment.
Reject invalid -run expressions before invoking tests
When run is a malformed expression such as [, the -run regexp semantics documented by go help testflag make go test emit a package-level fail event and exit 1; the current parser consequently returns status: "failed" with MCP isError: false, even though no test failed and the caller supplied invalid input. Validate the expression here and return status: "error" so agents do not misreport an invocation error as a project test failure.
AGENTS.md reference: AGENTS.md:L42-L43
Useful? React with 👍 / 👎.
Both findings come from the Codex review on PR #23 (already merged), so they land as a follow-up. - Accept package patterns ending in ".go". A directory or import path may end in ".go" (go list resolves ./pkg.go to <module>/pkg.go), and the spelling check also rejected the tool's own generated rerun arguments. A real .go file list is rejected by its discovery result instead, because go list reports it as "command-line-arguments". - Reject a -run expression the test binary would reject at startup. Left to go test, "-run [" fails every package with zero failing tests, so an input error was reported as status "failed" with isError false. The element split mirrors testing.splitRegexp, including the escape branch (without it an escaped separator such as `a\/b` splits into `a\`, which does not compile) and the whitespace rewrite (without it `(?P<a b>x)` would be rejected although go test accepts it). Agreement with real "go test -run" verified on 22 expressions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Goテストの実行結果をAIが扱いやすくするため、
go_testMCPツールを提供するtest-runnerプラグインを追加します。1モジュールずつ同期実行し、テスト失敗とビルド失敗を区別して、失敗ログと対象を絞った再実行引数を返します。変更内容
検証
go vet ./...、go test -race -count=1 ./...通過。govulncheck-gate.shによる脆弱性検査通過。./build.sh test-runnerによる3環境のビルドと、再ビルド前後のSHA-256一致を確認。git diff --check通過。macOS/Windowsでのネイティブ実行とPowerShellビルドはローカル未検証です。ネイティブ実行用CIを追加しています。テストはホスト権限・Go環境を継承してプロジェクトコードを実行し、このプラグイン自体はサンドボックスを提供しません。