Skip to content

Add Go backend contract test harness (api-contracts)#3643

Draft
zackverham wants to merge 2 commits intomainfrom
zverham/api-contract-tests
Draft

Add Go backend contract test harness (api-contracts)#3643
zackverham wants to merge 2 commits intomainfrom
zverham/api-contract-tests

Conversation

@zackverham
Copy link
Collaborator

Summary

  • Introduces test/api-contracts/ — a contract test suite that validates Publisher API behavior through the Go HTTP backend
  • Covers configurations, credentials, deployments, entrypoints, and inspect endpoints with fixture workspaces for each content type (FastAPI, Shiny, Jupyter, Quarto, R Markdown, static)
  • Uses a BackendClient interface to enable future dual-execution against both Go and TypeScript implementations during migration
  • Adds just test-contracts recipe

Context

Split from #3640 into three focused PRs:

  • This PR: test/api-contracts/ — Publisher API contract tests
  • test/connect-api-contracts/ — Connect API contract tests (separate PR)
  • test/extension-api-contracts/ — Extension API contract tests (separate PR)

Test plan

  • just build && just test-contracts passes
  • Verify all 5 test files cover request correctness, response parsing, and snapshot assertions

🤖 Generated with Claude Code

Introduces a contract test suite in test/api-contracts/ that validates the
Publisher API behavior through the Go HTTP backend. Tests cover
configurations, credentials, deployments, entrypoints, and inspect
endpoints with fixture workspaces for each content type.

The test harness uses a BackendClient interface to enable future
dual-execution against both Go and TypeScript implementations, ensuring
behavioral parity during migration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zackverham zackverham requested a review from a team as a code owner March 3, 2026 21:45
@zackverham zackverham marked this pull request as draft March 4, 2026 15:51
…ls, interpreters, and accounts

Extends the contract test harness from 14 to ~28 endpoint coverage by adding
tests for configuration files/secrets/packages/integration-requests, workspace
files, credential-by-GUID, interpreters, and accounts endpoints.

- Add 15 new methods to BackendClient interface and GoHttpClient implementation
- Add TypeScriptDirectClient stubs for all new methods
- Add "bad_request" (400) to ResultStatus and mapStatus
- Improve toContractResult to handle missing Content-Type headers
- Add seedWorkspaceFile/removeWorkspaceFile helpers
- Add renv.lock fixture for R packages tests
- Create 8 new test files with 31 new test cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zackverham zackverham changed the title Add API contract test harness (api-contracts) Add Go backend contract test harness (api-contracts) Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant