Skip to content

Add vector set integration tests#6295

Merged
dantovska merged 7 commits into
mainfrom
test/vector-set-integration-tests
Jul 27, 2026
Merged

Add vector set integration tests#6295
dantovska merged 7 commits into
mainfrom
test/vector-set-integration-tests

Conversation

@dantovska

@dantovska dantovska commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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 elements
  • POST /databases/:id/vector-set/get-elements — listing elements
  • DELETE /databases/:id/vector-set/elements — removing elements
  • POST /databases/:id/vector-set/similarity-search — VSIM query + query-shape validation

Each endpoint is its own commit. The tests follow the existing test/api/array/ conventions (the deps harness, validateApiCall/getMainCheckFn, Joi response schemas, requirements('rte.version>=8.0') gating, per-test truncate).

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 on rte.version>=8.0 and seed keys via Redis VADD/VCARD.

CI tagging: .mocharc.cjs gains a vectorSet tag mapped to test/api/vector-set/**/*.test.ts, with docs noting comma-separated TEST_TAGS. The oss-st-8 docker-compose run sets TEST_TAGS: array,vectorSet so 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.

dantovska and others added 5 commits July 27, 2026 09:54
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>
@dantovska
dantovska requested a review from a team as a code owner July 27, 2026 07:48
@dantovska dantovska self-assigned this Jul 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread redisinsight/api/test/api/vector-set/POST-databases-id-vector-set.test.ts Outdated
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 93.15% 16525/17741
🟡 Branches 75.37% 5303/7036
🟢 Functions 87.46% 2532/2895
🟢 Lines 93% 15802/16991

Test suite run success

3721 tests passing in 322 suites.

Report generated by 🧪jest coverage report action from 43b1109

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.91% 18361/22977
🟡 Branches 62.22% 8553/13745
🟡 Functions 67.93% 2498/3677
🟡 Lines 79.53% 17291/21741

@dantovska dantovska changed the title test(api): add vector set integration tests Add vector set integration tests Jul 27, 2026
dantovska and others added 2 commits July 27, 2026 13:10
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>
@dantovska
dantovska merged commit 4de64c2 into main Jul 27, 2026
29 checks passed
@dantovska
dantovska deleted the test/vector-set-integration-tests branch July 27, 2026 12:12
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