Skip to content

Commit

Permalink
[ST] Update test-clients to 0.10.0 after the release (#11090)
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Kral <[email protected]>
  • Loading branch information
im-konge authored Feb 4, 2025
1 parent 0109e45 commit 568645f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ public class Environment {
private static final String RESOURCE_ALLOCATION_STRATEGY_DEFAULT = "SHARE_MEMORY_FOR_ALL_COMPONENTS";

private static final String ST_KAFKA_VERSION_DEFAULT = TestKafkaVersion.getDefaultSupportedKafkaVersion();
private static final String ST_CLIENTS_KAFKA_VERSION_DEFAULT = "3.8.0";
public static final String TEST_CLIENTS_VERSION_DEFAULT = "0.9.1";
private static final String ST_CLIENTS_KAFKA_VERSION_DEFAULT = "3.9.0";
public static final String TEST_CLIENTS_VERSION_DEFAULT = "0.10.0";
public static final String ST_FILE_PLUGIN_URL_DEFAULT = "https://repo1.maven.org/maven2/org/apache/kafka/connect-file/" + ST_KAFKA_VERSION_DEFAULT + "/connect-file-" + ST_KAFKA_VERSION_DEFAULT + ".jar";

public static final String IP_FAMILY_DEFAULT = "ipv4";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class KafkaClients extends BaseClients {
private String caCertSecretName;
private String headers;
private PodSecurityProfile podSecurityPolicy;
private String messagesPerTransaction;

public String getProducerName() {
return producerName;
Expand Down Expand Up @@ -138,6 +139,14 @@ public void setPodSecurityPolicy(final PodSecurityProfile podSecurityPolicy) {
this.podSecurityPolicy = podSecurityPolicy;
}

public void setMessagesPerTransaction(String messagesPerTransaction) {
this.messagesPerTransaction = messagesPerTransaction;
}

public String getMessagesPerTransaction() {
return messagesPerTransaction;
}

public Job producerStrimzi() {
return defaultProducerStrimzi().build();
}
Expand Down Expand Up @@ -278,6 +287,22 @@ public JobBuilder defaultProducerStrimzi() {
.endSpec();
}

if (this.getMessagesPerTransaction() != null) {
builder
.editSpec()
.editTemplate()
.editSpec()
.editFirstContainer()
.addNewEnv()
.withName("MESSAGES_PER_TRANSACTION")
.withValue(this.getMessagesPerTransaction())
.endEnv()
.endContainer()
.endSpec()
.endTemplate()
.endSpec();
}

if (PodSecurityProfile.RESTRICTED == this.podSecurityPolicy) {
this.enableRestrictedProfile(builder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ void testManualTriggeringRollingUpdate() {
final KafkaClients continuousClients = ClientUtils.getContinuousPlainClientBuilder(testStorage)
.withMessageCount(continuousClientsMessageCount)
.withAdditionalConfig(producerAdditionConfiguration)
// TODO: needed because of bug in test-clients - https://github.com/strimzi/test-clients/issues/119
.withMessagesPerTransaction("1")
.build();

resourceManager.createResourceWithWait(continuousClients.producerStrimzi(), continuousClients.consumerStrimzi());
Expand Down Expand Up @@ -362,6 +364,8 @@ void testAddingAndRemovingJbodVolumes() {
KafkaClients kafkaBasicClientJob = ClientUtils.getContinuousPlainClientBuilder(testStorage)
.withMessageCount(continuousClientsMessageCount)
.withAdditionalConfig(producerAdditionConfiguration)
// TODO: needed because of bug in test-clients - https://github.com/strimzi/test-clients/issues/119
.withMessagesPerTransaction("1")
.build();

resourceManager.createResourceWithWait(kafkaBasicClientJob.producerStrimzi(), kafkaBasicClientJob.consumerStrimzi());
Expand Down Expand Up @@ -503,6 +507,8 @@ void testJbodMetadataLogRelocation() {
KafkaClients kafkaBasicClientJob = ClientUtils.getContinuousPlainClientBuilder(testStorage)
.withMessageCount(continuousClientsMessageCount)
.withAdditionalConfig(producerAdditionConfiguration)
// TODO: needed because of bug in test-clients - https://github.com/strimzi/test-clients/issues/119
.withMessagesPerTransaction("1")
.build();

resourceManager.createResourceWithWait(kafkaBasicClientJob.producerStrimzi(), kafkaBasicClientJob.consumerStrimzi());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,7 @@ void testKafkaRackAwareness() {
Pod pod = kubeClient().getPod(testStorage.getNamespaceName(), podName);

resourceManager.createResourceWithWait(
AdminClientTemplates.plainAdminClient(testStorage.getNamespaceName(), testStorage.getAdminName(), KafkaResources.plainBootstrapAddress(testStorage.getClusterName()))
.editSpec()
.editTemplate()
.editSpec()
.editFirstContainer()
// TODO: once new test-clients are released (0.10.0), this should be removed
.withImage("quay.io/strimzi-test-clients/test-clients:latest-kafka-" + Environment.ST_KAFKA_VERSION)
.endContainer()
.endSpec()
.endTemplate()
.endSpec()
.build()
AdminClientTemplates.plainAdminClient(testStorage.getNamespaceName(), testStorage.getAdminName(), KafkaResources.plainBootstrapAddress(testStorage.getClusterName())).build()
);
final AdminClient adminClient = AdminClientUtils.getConfiguredAdminClient(testStorage.getNamespaceName(), testStorage.getAdminName());

Expand Down

0 comments on commit 568645f

Please sign in to comment.