|
@@ -7,6 +7,7 @@ import java.time.ZoneOffset;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
|
import static com.provectus.kafka.ui.settings.BaseSource.SUITE;
|
|
import static com.provectus.kafka.ui.settings.BaseSource.SUITE;
|
|
|
|
+import static com.provectus.kafka.ui.variables.Suite.*;
|
|
import static org.apache.commons.lang3.BooleanUtils.FALSE;
|
|
import static org.apache.commons.lang3.BooleanUtils.FALSE;
|
|
import static org.apache.commons.lang3.BooleanUtils.TRUE;
|
|
import static org.apache.commons.lang3.BooleanUtils.TRUE;
|
|
import static org.apache.commons.lang3.StringUtils.isEmpty;
|
|
import static org.apache.commons.lang3.StringUtils.isEmpty;
|
|
@@ -14,13 +15,20 @@ import static org.apache.commons.lang3.StringUtils.isEmpty;
|
|
@Slf4j
|
|
@Slf4j
|
|
public class QaseExtension {
|
|
public class QaseExtension {
|
|
|
|
|
|
|
|
+ private static boolean isSuiteEnabled() {
|
|
|
|
+ return switch (SUITE) {
|
|
|
|
+ case CUSTOM, SMOKE -> false;
|
|
|
|
+ case REGRESSION, SANITY -> true;
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
public static void testRunSetup() {
|
|
public static void testRunSetup() {
|
|
String qaseApiToken = System.getProperty("QASEIO_API_TOKEN");
|
|
String qaseApiToken = System.getProperty("QASEIO_API_TOKEN");
|
|
- if (isEmpty(qaseApiToken)) {
|
|
|
|
- log.warn("QASEIO_API_TOKEN system property wasn't set. Support for Qase will be disabled.");
|
|
|
|
|
|
+ if (isEmpty(qaseApiToken) || !isSuiteEnabled()) {
|
|
|
|
+ log.warn("Integration with Qase is disabled due to suite settings or token wasn't defined.");
|
|
System.setProperty("QASE_ENABLE", FALSE);
|
|
System.setProperty("QASE_ENABLE", FALSE);
|
|
} else {
|
|
} else {
|
|
- log.warn("QASEIO_API_TOKEN was set. Find this run at https://app.qase.io/run/KAFKAUI.");
|
|
|
|
|
|
+ log.warn("Integration with Qase is enabled. Find this run at https://app.qase.io/run/KAFKAUI.");
|
|
System.setProperty("QASE_ENABLE", TRUE);
|
|
System.setProperty("QASE_ENABLE", TRUE);
|
|
System.setProperty("QASE_PROJECT_CODE", "KAFKAUI");
|
|
System.setProperty("QASE_PROJECT_CODE", "KAFKAUI");
|
|
System.setProperty("QASE_API_TOKEN", qaseApiToken);
|
|
System.setProperty("QASE_API_TOKEN", qaseApiToken);
|