Skip to content

test: run the client command specs against an external Redis Enterprise database#3341

Merged
nkaradzhov merged 5 commits into
redis:masterfrom
kiryazovi-redis:fix/re-endpoints-config
Jul 21, 2026
Merged

test: run the client command specs against an external Redis Enterprise database#3341
nkaradzhov merged 5 commits into
redis:masterfrom
kiryazovi-redis:fix/re-endpoints-config

Conversation

@kiryazovi-redis

@kiryazovi-redis kiryazovi-redis commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

The @redis/client command specs spin up local Docker Redis servers via TestUtils. 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

  • Opt-in endpoint discovery. 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 (the same endpoints-config format already consumed by the scenario tests; RE_DB_NAME selects a named database, default standalone) 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. When RE_CLUSTER is unset, behaviour is unchanged (local Docker servers).
  • packages/client/.mocharc-re.cjs - a documented mocha config that runs lib/commands/**/*.spec.ts and 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_CLUSTER unset 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/client command specs can run against a managed Redis Enterprise endpoint instead of local Docker, without changing default local runs.

TestUtils gains re-cluster.ts, which reads REDIS_ENDPOINTS_CONFIG_PATH (and optional RE_DB_NAME) to resolve host, port, and credentials. testWithClient and testWithClientPool skip 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.cjs is 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.

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

@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

Reviewed by Cursor Bugbot for commit 32c82e9. Configure here.

...options.clientOptions?.socket,
host: loadREConnection().host,
port: loadREConnection().port
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 32c82e9. Configure here.

@nkaradzhov

Copy link
Copy Markdown
Collaborator

Thanks @kiryazovi-redis i will take a look!

@nkaradzhov
nkaradzhov merged commit 7714771 into redis:master Jul 21, 2026
25 of 26 checks passed
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