Commit 1dee8de
authored
feat(test-utils): add testAllAuto method for automatic cluster test generation (#3148)
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 example1 parent a64134c commit 1dee8de
File tree
2 files changed
+62
-9
lines changed- packages
- search/lib/commands
- test-utils/lib
2 files changed
+62
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
487 | 485 | | |
488 | 486 | | |
489 | 487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
593 | 648 | | |
594 | 649 | | |
595 | 650 | | |
| |||
0 commit comments