Skip to content

Commit 0993b45

Browse files
testkit: OUTPUT_PATTERN guard; prebuilt CLI for spec-kit CI (#7)
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary - **CliBridge**: `runGitCmd` uses `extractRequired(json, OUTPUT_PATTERN, "output")` only, consistent with `getCurrentSha` / `getBranches` (no redundant pre-check; per CodeRabbit review). - **CI (`spec-kit-conformance`)**: After `go build ./cmd/git-testkit-cli`, Python and Maven steps set `GIT_TESTKIT_CLI=./git-testkit-cli` so wrappers invoke the prebuilt binary instead of `go run` on every subprocess. - **Docs**: `testkit/README.md` describes the Go regression root as the directory containing `go.mod` (avoids implying a fixed path like `/workspace`). `testkit/ROADMAP.md` spells out that the CLI lives under `cmd/git-testkit-cli`, not a separate `testkit/cli` tree. ## Notes On current `main`, `invoke()` already uses `OK_PATTERN` for the `ok` field; the `wrapper-cross-platform` job already builds the CLI and sets `GIT_TESTKIT_CLI`. There is no `GitTestKitCLI` alias in `cli.py` anymore. ## Testing - `go test -short ./...` (Java/Maven not available in this environment). <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-0292fb44-cedd-46e2-ba47-4395056bc137"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-0292fb44-cedd-46e2-ba47-4395056bc137"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified command execution instructions for repository setup. * Updated project roadmap specifications. * **Chores** * Enhanced continuous integration workflow configuration. * **Refactor** * Improved validation logic for better reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
1 parent fc792bb commit 0993b45

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,29 @@ jobs:
4545
cache: maven
4646

4747
- name: Run Python spec conformance smoke tests
48+
env:
49+
GIT_TESTKIT_CLI: ./git-testkit-cli
4850
run: |
4951
cd testkit/python
5052
python -m pip install -e ".[dev]"
5153
python -m pytest tests/ -v
5254
- name: Run Python sample smoke implementations
55+
env:
56+
GIT_TESTKIT_CLI: ./git-testkit-cli
5357
run: |
5458
cd testkit/python
5559
python -m samples.smoke_repo_flow
5660
python -m samples.smoke_snapshot_flow
5761
5862
- name: Run Java spec conformance smoke tests
63+
env:
64+
GIT_TESTKIT_CLI: ./git-testkit-cli
5965
run: |
6066
cd testkit/java
6167
mvn test
6268
- name: Run Java sample smoke implementations
69+
env:
70+
GIT_TESTKIT_CLI: ./git-testkit-cli
6371
run: |
6472
cd testkit/java
6573
mvn -Dtest=SampleRepoFlowSmoke,SampleSnapshotFlowSmoke test

‎testkit/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Use existing smoke tests as the executable conformance path:
2424

2525
- Python: `cd testkit/python && python3 -m pytest tests/ -v`
2626
- Java: `cd testkit/java && mvn test`
27-
- Go regression: from repository root, run `go test ./...`
27+
- Go regression: from the repository root (the directory containing `go.mod`), run `go test ./...`
2828

2929
### CI/CD wiring
3030

‎testkit/ROADMAP.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Deliverables:
1717

1818
1. Keep existing Go `testing.T` APIs for backward compatibility.
1919
2. Add reusable error-returning Go APIs that do not depend on `testing.T`.
20-
3. Add CLI binary (`cmd/git-testkit-cli`) with JSON request/response protocol.
20+
3. Add CLI binary at `cmd/git-testkit-cli` (canonical Go entrypoint; not a separate `testkit/cli` tree) with JSON request/response protocol.
2121
4. Add Python and Java thin wrappers that shell out to the CLI.
2222
5. Add smoke tests proving fixture -> scenario-like flow -> snapshot round-trip.
2323
6. Add spec-kit artifact set under `.specify/`:

‎testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,6 @@ public String runGitCmd(String repoPath, String... args) {
254254
}
255255
payload.append("]}");
256256
String json = invoke(payload.toString());
257-
if (!json.contains("\"output\"")) {
258-
throw new IllegalStateException("missing output in bridge response: " + json);
259-
}
260257
return extractRequired(json, OUTPUT_PATTERN, "output");
261258
}
262259

0 commit comments

Comments
 (0)