Passing parameters from maven pre-integration-test phase to integration-test phase
In my project I am using failsafe for integration testing. I have 10 separate applications within one project (that operate within the same domain and therefore are joined in one project). Each application has its own integration test. All integration tests require 3 testcontainers. Each application uses a SparkSession, of which only one may exist at a time. They all have different configurations for their StreamingContext. Each test takes about 5 minutes running on our source repository pipeline runner, so that’s about 50 minutes to complete. I’m trying to parallelize the integration tests and tried different things. When using multiple threads within the same JVM applications crash because only one streamingContext is used (which is the wrong one for 9 out of 10 applications). When using the forkCount setting in the failsafe configuration, a separate JVM is created for each Integration Test. Which also means I get 40 docker containers which makes my machine run out of memory real quick. My idea was to write a prehook to startup the containers (without Ryuk manager) and a posthook to kill them. In the integration tests, I can then use the docker http api to connect to the containers. My question is, how can I pass the portnumbers en container names from my prehook to the integration-test phase and to the posthook? I can’t used fixed portnumbers and fixed names because that will give docker issues when running multiple pipelines simultaneously in our source repository.