From 175f0a5ed1e2661b162223642fbfa4a7c77b58b0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 8 Apr 2026 13:11:43 +0000 Subject: [PATCH 1/2] testkit: use OUTPUT_PATTERN guard; wire prebuilt CLI in spec-kit CI - CliBridge.runGitCmd: detect missing output via OUTPUT_PATTERN instead of a fragile substring match on quoted field names. - spec-kit-conformance job: set GIT_TESTKIT_CLI to the binary built in the prior step so Python/Java steps avoid repeated go run recompiles. - Clarify testkit README Go regression path and ROADMAP CLI location wording. Co-authored-by: Ben Schellenberger --- .github/workflows/ci.yml | 8 ++++++++ testkit/README.md | 2 +- testkit/ROADMAP.md | 2 +- .../java/src/main/java/io/gitfire/testkit/CliBridge.java | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f338f11..ac773d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,21 +45,29 @@ jobs: cache: maven - name: Run Python spec conformance smoke tests + env: + GIT_TESTKIT_CLI: ./git-testkit-cli run: | cd testkit/python python -m pip install -e ".[dev]" python -m pytest tests/ -v - name: Run Python sample smoke implementations + env: + GIT_TESTKIT_CLI: ./git-testkit-cli run: | cd testkit/python python -m samples.smoke_repo_flow python -m samples.smoke_snapshot_flow - name: Run Java spec conformance smoke tests + env: + GIT_TESTKIT_CLI: ./git-testkit-cli run: | cd testkit/java mvn test - name: Run Java sample smoke implementations + env: + GIT_TESTKIT_CLI: ./git-testkit-cli run: | cd testkit/java mvn -Dtest=SampleRepoFlowSmoke,SampleSnapshotFlowSmoke test diff --git a/testkit/README.md b/testkit/README.md index f6868de..3e0e6b5 100644 --- a/testkit/README.md +++ b/testkit/README.md @@ -24,7 +24,7 @@ Use existing smoke tests as the executable conformance path: - Python: `cd testkit/python && python3 -m pytest tests/ -v` - Java: `cd testkit/java && mvn test` -- Go regression: from repository root, run `go test ./...` +- Go regression: from the repository root (the directory containing `go.mod`), run `go test ./...` ### CI/CD wiring diff --git a/testkit/ROADMAP.md b/testkit/ROADMAP.md index 4d85961..fc810b2 100644 --- a/testkit/ROADMAP.md +++ b/testkit/ROADMAP.md @@ -17,7 +17,7 @@ Deliverables: 1. Keep existing Go `testing.T` APIs for backward compatibility. 2. Add reusable error-returning Go APIs that do not depend on `testing.T`. -3. Add CLI binary (`cmd/git-testkit-cli`) with JSON request/response protocol. +3. Add CLI binary at `cmd/git-testkit-cli` (canonical Go entrypoint; not a separate `testkit/cli` tree) with JSON request/response protocol. 4. Add Python and Java thin wrappers that shell out to the CLI. 5. Add smoke tests proving fixture -> scenario-like flow -> snapshot round-trip. 6. Add spec-kit artifact set under `.specify/`: diff --git a/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java b/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java index faba401..2157480 100644 --- a/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java +++ b/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java @@ -254,7 +254,7 @@ public String runGitCmd(String repoPath, String... args) { } payload.append("]}"); String json = invoke(payload.toString()); - if (!json.contains("\"output\"")) { + if (!OUTPUT_PATTERN.matcher(json).find()) { throw new IllegalStateException("missing output in bridge response: " + json); } return extractRequired(json, OUTPUT_PATTERN, "output"); From 6dcfac66829182d523b77d3eb08520a191cde330 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 16 Apr 2026 08:01:18 +0000 Subject: [PATCH 2/2] CliBridge: drop redundant OUTPUT_PATTERN pre-check in runGitCmd extractRequired already fails with a clear message when output is missing; matches getCurrentSha/getBranches style (CodeRabbit review). Co-authored-by: Ben Schellenberger --- testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java b/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java index 2157480..a6819b0 100644 --- a/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java +++ b/testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java @@ -254,9 +254,6 @@ public String runGitCmd(String repoPath, String... args) { } payload.append("]}"); String json = invoke(payload.toString()); - if (!OUTPUT_PATTERN.matcher(json).find()) { - throw new IllegalStateException("missing output in bridge response: " + json); - } return extractRequired(json, OUTPUT_PATTERN, "output"); }