|
@@ -6,8 +6,6 @@ import java.time.OffsetDateTime;
|
|
import java.time.ZoneOffset;
|
|
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.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;
|
|
@@ -15,18 +13,12 @@ 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;
|
|
|
|
- default -> throw new IllegalStateException("Unexpected value: " + SUITE);
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
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) || !isSuiteEnabled()) {
|
|
|
|
- log.warn("Integration with Qase is disabled due to suite settings or token wasn't defined.");
|
|
|
|
|
|
+ String qaseEnabled = System.getProperty("INPUT_QASE_ENABLED");
|
|
|
|
+ String testSuite = System.getProperty("INPUT_TEST_SUITE");
|
|
|
|
+ if (isEmpty(qaseApiToken) || !Boolean.parseBoolean(qaseEnabled)) {
|
|
|
|
+ log.warn("Integration with Qase is disabled due to run config or token wasn't defined.");
|
|
System.setProperty("QASE_ENABLE", FALSE);
|
|
System.setProperty("QASE_ENABLE", FALSE);
|
|
} else {
|
|
} else {
|
|
log.warn("Integration with Qase is enabled. 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.");
|
|
@@ -35,7 +27,7 @@ public class QaseExtension {
|
|
System.setProperty("QASE_API_TOKEN", qaseApiToken);
|
|
System.setProperty("QASE_API_TOKEN", qaseApiToken);
|
|
System.setProperty("QASE_USE_BULK", TRUE);
|
|
System.setProperty("QASE_USE_BULK", TRUE);
|
|
System.setProperty("QASE_RUN_NAME", DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")
|
|
System.setProperty("QASE_RUN_NAME", DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")
|
|
- .format(OffsetDateTime.now(ZoneOffset.UTC)) + ": " + "Automation " + SUITE.toUpperCase() + " suite");
|
|
|
|
|
|
+ .format(OffsetDateTime.now(ZoneOffset.UTC)) + ": " + "Automation " + testSuite.toUpperCase() + " suite");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|