feat: added support for testable containers#35
Merged
Conversation
- Introduce TestableCortecMongodb for integration testing - Update config and typings for testable MongoDB usage - Add testcontainers as a dev dependency - Improve Redis testable module logging - Update test suite to use testable MongoDB and Redis - Adjust tsconfig for Node16 module resolution
Add testable OpenSearch container for integration testing
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.
This pull request introduces support for "testable" modules for MongoDB, OpenSearch, RabbitMQ, and Redis, enabling easy integration testing with disposable containerized services via Testcontainers. It also refactors configuration schemas for these modules to use Zod validation and exposes new entrypoints for testable variants in their respective packages. These changes improve testability, configuration safety, and developer experience.
Testable module support and containerized testing:
testable.tsmodules for MongoDB, OpenSearch, RabbitMQ, and Redis, allowing each service to be spun up in a disposable container for integration tests using Testcontainers. These modules override connection details at runtime, simplifying test setup. [1] [2] [3]README.md) for Redis to describe usage ofTestableCortecRedisfor integration testing.Configuration schema refactoring:
DBConfigSchemaandRedisConfigSchema), replacing previous untyped config access. [1] [2]rejectUnauthorizedfor OpenSearch SSL, and making config properties protected for easier extension. [1] [2] [3] [4]Package exports and dependencies:
package.jsonfiles for all four modules to export new testable entrypoints and addedtestcontainersas a dev dependency, along with necessary type dependencies. [1] [2] [3] [4] [5] [6]Redis cluster and retry logic improvements:
OpenSearch SSL options:
rejectUnauthorizedin OpenSearch SSL configuration, and ensured this option is correctly passed to the client. [1] [2] [3]Let me know if you want to see how to use any of these testable modules in your own tests!