Skip to content

[Hackathon] Add "test export" / "test import" to round-trip test DEFINITIONS for version control #125

Description

@Andy00L

Discord Username / User ID

interferon0

What does this improvement do?

There is no way to get a test's definition out of (or back into) TestSprite as a file, so test definitions cannot be version-controlled, reviewed in PRs, backed up, or migrated — the tests-as-code model that made Checkly and Terraform sticky. Add test export [--out ]: compose the existing GET /tests/{id} (metadata) + GET /tests/{id}/code into one deterministic .testsprite.json (stable key order, a schemaVersion, and the codeVersion recorded as provenance). Add test import : create (POST /tests) or update (PUT /tests/{id} + PUT .../code, honoring the existing codeVersion optimistic-concurrency guard) from that file. Note: this is DEFINITION export, distinct from the filed JUnit RESULTS export (#95) — different artifact, different purpose.

Details / implementation notes

Honest limitation disclosed up front: backend tests round-trip losslessly (metadata + Python code), but a frontend test's authored planSteps[] is write-only on the wire (PUT /tests/{id}/plan-steps exists; there is no GET, and GET /tests/{id} returns only planStepCount) — so FE export carries metadata + generated code with an explicit planUnavailable: true marker instead of silently dropping the plan. If that gap matters to reviewers, v1 can be scoped to backend tests. Reuses the existing create/update/code-put request shapes and idempotency-key minting; file writes honor the existing --out safety guards. No new dependency. Natural follow-up (separate issue): a declarative sync

reconcile. PR to follow once assigned.

Confirmations

  • I have searched existing issues and this is not a duplicate.
  • I have provided my Discord identity above for reward coordination.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

acceptedTriaged and accepted — a PR for this will be reviewedhackathonCLI hackathon submissionsin-progressAssigned and actively being worked on

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions