feat(test-utils): add testAllAuto method for automatic cluster test generation by bobymicroby · Pull Request #3148 · redis/node-redis
changed the title
feat(test-utils): add testAllAuto method for automatic cluster test generation
[WIP] feat(test-utils): add testAllAuto method for automatic cluster test generation
…eneration
Created a new `testAllAuto()` helper method in the test-utils package that automatically runs tests against both
single-node and cluster instances with auto-generated cluster configuration from client configuration.
Previously, tests only ran against single-node clients using `testWithClient()`. To test both scenarios, developers had
to either manually call `testWithCluster()` separately with hand-crafted cluster config, or use `testAll()` with both
client and cluster configurations defined.
The new `testAllAuto()` method converts client configuration to cluster configuration by separating cluster-level
properties (`modules`, `functions`, `scripts`) from client-level properties (`password`, `socket`, etc.), placing them
at `clusterConfiguration` level and `clusterConfiguration.defaults` respectively.
Example usage:
Before:
```
testUtils.testWithClient('client.ft.aggregate', async client => {...}, GLOBAL.SERVERS.OPEN)
```
After:
```
testUtils.testAllAuto('client.ft.aggregate', async client => {...}, GLOBAL.SERVERS.OPEN)
```
Changes:
- Added `testAllAuto()` method in packages/test-utils/lib/index.ts
- Updated AGGREGATE.spec.ts to use the new method as example
bobymicroby
changed the title
[WIP] feat(test-utils): add testAllAuto method for automatic cluster test generation
feat(test-utils): add testAllAuto method for automatic cluster test generation
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