Add vector set integration tests#6295
Conversation
Covers POST /databases/:id/vector-set: happy-path creation from numeric values, TTL, empty-elements validation, 409 on existing key, and 404 for an unknown instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Covers PUT /databases/:id/vector-set: appending elements to an existing set, plus 404 for an unknown key and an unknown instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Covers POST /databases/:id/vector-set/get-elements: listing elements with response-schema validation, plus 404 for an unknown key and an unknown instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Covers DELETE /databases/:id/vector-set/elements: removing elements with the affected-count assertion, plus 404 for an unknown key and an unknown instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Covers POST /databases/:id/vector-set/similarity-search: an element-name query with descending-score ordering, under/over-specified query rejection (400), and 404 for an unknown key and an unknown instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1c5c464f6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b1c5c46. Configure here.
Code Coverage - Backend unit tests
Test suite run success3721 tests passing in 322 suites. Report generated by 🧪jest coverage report action from 43b1109 |
Code Coverage - Integration Tests
|
The oss-st-8 RTE is the only version-pinned CI job that satisfies the vector-set suites' `rte.version>=8.0` gate, but it sets TEST_TAGS=array so .mocharc.cjs loaded only the array specs — leaving the new vector-set suites unexercised in CI. Add a `vectorSet` tag glob and opt the job into it via TEST_TAGS=array,vectorSet. Vector sets are a core Redis 8.0+ type, so redis:8.8-alpine runs them without any modules. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
createCheckFn was a 1:1 behavioural duplicate of the shared getMainCheckFn (the array/hash variants add a 201 key-non-existence precondition that this copy omitted). Use mainCheckFn directly and remove the local helper and its interface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

What
Adds API integration tests for the vector-set browser feature, which shipped without integration coverage. Covers the core endpoints:
POST /databases/:id/vector-set— creation (values, TTL, validation, 409 conflict)PUT /databases/:id/vector-set— adding elementsPOST /databases/:id/vector-set/get-elements— listing elementsDELETE /databases/:id/vector-set/elements— removing elementsPOST /databases/:id/vector-set/similarity-search— VSIM query + query-shape validationEach endpoint is its own commit. The tests follow the existing
test/api/array/conventions (thedepsharness,validateApiCall/getMainCheckFn, Joi response schemas,requirements('rte.version>=8.0')gating, per-testtruncate).Testing
Requires a Redis 8.0+ RTE (tests self-skip on older versions). From
redisinsight/api:npm run test:api -- 'test/api/vector-set/**/*.test.ts'Note
Low Risk
Test-only changes and mocha/RTE configuration; no production API or runtime behavior is modified.
Overview
Adds API integration tests for the vector-set browser endpoints that previously shipped without this coverage, using the same harness as
test/api/array/.New suites under
test/api/vector-set/exercise create (POST), add elements (PUT), list (POST …/get-elements), delete members (DELETE …/elements), and similarity search (POST …/similarity-search), including happy paths, Joi response shapes, validation (empty elements, similarity query shape), and 404/409 errors. Tests gate onrte.version>=8.0and seed keys via RedisVADD/VCARD.CI tagging:
.mocharc.cjsgains avectorSettag mapped totest/api/vector-set/**/*.test.ts, with docs noting comma-separatedTEST_TAGS. The oss-st-8 docker-compose run setsTEST_TAGS: array,vectorSetso Redis 8.8-alpine runs array + vector-set suites without unrelated failing specs.Reviewed by Cursor Bugbot for commit 43b1109. Bugbot is set up for automated code reviews on this repo. Configure here.