test: run the client command specs against an external Redis Enterprise database#3341
Merged
nkaradzhov merged 5 commits intoJul 21, 2026
Merged
Conversation
…se database Add opt-in wiring so the @redis/client command specs can target a managed Redis Enterprise database (remote host, auth, optional TLS) without changing the default local run. When RE_CLUSTER=true, the TestUtils harness (testWithClient / testWithClientPool) resolves the target database's host, port, username, password and TLS from REDIS_ENDPOINTS_CONFIG_PATH (RE_DB_NAME selects a named database, default "standalone"; same endpoints format used by the scenario tests) and builds the client against that endpoint instead of spawning a local Docker server. The cluster and sentinel helpers are skipped on RE since a single managed database is not an OSS cluster / sentinel topology. When RE_CLUSTER is unset behaviour is unchanged (local Docker servers). Add packages/client/.mocharc-re.cjs, which runs lib/commands/**/*.spec.ts and ignores the specs that cannot run against a managed Redis Enterprise database, each with a rationale: the AR.* array previews and INCREX, SDIFFCARD/SUNIONCARD and the new XREAD/XREADGROUP options (not yet on the RE server version), HGETEX PERSIST reply shape, the server-admin / persistence commands (CONFIG SET, BGSAVE, BGREWRITEAOF, LASTSAVE, ROLE, SCRIPT DEBUG, LATENCY, MEMORY, HOTKEYS), ACL user management, FUNCTION LIST shape, CLIENT admin behaviour, and cross-DB MOVE/SWAPDB. Verified against a managed Redis Enterprise 8.x database: 1284 passing, 338 pending, 0 failing. This change was prepared with AI assistance and reviewed before submission.
Add VRANGE, XNACK, HELLO and the ZUNION/ZINTER(STORE) AGGREGATE specs to the Redis Enterprise ignore list: they pass on RE 8.8 but are unavailable (or reply differently) on RE 8.0.x, so skip them for consistent behaviour across the RE version matrix. This change was prepared with AI assistance and reviewed before submission.
Widen the ZUNION/ZINTER ignore globs to cover the *_WITHSCORES spec files, whose AGGREGATE option also errors on RE 8.0.x. This change was prepared with AI assistance and reviewed before submission.
Skip XADD (IDMP idempotency options), XCFGSET, and XINFO_STREAM (reply shape) on Redis Enterprise: they are newer than the RE 8.0.x server build and are unavailable or reply differently there, though they pass on RE 8.8. This change was prepared with AI assistance and reviewed before submission.
…t timeouts Add mocha retries to the Redis Enterprise config so occasional connection timeouts against the remote (higher-latency) managed endpoint do not fail the run. Local Docker runs are unaffected. This change was prepared with AI assistance and reviewed before submission.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 32c82e9. Configure here.
| ...options.clientOptions?.socket, | ||
| host: loadREConnection().host, | ||
| port: loadREConnection().port | ||
| } |
There was a problem hiding this comment.
RE TLS flag not applied
High Severity
With RE_CLUSTER=true, loadREConnection() reads tls from the endpoints config, but testWithClient and testWithClientPool only set socket.host and socket.port. TLS-enabled managed databases then get a plain TCP client, so connects fail or hang despite the PR’s advertised TLS support.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 32c82e9. Configure here.
Collaborator
|
Thanks @kiryazovi-redis i will take a look! |
nkaradzhov
approved these changes
Jul 21, 2026
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.


Motivation
The
@redis/clientcommand specs spin up local Docker Redis servers viaTestUtils. This change lets the same specs also run against an external / managed Redis Enterprise database - remote host, authentication, and optional TLS - without changing the existing local behaviour.What changed
RE_CLUSTER=true, theTestUtilsharness (testWithClient/testWithClientPool) resolves the target database's host, port, username, password and TLS fromREDIS_ENDPOINTS_CONFIG_PATH(the same endpoints-config format already consumed by the scenario tests;RE_DB_NAMEselects a named database, defaultstandalone) and builds the client against that endpoint instead of spawning a local Docker server. The cluster and sentinel helpers are skipped, since a single managed database is not an OSS cluster / sentinel topology. WhenRE_CLUSTERis unset, behaviour is unchanged (local Docker servers).packages/client/.mocharc-re.cjs- a documented mocha config that runslib/commands/**/*.spec.tsand ignores the specs that cannot run against a managed Enterprise database, each grouped with a rationale: AR.* / INCREX / vector-set previews, brand-new commands/options not yet on the RE server version (SDIFFCARD, SUNIONCARD, XNACK, XCFGSET, XADD IDMP, XREAD/XREADGROUP options, ZUNION/ZINTER AGGREGATE), reply-shape differences (HELLO, XINFO STREAM, HGETEX PERSIST), server-admin/persistence commands, ACL user management, FUNCTION LIST, CLIENT admin behaviour, and cross-DB MOVE/SWAPDB. It also retries to absorb transient timeouts against the remote endpoint.Validation
Ran the command specs against managed Redis Enterprise: green across RE 8.0.16, 8.0.22 and 100.0.20. Locally: 1284 passing, 338 pending, 0 failing. With
RE_CLUSTERunset the suite still spawns local Docker servers unchanged.This change was prepared with AI assistance and reviewed before submission.
Note
Low Risk
Changes are confined to test harness and CI configuration; production client code and default local Docker test behaviour are unchanged when RE_CLUSTER is unset.
Overview
Adds an opt-in path (
RE_CLUSTER=true) so@redis/clientcommand specs can run against a managed Redis Enterprise endpoint instead of local Docker, without changing default local runs.TestUtils gains
re-cluster.ts, which readsREDIS_ENDPOINTS_CONFIG_PATH(and optionalRE_DB_NAME) to resolve host, port, and credentials.testWithClientandtestWithClientPoolskip Docker spawn in RE mode and connect to that endpoint; cluster and sentinel helpers no longer start Docker on RE and existing skip logic leaves those cases pending.packages/client/.mocharc-re.cjsis a dedicated Mocha config for RE runs: longer timeout, 2 retries for remote flakiness, and a documented ignore list for specs that need OSS-only commands, admin/ACL behaviour, cross-DB ops, or version/reply-shape mismatches on Enterprise.Reviewed by Cursor Bugbot for commit 32c82e9. Bugbot is set up for automated code reviews on this repo. Configure here.