test(kernel): add coverage for vector, idempotency, marketplace#37
Merged
test(kernel): add coverage for vector, idempotency, marketplace#37
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds unit + integration test coverage for three previously untested kernel modules:
embedder.go,pgstore.go) —RemoteEmbedderHTTP client (httptest),PGStoreSQL-build verification via gorm DryRun + sqlmock,applyFilterfor nil/flat/must-match/must-has_id/default-branch shapes.middleware.go,store.go) — already had decent coverage; left untouched.handler.go) — Fiber v3 HTTP handler tests for lite/full install flow, validation, auth, org-isolated list, bundle-download error paths.Coverage
vectoridempotencymarketplaceAll three exceed the 70% target. Run with
GOWORK=off go test ./vector/... ./idempotency/... ./marketplace/... -cover.Notes
github.com/DATA-DOG/go-sqlmock v1.5.2as a direct test dep. Used to construct gorm sessions without a real Postgres, while still exercisingpgvectortyped values via DryRun statement capture.{success, data}confirmed against SDK consumer inexamples/fullstack-starter/frontend/src/routes/_authenticated/route.tsx(addonsRes.value.data?.data). Tests assert the envelope explicitly.Test plan
go test ./...greengo test ./vector/... ./idempotency/... ./marketplace/... -coverlocallyauth/dynamic/installersuites