Skip to content

test(kernel): add coverage for vector, idempotency, marketplace#37

Merged
akromicc merged 2 commits intomainfrom
feat/tests-vector-idempotency-marketplace
Apr 30, 2026
Merged

test(kernel): add coverage for vector, idempotency, marketplace#37
akromicc merged 2 commits intomainfrom
feat/tests-vector-idempotency-marketplace

Conversation

@akromicc
Copy link
Copy Markdown
Contributor

Summary

Adds unit + integration test coverage for three previously untested kernel modules:

  • vector (embedder.go, pgstore.go) — RemoteEmbedder HTTP client (httptest), PGStore SQL-build verification via gorm DryRun + sqlmock, applyFilter for nil/flat/must-match/must-has_id/default-branch shapes.
  • idempotency (middleware.go, store.go) — already had decent coverage; left untouched.
  • marketplace (handler.go) — Fiber v3 HTTP handler tests for lite/full install flow, validation, auth, org-isolated list, bundle-download error paths.

Coverage

Module Coverage
vector 82.6%
idempotency 94.0% (pre-existing)
marketplace 74.7%

All three exceed the 70% target. Run with GOWORK=off go test ./vector/... ./idempotency/... ./marketplace/... -cover.

Notes

  • Adds github.com/DATA-DOG/go-sqlmock v1.5.2 as a direct test dep. Used to construct gorm sessions without a real Postgres, while still exercising pgvector typed values via DryRun statement capture.
  • No production-code changes — handlers and services were correct as-is. No bugs found.
  • Marketplace response envelope {success, data} confirmed against SDK consumer in examples/fullstack-starter/frontend/src/routes/_authenticated/route.tsx (addonsRes.value.data?.data). Tests assert the envelope explicitly.

Test plan

  • CI runs go test ./... green
  • go test ./vector/... ./idempotency/... ./marketplace/... -cover locally
  • No regression in existing auth/dynamic/installer suites

Covers RemoteEmbedder happy path, non-2xx, malformed JSON, empty embedding,
8000-char truncation, batch partial-failure log-and-continue, env-driven
defaults. PGStore tests use gorm DryRun + sqlmock so applyFilter, Search,
UpsertPoints, DeletePoints and EnsureCollection are exercised without a
live Postgres+pgvector. Adds DATA-DOG/go-sqlmock as a direct dependency.
@akromicc akromicc merged commit c3dbf12 into main Apr 30, 2026
1 check passed
@akromicc akromicc deleted the feat/tests-vector-idempotency-marketplace branch April 30, 2026 02:27
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