Skip to content

Commit

Permalink
[ST] Remove rest of the Zookeeper occurences from STs, together with …
Browse files Browse the repository at this point in the history
…other unused code (UTO, NodePools/KRaft checks) (strimzi#11041)

Signed-off-by: Lukas Kral <lukywill16@gmail.com>
  • Loading branch information
im-konge authored Jan 17, 2025
1 parent 13cfebc commit c1b20f7
Show file tree
Hide file tree
Showing 85 changed files with 1,016 additions and 2,177 deletions.
7 changes: 2 additions & 5 deletions development-docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ Moreover, you should always use `Templates` classes for pre-defined resources.
For instance, when one want deploy Kafka cluster with tree nodes it can be simply done by following code:
```java
final int numberOfKafkaBrokers = 3;
final int numberOfZooKeeperNodes = 1;

resourceManager.createResourceWithWait(extensionContext,
// using KafkaTemplate class for pre-defined values
KafkaTemplates.kafkaEphemeral(
KafkaTemplates.kafka(
clusterName,
numberOfKafkaBrokers,
numberOfZooKeeperNodes).build()
numberOfKafkaBrokers).build()
);
```

Expand Down Expand Up @@ -318,7 +316,6 @@ All environment variables are defined in [Environment](systemtest/src/main/java/
| STRIMZI_FEATURE_GATES | Strimzi feature gates | empty |
| STRIMZI_LOG_LEVEL | Log level for the cluster operator | DEBUG |
| STRIMZI_COMPONENTS_LOG_LEVEL | Log level for the components | INFO |
| STRIMZI_USE_KRAFT_IN_TESTS | Enable kraft mode | false |
| KUBERNETES_DOMAIN | Cluster domain | .nip.io |
| TEST_CLUSTER_CONTEXT | context which will be used to reach the cluster* | currently active Kubernetes context |
| TEST_CLUSTER_USER | Default user which will be used for command-line admin operations | developer |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
| Step | Action | Result |
| - | - | - |
| 1. | Deploy a Kafka cluster with specified inline logging configurations and GC logging enabled. | Kafka cluster is deployed successfully with correct log and GC settings. |
| 2. | Check Kafka and Zookeeper (if ZK mode) logging levels in the generated ConfigMaps. | Logging levels match the expected configuration. |
| 3. | Verify that GC logging is enabled in Kafka, Zookeeper, and Entity Operator components. | GC logging is confirmed to be enabled. |
| 2. | Check Kafka logging levels in the generated ConfigMaps. | Logging levels match the expected configuration. |
| 3. | Verify that GC logging is enabled in Kafka and Entity Operator components. | GC logging is confirmed to be enabled. |
| 4. | Change JVM options to disable GC logging. | Kafka resources are updated to disable GC logging. |
| 5. | Wait for rolling updates (if any) and verify that GC logging is disabled. | No unexpected rolling updates occur, and GC logging is now disabled. |
| 6. | Ensure that the changes do not break logging hierarchy or default loggers. | Logging functions normally and retains specified levels. |
Expand Down
38 changes: 0 additions & 38 deletions systemtest/src/main/java/io/strimzi/systemtest/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.fabric8.kubernetes.api.model.Service;
import io.strimzi.systemtest.enums.ClusterOperatorInstallType;
import io.strimzi.systemtest.enums.NodePoolsRoleMode;
import io.strimzi.systemtest.utils.TestKafkaVersion;
import io.strimzi.test.TestUtils;
import io.strimzi.test.k8s.KubeClusterResource;
Expand Down Expand Up @@ -139,21 +138,6 @@ public class Environment {
*/
public static final String STRIMZI_FEATURE_GATES_ENV = "STRIMZI_FEATURE_GATES";

/**
* Controls whether tests should run with KRaft or not
*/
public static final String STRIMZI_USE_KRAFT_IN_TESTS_ENV = "STRIMZI_USE_KRAFT_IN_TESTS";

/**
* Controls whether tests should run with KafkaNodePools or not
*/
public static final String STRIMZI_USE_NODE_POOLS_IN_TESTS_ENV = "STRIMZI_USE_NODE_POOLS_IN_TESTS";

/**
* Switch for changing NodePool roles in STs - separate roles or mixed roles
*/
public static final String STRIMZI_NODE_POOLS_ROLE_MODE_ENV = "STRIMZI_NODE_POOLS_ROLE_MODE";

/**
* CO PodSet-only reconciliation env variable <br>
* Only SPS will be reconciled, when this env variable will be true
Expand Down Expand Up @@ -236,9 +220,6 @@ public class Environment {
public static final boolean SKIP_TEARDOWN = getOrDefault(SKIP_TEARDOWN_ENV, Boolean::parseBoolean, false);
public static final String STRIMZI_RBAC_SCOPE = getOrDefault(STRIMZI_RBAC_SCOPE_ENV, STRIMZI_RBAC_SCOPE_DEFAULT);
public static final String STRIMZI_FEATURE_GATES = getOrDefault(STRIMZI_FEATURE_GATES_ENV, STRIMZI_FEATURE_GATES_DEFAULT);
public static final boolean STRIMZI_USE_KRAFT_IN_TESTS = getOrDefault(STRIMZI_USE_KRAFT_IN_TESTS_ENV, Boolean::parseBoolean, true);
public static final boolean STRIMZI_USE_NODE_POOLS_IN_TESTS = getOrDefault(STRIMZI_USE_NODE_POOLS_IN_TESTS_ENV, Boolean::parseBoolean, true);
public static final NodePoolsRoleMode STRIMZI_NODE_POOLS_ROLE_MODE = getOrDefault(STRIMZI_NODE_POOLS_ROLE_MODE_ENV, value -> NodePoolsRoleMode.valueOf(value.toUpperCase(Locale.ENGLISH)), NodePoolsRoleMode.SEPARATE);

// variables for kafka client app images
private static final String TEST_CLIENTS_VERSION = getOrDefault(TEST_CLIENTS_VERSION_ENV, TEST_CLIENTS_VERSION_DEFAULT);
Expand Down Expand Up @@ -308,25 +289,6 @@ public static boolean isNamespaceRbacScope() {
return STRIMZI_RBAC_SCOPE_NAMESPACE.equals(STRIMZI_RBAC_SCOPE);
}

/**
* Determine wheter KRaft mode of Kafka cluster is enabled in Cluster Operator or not.
* @return true if KRaft mode is enabled, otherwise false
*/
public static boolean isKRaftModeEnabled() {
return STRIMZI_USE_KRAFT_IN_TESTS;
}

public static boolean isKafkaNodePoolsEnabled() {
return STRIMZI_USE_NODE_POOLS_IN_TESTS;
}

/**
* Determine whether separate roles mode for KafkaNodePools is used or not
*/
public static boolean isSeparateRolesMode() {
return STRIMZI_NODE_POOLS_ROLE_MODE.equals(NodePoolsRoleMode.SEPARATE);
}

/**
* Provides boolean information, if testing environment support shared memory (i.e., environment, where all
* components share memory). In general, we use {@link Environment#RESOURCE_ALLOCATION_STRATEGY_DEFAULT} if env {@link Environment#RESOURCE_ALLOCATION_STRATEGY_ENV}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ enum LogIgnoreList {
ASSEMBLY_OPERATOR_RECONCILIATION_TIMEOUT("ERROR .*AssemblyOperator:[0-9]+ - Reconciliation.*[fF]ailed.*"),
WATCHER_CLOSED_EXCEPTION("ERROR AbstractOperator:.+ - Watcher closed with exception in namespace .*"),
CONCURRENT_RESOURCE_DELETION("io.strimzi.operator.cluster.operator.resource.ConcurrentDeletionException"),
RECOVERY_STS_DELETION("java\\.lang\\.IllegalStateException: Can't wait for StatefulSet: recovery-cluster-(kafka|zookeeper) in namespace: recovery-cluster-test to scale. Resource is no longer available."),

// error that Pods already exist when doing reconciliation of StrimziPodSets
// connected to https://github.com/strimzi/strimzi-kafka-operator/issues/7529 - remove this once the issue will be fixed
Expand All @@ -91,10 +90,7 @@ enum LogIgnoreList {
"Status updated to \\[NotReady\\] due to error"),
LEASE_LOCK_EXISTS("LeaderElector:.*Exception occurred while acquiring lock 'LeaseLock.*" +
"KubernetesClientException: Failure executing: POST at.*already exists.*"),
ZOOKEEPER_DNS_ERROR("Unable to resolve address:.*zookeeper.*java.net.UnknownHostException.*"),
LOGGER_DOES_NOT_EXISTS("Logger paprika does not exist"),
// This exception is logged on DEBUG level of the operator, however it is hit when logging is to JSON format where it is hard whitelist without this
ZOOKEEPER_END_OF_STREAM("org.apache.zookeeper.ClientCnxn\\$EndOfStreamException"),
// This is expected failure in some cases, so we can whitelist it
REBALANCE_NON_JBOD("Status updated to \\[NotReady\\] due to error: Cannot set rebalanceDisk=true for Kafka clusters with a non-JBOD storage config"),
RECONCILIATION_UPDATE_BROKER_ERROR("Reconciliation.*Error updating broker configuration");
Expand Down

This file was deleted.

Loading

0 comments on commit c1b20f7

Please sign in to comment.