Skip to content

Commit

Permalink
[system test] [doc] Add TestDocsLabels class to remove redundancy (#1…
Browse files Browse the repository at this point in the history
…0633)

Signed-off-by: see-quick <maros.orsak159@gmail.com>
  • Loading branch information
see-quick committed Sep 24, 2024
1 parent a09c20e commit 011f1d0
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright Strimzi authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
package io.strimzi.systemtest.docs;

/**
* Provides documentation labels used in {@link io.skodjob.annotations.SuiteDoc#labels()} or
* {@link io.skodjob.annotations.TestDoc#labels()}.
*/
public interface TestDocsLabels {

String BRIDGE = "bridge";
String CONNECT = "connect";
String CRUISE_CONTROL = "cruise-control";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.strimzi.systemtest.AbstractST;
import io.strimzi.systemtest.TestConstants;
import io.strimzi.systemtest.annotations.ParallelTest;
import io.strimzi.systemtest.docs.TestDocsLabels;
import io.strimzi.systemtest.resources.NodePoolsConverter;
import io.strimzi.systemtest.resources.ResourceManager;
import io.strimzi.systemtest.resources.crd.KafkaBridgeResource;
Expand Down Expand Up @@ -55,7 +56,7 @@
@Step(value = "Deploy required Kafka resources and scraper pod", expected = "Kafka resources and scraper pod are deployed and running")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
public class HttpBridgeCorsST extends AbstractST {
Expand All @@ -79,7 +80,7 @@ public class HttpBridgeCorsST extends AbstractST {
@Step(value = "Check if the GET request response is '404 Not Found'", expected = "Response for GET request is 404 Not Found")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testCorsOriginAllowed() {
Expand Down Expand Up @@ -134,7 +135,7 @@ void testCorsOriginAllowed() {
@Step(value = "Verify the response contains '403' and 'CORS Rejected - Invalid origin'", expected = "Response indicates the CORS request is rejected")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testCorsForbidden() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.strimzi.systemtest.Environment;
import io.strimzi.systemtest.TestConstants;
import io.strimzi.systemtest.annotations.ParallelTest;
import io.strimzi.systemtest.docs.TestDocsLabels;
import io.strimzi.systemtest.kafkaclients.internalClients.BridgeClients;
import io.strimzi.systemtest.kafkaclients.internalClients.BridgeClientsBuilder;
import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClients;
Expand Down Expand Up @@ -72,7 +73,7 @@
@Step(value = "Initialize Test Storage and deploy Kafka and Kafka Bridge", expected = "Kafka and Kafka Bridge are deployed with necessary configuration")
},
labels = {
@Label("bridge"),
@Label(TestDocsLabels.BRIDGE),
}
)
class HttpBridgeST extends AbstractST {
Expand All @@ -95,7 +96,7 @@ class HttpBridgeST extends AbstractST {
@Step(value = "Verify Kafka Bridge service labels", expected = "Labels for Kafka Bridge service are correctly set and verified")
},
labels = {
@Label("bridge"),
@Label(TestDocsLabels.BRIDGE),
}
)
void testSendSimpleMessage() {
Expand Down Expand Up @@ -139,7 +140,7 @@ void testSendSimpleMessage() {
@Step(value = "Verify message reception", expected = "All messages are received by Kafka Bridge consumer client")
},
labels = {
@Label("bridge"),
@Label(TestDocsLabels.BRIDGE),
}
)
void testReceiveSimpleMessage() {
Expand Down Expand Up @@ -181,7 +182,7 @@ void testReceiveSimpleMessage() {
@Step(value = "Verify Kafka Bridge configurations for producer and consumer", expected = "Producer and consumer configurations match the updated settings")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testCustomAndUpdatedValues() {
Expand Down Expand Up @@ -314,7 +315,7 @@ void testDiscoveryAnnotation() {
@Step(value = "Verify the status of KafkaBridge", expected = "KafkaBridge status should indicate it is ready with zero replicas")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testScaleBridgeToZero() {
Expand Down Expand Up @@ -351,7 +352,7 @@ void testScaleBridgeToZero() {
@Step(value = "Check pod naming conventions.", expected = "Pod names should match the naming convention and be consistent.")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testScaleBridgeSubresource() {
Expand Down Expand Up @@ -400,7 +401,7 @@ void testScaleBridgeSubresource() {
@Step(value = "Check that observed generation is 2 and the new label is present", expected = "Observed generation is 2 and label 'another=label' is present")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testConfigureDeploymentStrategy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.strimzi.systemtest.Environment;
import io.strimzi.systemtest.TestConstants;
import io.strimzi.systemtest.annotations.ParallelTest;
import io.strimzi.systemtest.docs.TestDocsLabels;
import io.strimzi.systemtest.kafkaclients.internalClients.BridgeClients;
import io.strimzi.systemtest.kafkaclients.internalClients.BridgeClientsBuilder;
import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClients;
Expand Down Expand Up @@ -57,7 +58,7 @@

},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
class HttpBridgeScramShaST extends AbstractST {
Expand All @@ -78,7 +79,7 @@ class HttpBridgeScramShaST extends AbstractST {
@Step(value = "Wait for consumer success", expected = "Consumer finishes receiving messages without errors")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testSendSimpleMessageTlsScramSha() {
Expand Down Expand Up @@ -114,7 +115,7 @@ void testSendSimpleMessageTlsScramSha() {
@Step(value = "Wait for clients' success validation", expected = "Messages are successfully consumed from the Kafka topic")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testReceiveSimpleMessageTlsScramSha() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.strimzi.systemtest.Environment;
import io.strimzi.systemtest.TestConstants;
import io.strimzi.systemtest.annotations.ParallelTest;
import io.strimzi.systemtest.docs.TestDocsLabels;
import io.strimzi.systemtest.kafkaclients.internalClients.BridgeClients;
import io.strimzi.systemtest.kafkaclients.internalClients.BridgeClientsBuilder;
import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClients;
Expand Down Expand Up @@ -59,7 +60,7 @@
@Step(value = "Deploy HTTP bridge with TLS configuration", expected = "HTTP bridge is deployed with TLS configuration")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
class HttpBridgeTlsST extends AbstractST {
Expand All @@ -79,7 +80,7 @@ class HttpBridgeTlsST extends AbstractST {
@Step(value = "Verify that the consumer successfully receives messages", expected = "Consumer successfully receives the expected number of messages")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testSendSimpleMessageTls() {
Expand Down Expand Up @@ -116,7 +117,7 @@ void testSendSimpleMessageTls() {
@Step(value = "Verify message consumption", expected = "Messages are successfully consumed by the Kafka Bridge consumer.")
},
labels = {
@Label("bridge")
@Label(TestDocsLabels.BRIDGE)
}
)
void testReceiveSimpleMessageTls() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import io.strimzi.systemtest.annotations.MicroShiftNotSupported;
import io.strimzi.systemtest.annotations.OpenShiftOnly;
import io.strimzi.systemtest.annotations.ParallelTest;
import io.strimzi.systemtest.docs.TestDocsLabels;
import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClients;
import io.strimzi.systemtest.resources.NodePoolsConverter;
import io.strimzi.systemtest.resources.ResourceManager;
Expand Down Expand Up @@ -85,7 +86,7 @@
@SuiteDoc(
description = @Desc("Testing Kafka Connect build and plugin management."),
labels = {
@Label(value = "connect"),
@Label(value = TestDocsLabels.CONNECT),
}
)
class ConnectBuilderST extends AbstractST {
Expand Down Expand Up @@ -168,7 +169,7 @@ class ConnectBuilderST extends AbstractST {
@Step(value = "Verify that EchoSink KafkaConnector is listed in Kafka Connect resource status", expected = "EchoSink KafkaConnector is listed in the status of Kafka Connect resource")
},
labels = {
@Label(value = "connect")
@Label(value = TestDocsLabels.CONNECT)
}
)
void testBuildFailsWithWrongChecksumOfArtifact() {
Expand Down Expand Up @@ -254,7 +255,7 @@ void testBuildFailsWithWrongChecksumOfArtifact() {
@Step(value = "Check logs for received message", expected = "Logs contain the expected received message")
},
labels = {
@Label(value = "connect")
@Label(value = TestDocsLabels.CONNECT)
}
)
void testBuildWithJarTgzAndZip() {
Expand Down Expand Up @@ -317,7 +318,7 @@ void testBuildWithJarTgzAndZip() {
@Step(value = "Verify KafkaConnect build artifacts and status", expected = "KafkaConnect has two plugins, uses the image stream output and is in the 'Ready' state")
},
labels = {
@Label(value = "connect")
@Label(value = TestDocsLabels.CONNECT)
}
)
void testPushIntoImageStream() {
Expand Down Expand Up @@ -372,7 +373,7 @@ void testPushIntoImageStream() {
@Step(value = "Verify that both connectors and plugins are present in Kafka Connect", expected = "Both connectors and plugins are verified successfully")
},
labels = {
@Label(value = "connect")
@Label(value = TestDocsLabels.CONNECT)
}
)
void testUpdateConnectWithAnotherPlugin() {
Expand Down Expand Up @@ -479,7 +480,7 @@ void testUpdateConnectWithAnotherPlugin() {
@Step(value = "Verify plugin file name after update using the plugin's hash", expected = "Plugin file name is different from the previous name and matches the hash")
},
labels = {
@Label(value = "connect")
@Label(value = TestDocsLabels.CONNECT)
}
)
void testBuildOtherPluginTypeWithAndWithoutFileName() {
Expand Down Expand Up @@ -552,7 +553,7 @@ void testBuildOtherPluginTypeWithAndWithoutFileName() {
@Step(value = "Verify that consumer receives messages", expected = "Consumer receives the expected messages")
},
labels = {
@Label(value = "connect")
@Label(value = TestDocsLabels.CONNECT)
}
)
void testBuildPluginUsingMavenCoordinatesArtifacts() {
Expand Down
Loading

0 comments on commit 011f1d0

Please sign in to comment.