Skip to content

feat: OpenAPI coverage, test generation, and spec diff/impact analysis - #54

Merged
testsmith-io merged 2 commits into
mainfrom
ui-changes
Sep 5, 2026
Merged

feat: OpenAPI coverage, test generation, and spec diff/impact analysis#54
testsmith-io merged 2 commits into
mainfrom
ui-changes

Conversation

@testsmith-io

Copy link
Copy Markdown
Owner

Add three linked capabilities on top of the existing contract testing, each with a pure shared engine, a CLI command, and a UI surface.

Coverage (src/shared/coverage.ts, cli/coverage.ts)

  • Map an OpenAPI 3.x spec's operations to workspace requests: operations tested, declared response codes covered, negative tests, never-tested ops.
  • Run-aware: --runs <report.json> (CLI) and in-app request history credit response codes and response-schema properties actually seen.
  • api-spector coverage --fail-under <pct> gates CI; Coverage panel in the app.

Test generation (src/shared/openapi-testgen.ts, cli/generate-tests.ts)

  • Generate happy-path (with response-schema assertion), negative, and boundary tests from a spec; schema-aware value sampling; $ref resolution.
  • api-spector generate-tests [--untested-only]; "Generate tests for N gaps" in the Coverage panel adds them as a collection.

API diff & impact (src/shared/openapi-diff.ts, cli/compare.ts)

  • Classify changes between two specs as breaking/non-breaking (removed op, new required field, type change, dropped response field, required param).
  • api-spector compare old new --workspace maps breaking changes to the tests they affect and gives a deploy verdict; --fail-on-breaking gates CI.
  • Compare panel in the app.

Also: coverage:loadSpec IPC + preload bridge, addCollectionObject store action, settings.coverageSpec, and reference docs (coverage, test-generation, api-diff). Adds coverage/openapi-testgen/openapi-diff test suites.

Add three linked capabilities on top of the existing contract testing,
each with a pure shared engine, a CLI command, and a UI surface.

Coverage (src/shared/coverage.ts, cli/coverage.ts)
- Map an OpenAPI 3.x spec's operations to workspace requests: operations
  tested, declared response codes covered, negative tests, never-tested ops.
- Run-aware: `--runs <report.json>` (CLI) and in-app request history credit
  response codes and response-schema properties actually seen.
- `api-spector coverage --fail-under <pct>` gates CI; Coverage panel in the app.

Test generation (src/shared/openapi-testgen.ts, cli/generate-tests.ts)
- Generate happy-path (with response-schema assertion), negative, and boundary
  tests from a spec; schema-aware value sampling; $ref resolution.
- `api-spector generate-tests [--untested-only]`; "Generate tests for N gaps"
  in the Coverage panel adds them as a collection.

API diff & impact (src/shared/openapi-diff.ts, cli/compare.ts)
- Classify changes between two specs as breaking/non-breaking (removed op,
  new required field, type change, dropped response field, required param).
- `api-spector compare old new --workspace` maps breaking changes to the tests
  they affect and gives a deploy verdict; `--fail-on-breaking` gates CI.
- Compare panel in the app.

Also: coverage:loadSpec IPC + preload bridge, addCollectionObject store action,
settings.coverageSpec, and reference docs (coverage, test-generation, api-diff).
Adds coverage/openapi-testgen/openapi-diff test suites.
The bare `coverage` rule (for vitest test-coverage output) also matched the
src/renderer/src/components/Coverage/ folder on case-insensitive filesystems,
so `git add` silently skipped CoverageModal.tsx and it was missing from the
build (App.tsx imports it, CI could not resolve it). Anchor the rule to
/coverage and add the file.
@testsmith-io
testsmith-io merged commit 44bbe46 into main Sep 5, 2026
4 checks passed
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.

2 participants