Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Junit extension ought to respect the TEST_CLUSTER_EXECUTION_MODE environment variable #153

Open
k-wall opened this issue Jul 20, 2023 · 1 comment
Labels

Comments

@k-wall
Copy link
Contributor

k-wall commented Jul 20, 2023

As a user of the Junit5 annotation, I can use a @BrokerCluster to inject an Kafka cluster into my integration test. If I am opinionated about whether the test runs under a container or in-VM, I can express that using the type of the annotated field/formal parameter (InVMKafkaCluster|TestcontainersKafkaCluster). Sometimes the author of the test has no preference, so use they use KafkaCluster.

When the tests are run, KafkaClusterProvisioningStrategy makes a decision about whether the test case should use an in-VM or containers strategy, based on a number of factors. It is used to decide whether @BrokerCluster KafkaCluster takes the in-VM or container route. Currently it always decides in-VM owing to the estimatedProvisioningTimeMs.

As I user I would value the ability to influence the decision from the outside, possible via an environment variable. We already have TEST_CLUSTER_EXECUTION_MODE defined which is respected by the parts of the API.

@k-wall
Copy link
Contributor Author

k-wall commented Oct 26, 2023

In addition, currently when using the extension, there's no mechanism to override the native images. There are env variables KAFKA_IMAGE_REPO, ZOOKEEPER_IMAGE_REPO but these are applied by the KafkaClusterFactory. The factory isn't used by the strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants