Skip to content

Commit

Permalink
Move DisabledOnRHBQWindowsConditions from testsuite to framework
Browse files Browse the repository at this point in the history
  • Loading branch information
jedla97 authored and michalvavrik committed Oct 22, 2024
1 parent cb6ad5a commit 8103989
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkus.test.scenarios.annotations;

import org.junit.jupiter.api.extension.ConditionEvaluationResult;
import org.junit.jupiter.api.extension.ExecutionCondition;
import org.junit.jupiter.api.extension.ExtensionContext;

import io.quarkus.test.services.quarkus.model.QuarkusProperties;
import io.smallrye.common.os.OS;

public class DisabledOnRHBQWindowsConditions implements ExecutionCondition {

@Override
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext) {
boolean isWindows = OS.current().equals(OS.WINDOWS);
if (QuarkusProperties.isRHBQ() && isWindows) {
return ConditionEvaluationResult.disabled("It is RHBQ on Windows");
} else {
return ConditionEvaluationResult.enabled("It is not RHBQ on Windows");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkus.test.scenarios.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.junit.jupiter.api.extension.ExtendWith;

@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@ExtendWith(DisabledOnRHBQWindowsConditions.class)
public @interface DisabledOnRHBQandWindows {

/**
* Why is the annotated test class or test method disabled.
*/
String reason();
}

0 comments on commit 8103989

Please sign in to comment.