Skip to content

Commit be3825a

Browse files
authoredJan 25, 2024
SNOW-1016776 IT test to test against the new K8s app (#1612)
Updated IT test to test against the new K8s app
1 parent 4e8f72c commit be3825a

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed
 

‎src/main/java/net/snowflake/client/jdbc/telemetryOOB/TelemetryService.java

+11-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ protected TelemetryService initialValue() {
4343

4444
// Global parameters:
4545
private static final String TELEMETRY_SERVER_URL_PATTERN =
46-
"https://(sfcdev\\.|sfctest\\.|)client-telemetry\\.snowflakecomputing\\" + ".com/enqueue";
46+
"https://(sfcdev\\.|sfctest\\.|)?client-telemetry\\.[a-z0-9\\.\\-]*snowflake[computing]?\\"
47+
+ ".com/enqueue";
4748

4849
/**
4950
* control which deployments are enabled: the service skips all events for the disabled
@@ -56,7 +57,8 @@ protected TelemetryService initialValue() {
5657
TELEMETRY_SERVER_DEPLOYMENT.REG.name,
5758
TELEMETRY_SERVER_DEPLOYMENT.QA1.name,
5859
TELEMETRY_SERVER_DEPLOYMENT.PREPROD3.name,
59-
TELEMETRY_SERVER_DEPLOYMENT.PROD.name));
60+
TELEMETRY_SERVER_DEPLOYMENT.PROD.name,
61+
TELEMETRY_SERVER_DEPLOYMENT.K8TEST.name));
6062

6163
// connection string for current connection
6264
private String connStr = "";
@@ -175,6 +177,8 @@ public void updateContext(SnowflakeConnectString conStr) {
175177

176178
private TELEMETRY_SERVER_DEPLOYMENT manuallyConfigureDeployment(String dep) {
177179
switch (dep) {
180+
case "K8TEST":
181+
return TELEMETRY_SERVER_DEPLOYMENT.K8TEST;
178182
case "REG":
179183
return TELEMETRY_SERVER_DEPLOYMENT.REG;
180184
case "DEV":
@@ -253,7 +257,9 @@ private enum TELEMETRY_API {
253257
"kyTKLWpEZSaJnrzTZ63I96QXZHKsgfqbaGmAaIWf"), // pragma: allowlist secret
254258
PROD(
255259
"https://client-telemetry.snowflakecomputing.com/enqueue",
256-
"wLpEKqnLOW9tGNwTjab5N611YQApOb3t9xOnE1rX"); // pragma: allowlist secret
260+
"wLpEKqnLOW9tGNwTjab5N611YQApOb3t9xOnE1rX"), // pragma: allowlist secret
261+
262+
K8TEST("https://client-telemetry.ordevmisc1.us-west-2.aws-dev.app.snowflake.com/enqueue", "");
257263

258264
private final String url;
259265

@@ -272,7 +278,8 @@ public enum TELEMETRY_SERVER_DEPLOYMENT {
272278
REG("reg", TELEMETRY_API.SFCDEV),
273279
QA1("qa1", TELEMETRY_API.SFCDEV),
274280
PREPROD3("preprod3", TELEMETRY_API.SFCDEV),
275-
PROD("prod", TELEMETRY_API.PROD);
281+
PROD("prod", TELEMETRY_API.PROD),
282+
K8TEST("k8test", TELEMETRY_API.K8TEST);
276283

277284
private String name;
278285
private String url;

‎src/test/java/net/snowflake/client/jdbc/telemetryOOB/TelemetryServiceIT.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.sql.SQLException;
99
import java.sql.SQLFeatureNotSupportedException;
1010
import java.sql.Statement;
11+
import java.util.Map;
1112
import java.util.Properties;
1213
import java.util.concurrent.TimeUnit;
1314
import net.snowflake.client.ConditionalIgnoreRule;
@@ -35,7 +36,9 @@ public class TelemetryServiceIT extends BaseJDBCTest {
3536
@Before
3637
public void setUp() {
3738
TelemetryService service = TelemetryService.getInstance();
38-
service.updateContextForIT(getConnectionParameters());
39+
Map<String, String> connectionParams = getConnectionParameters();
40+
connectionParams.put("TELEMETRYDEPLOYMENT", "K8TEST");
41+
service.updateContextForIT(connectionParams);
3942
defaultState = service.isEnabled();
4043
service.enable();
4144
}
@@ -53,7 +56,6 @@ public void tearDown() throws InterruptedException {
5356
}
5457

5558
@SuppressWarnings("divzero")
56-
@Ignore
5759
@Test
5860
public void testCreateException() {
5961
TelemetryService service = TelemetryService.getInstance();

0 commit comments

Comments
 (0)
Please sign in to comment.