-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for TestContainers (pgsql + redis modules)
Add support for TestContainers to make it easy to set up independent test environments to allow running tests in parallel without risk of cross-contamination even if they touch the DB. TestContainers support is behind the `test-containers` flag. When the flag is enabled, the consumer can enable TestContainers for the DB and Sidekiq Redis in the `AppConfig`, in which case a TestContainer instance will be create when building the `AppContext`, and the URI in the `AppConfig` will be updated to match that of the TestContainer instance. Additionally, a new method was added to `AppConfig` to allow consumers to create it themselves. This would allow consumers more control over the config, including manually creating a TestContainer instance and updating the URI of a field in the `AppConfig` before loading the application. Finally, a new `app::init_state` method was added to allow getting access to a real `AppState` instance in tests. This method performs most of the setup of the app without actually running the app. This is similar but slightly different to the existing `app::prepare` method, and is intended to only be used in tests. Closes #500
- Loading branch information
1 parent
357042a
commit c6520a2
Showing
8 changed files
with
380 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.