-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ST] add skip mixed role annotation to ST. (#9743)
Signed-off-by: hzrncik <[email protected]>
- Loading branch information
1 parent
d4d38bc
commit 1575f35
Showing
3 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
systemtest/src/main/java/io/strimzi/systemtest/annotations/MixedRoleNotSupported.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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.annotations; | ||
|
||
import org.junit.jupiter.api.extension.ExtendWith; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@ExtendWith(MixedRoleNotSupportedCondition.class) | ||
public @interface MixedRoleNotSupported { | ||
String value() default "Mixed role in Kafka Node Pools is not supported with configuration in this test case."; | ||
} |
28 changes: 28 additions & 0 deletions
28
...mtest/src/main/java/io/strimzi/systemtest/annotations/MixedRoleNotSupportedCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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.annotations; | ||
|
||
import io.strimzi.systemtest.Environment; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.junit.jupiter.api.extension.ConditionEvaluationResult; | ||
import org.junit.jupiter.api.extension.ExecutionCondition; | ||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
|
||
public class MixedRoleNotSupportedCondition implements ExecutionCondition { | ||
private static final Logger LOGGER = LogManager.getLogger(MixedRoleNotSupportedCondition.class); | ||
|
||
@Override | ||
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext) { | ||
if (Environment.isSeparateRolesMode() || !Environment.isKafkaNodePoolsEnabled() || !Environment.isKRaftModeEnabled()) { | ||
return ConditionEvaluationResult.enabled("Test is enabled"); | ||
} else { | ||
LOGGER.warn("According to {} env variable with value: {}, the mixed role mode is used, skipping this test because is not mixed role mode compliant", | ||
Environment.STRIMZI_NODE_POOLS_ROLE_MODE_ENV, | ||
Environment.STRIMZI_NODE_POOLS_ROLE_MODE); | ||
return ConditionEvaluationResult.disabled("Test is disabled"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters