[WIP] feat(test-utils): add testAllAuto method for automatic cluster test generation #3148
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.
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 calltestWithCluster()separately with hand-crafted cluster config, or usetestAll()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 atclusterConfigurationlevel andclusterConfiguration.defaultsrespectively.Example usage:
Before:
After:
Changes:
testAllAuto()method in packages/test-utils/lib/index.tsDescription
Checklist
npm testpass with this change (including linting)?