Add support for multiple init scripts in CassandraContainer - #2720
Add support for multiple init scripts in CassandraContainer#2720sanderploegsma wants to merge 2 commits into
Conversation
|
This looks like it might be a duplicate (subset) of #2578 - have you seen that? |
|
Ah no, that one didn’t come up. It looks like the Cassandra container doesn’t use the mechanism used by the containers in that PR, but it makes sense to check it out. Thanks for bringing it up! |
|
Looking at the PR you mentioned it seems that although we are trying to achieve the same, the JdbcDatabaseContainer and the CassandraContainer don't share much code so unless we want to refactor the bunch to make use of an abstraction, I feel like both PRs are valid. That being said, it of course makes sense to align on the approach we take w.r.t. handling multiple initialization scripts. Looking at #2578 it seems the favoured approach would be to use the following to keep binary compatibility: public SELF withInitScript(String initScriptPath, String... extraInitScriptPaths) { /* ... */ }Initially I chose to support chaining the |
When running multiple test suites against a Cassandra container, it makes sense to split the initialization scripts, so that you can always include a script that creates a keyspace and some tables, and another script per test suite that populates the tables with some test data.
22da92d to
6a39845
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
|
This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case. |
When running multiple test suites against a Cassandra container, it makes sense to split the initialization scripts, so that you can always include a script that creates a keyspace and some tables, and another script per test suite that populates the tables with some test data.
This change allows you to chain the
withInitScriptfunction to load multiple scripts. The order of the chain also determines the order in which the scripts are applied.