Skip to content

Commit

Permalink
SNOW-1016776 IT test to test against the new K8s app (#1612)
Browse files Browse the repository at this point in the history
Updated IT test to test against the new K8s app
  • Loading branch information
sfc-gh-hchaturvedi authored Jan 25, 2024
1 parent 4e8f72c commit be3825a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ protected TelemetryService initialValue() {

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

/**
* control which deployments are enabled: the service skips all events for the disabled
Expand All @@ -56,7 +57,8 @@ protected TelemetryService initialValue() {
TELEMETRY_SERVER_DEPLOYMENT.REG.name,
TELEMETRY_SERVER_DEPLOYMENT.QA1.name,
TELEMETRY_SERVER_DEPLOYMENT.PREPROD3.name,
TELEMETRY_SERVER_DEPLOYMENT.PROD.name));
TELEMETRY_SERVER_DEPLOYMENT.PROD.name,
TELEMETRY_SERVER_DEPLOYMENT.K8TEST.name));

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

private TELEMETRY_SERVER_DEPLOYMENT manuallyConfigureDeployment(String dep) {
switch (dep) {
case "K8TEST":
return TELEMETRY_SERVER_DEPLOYMENT.K8TEST;
case "REG":
return TELEMETRY_SERVER_DEPLOYMENT.REG;
case "DEV":
Expand Down Expand Up @@ -253,7 +257,9 @@ private enum TELEMETRY_API {
"kyTKLWpEZSaJnrzTZ63I96QXZHKsgfqbaGmAaIWf"), // pragma: allowlist secret
PROD(
"https://client-telemetry.snowflakecomputing.com/enqueue",
"wLpEKqnLOW9tGNwTjab5N611YQApOb3t9xOnE1rX"); // pragma: allowlist secret
"wLpEKqnLOW9tGNwTjab5N611YQApOb3t9xOnE1rX"), // pragma: allowlist secret

K8TEST("https://client-telemetry.ordevmisc1.us-west-2.aws-dev.app.snowflake.com/enqueue", "");

private final String url;

Expand All @@ -272,7 +278,8 @@ public enum TELEMETRY_SERVER_DEPLOYMENT {
REG("reg", TELEMETRY_API.SFCDEV),
QA1("qa1", TELEMETRY_API.SFCDEV),
PREPROD3("preprod3", TELEMETRY_API.SFCDEV),
PROD("prod", TELEMETRY_API.PROD);
PROD("prod", TELEMETRY_API.PROD),
K8TEST("k8test", TELEMETRY_API.K8TEST);

private String name;
private String url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import net.snowflake.client.ConditionalIgnoreRule;
Expand Down Expand Up @@ -35,7 +36,9 @@ public class TelemetryServiceIT extends BaseJDBCTest {
@Before
public void setUp() {
TelemetryService service = TelemetryService.getInstance();
service.updateContextForIT(getConnectionParameters());
Map<String, String> connectionParams = getConnectionParameters();
connectionParams.put("TELEMETRYDEPLOYMENT", "K8TEST");
service.updateContextForIT(connectionParams);
defaultState = service.isEnabled();
service.enable();
}
Expand All @@ -53,7 +56,6 @@ public void tearDown() throws InterruptedException {
}

@SuppressWarnings("divzero")
@Ignore
@Test
public void testCreateException() {
TelemetryService service = TelemetryService.getInstance();
Expand Down

0 comments on commit be3825a

Please sign in to comment.