Skip to content

Commit 541de46

Browse files
authored
[ST] Huge update of setup, utils, certs, constants and envs (#2381)
* Sts update, auth setup, versions, dependencies * fixes for groups css * new strimzi and kafka * add released test-clients * fix name * fix groups test * minor doc changes * minor loading change --------- Signed-off-by: jkalinic <jkalinic@redhat.com>
1 parent 233a778 commit 541de46

File tree

74 files changed

+2451
-2234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2451
-2234
lines changed

systemtests/config.yaml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# -------------------------------------------
55
# Cleanup environment after test. In case of debugging, this env lets you skip afterEach and afterAll.
66
CLEANUP_ENVIRONMENT: true
7+
# This allows re-deployment of console operator if it already exists
8+
DELETE_CONSOLE_OPERATOR_BEFORE_INSTALL: true
79
# Log level used in file output
810
TEST_FILE_LOG_LEVEL: DEBUG
911
# Log level used in console output
@@ -41,12 +43,12 @@ CONSOLE_OLM_CHANNEL_NAME: alpha
4143
# YAML
4244
# -------------------------------------------
4345
# Which released version of Strimzi Cluster Operator to install
44-
STRIMZI_OPERATOR_VERSION: 0.49.0
46+
STRIMZI_OPERATOR_VERSION: 0.51.0
4547
# URL or local path for Console Operator installation
4648
# 1. URL - released console-operator.yaml
4749
# 2. Local path that is relative to the root project dir
4850
# 3. Local path that is absolute
49-
CONSOLE_OPERATOR_BUNDLE_URL: https://github.com/streamshub/console/releases/download/0.8.4/streamshub-console-operator.yaml
51+
CONSOLE_OPERATOR_BUNDLE_URL: https://github.com/streamshub/console/releases/download/0.11.0/streamshub-console-operator.yaml
5052
# Custom Console Operator image. Overrides default image used in bundle yaml
5153
CONSOLE_OPERATOR_IMAGE:
5254
# -------------------------------------------
@@ -57,9 +59,30 @@ CONSOLE_API_IMAGE:
5759
# Custom Console UI image. Overrides default image installed automatically by Operator
5860
CONSOLE_UI_IMAGE:
5961
# -------------------------------------------
62+
# Kroxy
63+
# -------------------------------------------
64+
# Kroxy released yaml manifests version
65+
KROXYLICIOUS_VERSION: 0.18.0
66+
# -------------------------------------------
67+
# Apicurio
68+
# -------------------------------------------
69+
# Apicurio schema registry version
70+
APICURIO_VERSION: 3.1.7
71+
# -------------------------------------------
72+
# Keycloak
73+
# -------------------------------------------
74+
# Keycloak released yaml manifest tag version
75+
KEYCLOAK_VERSION: 26.4.0
76+
# -------------------------------------------
77+
# Prometheus
78+
# -------------------------------------------
79+
# Used for custom prometheus tests
80+
# version of the released yaml manifests
81+
PROMETHEUS_VERSION: 0.89.0
82+
# -------------------------------------------
6083
# Kafka
6184
# -------------------------------------------
6285
# Kafka version used in system tests
63-
ST_KAFKA_VERSION: 4.1.0
86+
ST_KAFKA_VERSION: 4.2.0
6487
# Image for test client containers in system tests
65-
TEST_CLIENTS_IMAGE: quay.io/strimzi-test-clients/test-clients:0.12.0-kafka-4.1.0
88+
TEST_CLIENTS_IMAGE: quay.io/strimzi-test-clients/test-clients:0.13.0-kafka-4.2.0

systemtests/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@
258258
</activation>
259259
</profile>
260260

261+
<profile>
262+
<id>all</id>
263+
<properties>
264+
<skipTests>false</skipTests>
265+
<groups>regression, olm-upgrade, yaml-upgrade</groups>
266+
</properties>
267+
</profile>
268+
261269
<profile>
262270
<id>regression</id>
263271
<properties>

systemtests/src/main/java/com/github/streamshub/systemtests/Environment.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public class Environment {
2727
// Console
2828
public static final String CONSOLE_API_IMAGE = ENVS.getOrDefault("CONSOLE_API_IMAGE", "");
2929
public static final String CONSOLE_UI_IMAGE = ENVS.getOrDefault("CONSOLE_UI_IMAGE", "");
30-
public static final String CONSOLE_OPERATOR_IMAGE = ENVS.getOrDefault("CONSOLE_OPERATOR_IMAGE", "");
3130
public static final InstallType CONSOLE_INSTALL_TYPE = ENVS.getOrDefault("CONSOLE_INSTALL_TYPE", InstallType::fromString, InstallType.Yaml);
3231
public static final String CONSOLE_DEPLOYMENT_NAME = ENVS.getOrDefault("CONSOLE_DEPLOYMENT_NAME", "streamshub-console");
3332
public static final String CONSOLE_CLUSTER_DOMAIN = ENVS.getOrDefault("CONSOLE_CLUSTER_DOMAIN", "");
33+
public static final boolean DELETE_CONSOLE_OPERATOR_BEFORE_INSTALL = ENVS.getOrDefault("DELETE_CONSOLE_OPERATOR_BEFORE_INSTALL", Boolean::parseBoolean, true);
3434

35-
// YAML bundle
35+
// YAML bundle
3636
public static final String CONSOLE_OPERATOR_BUNDLE_URL = ENVS.getOrDefault("CONSOLE_OPERATOR_BUNDLE_URL", "");
3737

3838
// OLM
@@ -66,20 +66,25 @@ public class Environment {
6666
public static final String TEST_CLIENTS_PULL_SECRET = ENVS.getOrDefault("TEST_CLIENTS_PULL_SECRET", "");
6767

6868
// Keycloak
69-
public static final String KEYCLOAK_VERSION = ENVS.getOrDefault("KEYCLOAK_VERSION", "26.2.5");
69+
public static final String KEYCLOAK_VERSION = ENVS.getOrDefault("KEYCLOAK_VERSION", "26.4.0");
7070
public static final boolean DEFAULT_TO_DENY_NETWORK_POLICIES = ENVS.getOrDefault("DEFAULT_TO_DENY_NETWORK_POLICIES", Boolean::parseBoolean, true);
7171
public static final String KEYCLOAK_TRUST_STORE_FILE_PATH = ENVS.getOrDefault("TRUST_STORE_FILE_PATH", "/tmp/keycloak/keycloak-truststore.jks");
72+
// For custom keycloak images
73+
public static final String KEYCLOAK_OPERATOR_IMAGE = ENVS.getOrDefault("KEYCLOAK_OPERATOR_IMAGE", "");
74+
public static final String KEYCLOAK_SERVER_IMAGE = ENVS.getOrDefault("KEYCLOAK_SERVER_IMAGE", "");
7275

7376
// Postgres
7477
public static final String POSTGRES_IMAGE = ENVS.getOrDefault("POSTGRES_IMAGE", "mirror.gcr.io/postgres:18");
7578

7679
// Proxy
7780
public static final String KROXYLICIOUS_VERSION = ENVS.getOrDefault("KROXYLICIOUS_VERSION", "0.18.0");
7881

79-
8082
// Apicurio
8183
public static final String APICURIO_VERSION = ENVS.getOrDefault("APICURIO_VERSION", "3.1.7");
8284

85+
// Prometheus
86+
public static final String PROMETHEUS_VERSION = ENVS.getOrDefault("PROMETHEUS_VERSION", "0.89.0");
87+
8388
// ------------------------------------------------------------------------------------------------------------------------------------------------------------
8489
// Deny instantiation
8590
private Environment() {}

systemtests/src/main/java/com/github/streamshub/systemtests/MessageStore.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ private MessageStore() {}
5858
static final String BRAND = "brand";
5959
static final String RECONCILIATION = "reconciliation";
6060
static final String MESSAGE_BROWSER = "message-browser";
61+
static final String APP_LAYOUT = "AppLayout";
62+
static final String KAFKA_CONNECT = "KafkaConnect";
63+
static final String GROUPS_TABLE = "GroupsTable";
6164

6265
public static String getProductName() {
6366
return jsonResources.get(COMMON).get(PRODUCT).textValue();
@@ -95,9 +98,6 @@ public static String reconciliationCancel() {
9598
return jsonResources.get(RECONCILIATION).get("cancel").textValue();
9699
}
97100

98-
public static String reconciliationResume() {
99-
return jsonResources.get(RECONCILIATION).get("resume").textValue();
100-
}
101101

102102
public static String reconciliationPausedWarning() {
103103
return jsonResources.get(RECONCILIATION).get("reconciliation_paused_warning").textValue();
@@ -114,9 +114,17 @@ public static String clusterCardNoMessages() {
114114
public static String noDataTitle() {
115115
return jsonResources.get(MESSAGE_BROWSER).get("no_data_title").textValue();
116116
}
117-
public static String noDataBody() {
118-
return jsonResources.get(MESSAGE_BROWSER).get("no_data_title").textValue();
117+
118+
public static String noConsumerGroups() {
119+
return jsonResources.get(GROUPS_TABLE).get("no_consumer_groups").textValue();
119120
}
120121

122+
public static String groupsTitle() {
123+
return jsonResources.get(GROUPS_TABLE).get("title").textValue();
124+
}
125+
126+
public static String kafkaConnect() {
127+
return jsonResources.get(APP_LAYOUT).get("kafka_connect").textValue();
128+
}
121129

122130
}

systemtests/src/main/java/com/github/streamshub/systemtests/TestCaseConfig.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,22 @@
1010
import com.microsoft.playwright.Page;
1111
import com.microsoft.playwright.Playwright;
1212
import com.microsoft.playwright.Tracing;
13+
import com.microsoft.playwright.options.ColorScheme;
14+
import com.microsoft.playwright.options.ViewportSize;
1315
import org.junit.jupiter.api.extension.ExtensionContext;
1416

1517
import java.lang.reflect.Method;
1618
import java.util.Locale;
1719

1820
public class TestCaseConfig {
21+
private static final ViewportSize FULL_HD = new ViewportSize(1920, 1080);
1922
private final String testName;
2023
private final String namespace;
2124
private final Playwright playwright;
22-
private final Browser browser;
2325
private final BrowserContext context;
26+
private final Browser browser;
2427
private final Page page;
25-
private int messageCount;
28+
private final int defaultMessageCount;
2629

2730
// Default Kafka
2831
private final String kafkaName;
@@ -51,8 +54,14 @@ public TestCaseConfig(ExtensionContext extensionContext) {
5154
.orElse("nullClass");
5255

5356
this.playwright = Playwright.create();
54-
this.browser = PwUtils.createBrowser(playwright);
55-
this.context = browser.newContext(new Browser.NewContextOptions().setIgnoreHTTPSErrors(true));
57+
58+
// to keep browser context open it must exist within the TestCaseConfig context - can't be a local var
59+
browser = PwUtils.createBrowser(playwright);
60+
this.context = browser.newContext(new Browser.NewContextOptions()
61+
.setColorScheme(ColorScheme.DARK)
62+
.setViewportSize(FULL_HD)
63+
.setIgnoreHTTPSErrors(true));
64+
5665
// Allow tracing
5766
this.context.tracing().start(new Tracing.StartOptions().setScreenshots(true).setSnapshots(true).setSources(true));
5867

@@ -70,7 +79,7 @@ public TestCaseConfig(ExtensionContext extensionContext) {
7079
this.kafkaServiceName = KroxyNamingUtils.kafkaServiceName(namespace);
7180
this.kafkaProtocolFilterName = KroxyNamingUtils.kafkaProtocolFilterName(namespace);
7281

73-
this.messageCount = Constants.MESSAGE_COUNT;
82+
this.defaultMessageCount = Constants.MESSAGE_COUNT;
7483
this.apicurioRegistry3Name = Constants.APICURIO_PREFIX + "-" + Utils.hashStub(namespace);
7584
}
7685

@@ -133,18 +142,11 @@ public String kafkaProtocolFilterName() {
133142
return kafkaProtocolFilterName;
134143
}
135144

136-
public int messageCount() {
137-
return messageCount;
145+
public int defaultMessageCount() {
146+
return defaultMessageCount;
138147
}
139148

140149
public String apicurioRegistry3Name() {
141150
return apicurioRegistry3Name;
142151
}
143-
144-
// ----------
145-
// Setters
146-
// ----------
147-
public void setMessageCount(int messageCount) {
148-
this.messageCount = messageCount;
149-
}
150152
}

systemtests/src/main/java/com/github/streamshub/systemtests/constants/AuthTestConstants.java

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,66 @@ public class AuthTestConstants {
66

77
private AuthTestConstants() {}
88

9+
// JWT Claim
10+
public static final String CLAIM_GROUPS = "groups";
11+
12+
// Test Usernames
13+
public static final String USER_DEV_BOB = "bob";
14+
public static final String USER_DEV_BOB_LASTNAME = "TheDeveloper";
15+
16+
public static final String USER_ADMIN_ALICE = "alice";
17+
public static final String USER_ADMIN_ALICE_LASTNAME = "TheAdmin";
18+
19+
public static final String USER_TOPICONLY_FRANK = "frank";
20+
public static final String USER_TOPICONLY_FRANK_LASTNAME = "TopicOnlyViewer";
21+
22+
public static final String USER_CONSUMERONLY_GRACE = "grace";
23+
public static final String USER_CONSUMERONLY_GRACE_LASTNAME = "ConsuemerOnlyViewer";
24+
25+
// Suffixes
26+
public static final String GROUP_SUFFIX = "-team";
27+
public static final String ROLE_SUFFIX = "-role";
28+
29+
// Base names
30+
public static final String DEV = "developers";
31+
public static final String ADMIN = "administrators";
32+
public static final String TOPICS_VIEW = "topics";
33+
public static final String CONSUMERGROUPS_VIEW = "consumergroups";
34+
935
// Keycloak Groups
10-
public static final String DEV_GROUP_NAME = "/developers-team";
11-
public static final String ADMIN_GROUP_NAME = "/administrators-team";
12-
public static final String TOPICS_VIEW_GROUP_NAME = "/topics-view-team";
13-
public static final String CONSUMERGROUPS_VIEW_GROUP_NAME = "/consumergroups-view-team";
36+
public static final String DEV_GROUP_NAME = DEV + GROUP_SUFFIX;
37+
public static final String ADMIN_GROUP_NAME = ADMIN + GROUP_SUFFIX;
38+
public static final String TOPICS_VIEW_GROUP_NAME = TOPICS_VIEW + "-viewonly" + GROUP_SUFFIX;
39+
public static final String CONSUMERGROUPS_VIEW_GROUP_NAME = CONSUMERGROUPS_VIEW + "-viewonly" + GROUP_SUFFIX;
40+
41+
// Keycloak Role Names
42+
public static final String DEV_ROLE_NAME = DEV + ROLE_SUFFIX;
43+
public static final String ADMIN_ROLE_NAME = ADMIN + ROLE_SUFFIX;
44+
public static final String TOPICS_VIEW_ROLE_NAME = TOPICS_VIEW + ROLE_SUFFIX;
45+
public static final String CONSUMERGROUPS_VIEW_ROLE_NAME = CONSUMERGROUPS_VIEW + ROLE_SUFFIX;
46+
47+
// Keycloak Group Paths
48+
public static final String DEV_GROUP_PATH = "/" + DEV_GROUP_NAME; // NOSONAR
49+
public static final String ADMIN_GROUP_PATH = "/" + ADMIN_GROUP_NAME; // NOSONAR
50+
public static final String TOPICS_VIEW_GROUP_PATH = "/" + TOPICS_VIEW_GROUP_NAME; // NOSONAR
51+
public static final String CONSUMERGROUPS_VIEW_GROUP_PATH = "/" + CONSUMERGROUPS_VIEW_GROUP_NAME; // NOSONAR
1452

15-
// Console Roles
16-
public static final String DEV_ROLE_NAME = "developers-role";
17-
public static final String ADMIN_ROLE_NAME = "administrators-role";
18-
public static final String TOPICS_VIEW_ROLE_NAME = "topics-role";
19-
public static final String CONSUMERGROUPS_VIEW_ROLE_NAME = "consumergroups-role";
53+
// Keycloak Role Descriptions
54+
public static final String DEV_ROLE_DESCRIPTION = DEV_ROLE_NAME + " member";
55+
public static final String ADMIN_ROLE_DESCRIPTION = ADMIN_ROLE_NAME + " member";
56+
public static final String TOPICS_VIEW_ROLE_DESCRIPTION = "Can view " + TOPICS_VIEW_ROLE_NAME + "s only";
57+
public static final String CONSUMERGROUPS_VIEW_ROLE_DESCRIPTION = "Can view " + CONSUMERGROUPS_VIEW_ROLE_NAME + "s only";
58+
59+
// Aditional emails
60+
public static final String USER_DEV_BOB_EMAIL = AuthTestConstants.USER_DEV_BOB + "@streams-hub.io";
61+
public static final String USER_ADMIN_ALICE_EMAIL = AuthTestConstants.USER_ADMIN_ALICE + "@streams.hub.io";
62+
public static final String USER_TOPICONLY_FRANK_EMAIL = AuthTestConstants.USER_TOPICONLY_FRANK + "@stream+shub.io";
63+
public static final String USER_CONSUMERONLY_GRACE_EMAIL = AuthTestConstants.USER_CONSUMERONLY_GRACE + "@streamshub.io";
2064

2165
// Kafka Cluster Names
2266
public static final String TEAM_DEV_KAFKA_NAME = "kc-team-dev";
2367
public static final String TEAM_DEV_TOPIC_PREFIX = "dev-";
2468
public static final String TEAM_ADMIN_KAFKA_NAME = "kc-team-admin";
2569
public static final String TEAM_ADMIN_TOPIC_PREFIX = "admin-";
2670

27-
// JWT Claim
28-
public static final String CLAIM_GROUPS = "groups";
29-
30-
// Test Usernames
31-
// developer
32-
public static final String USER_DEV_BOB = "bob";
33-
// admin
34-
public static final String USER_ADMIN_ALICE = "alice";
35-
// topics only
36-
public static final String USER_TOPICONLY_FRANK = "frank";
37-
// consumer groups only
38-
public static final String USER_CONSUMERONLY_GRACE = "grace";
3971
}

0 commit comments

Comments
 (0)