Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1016467: Enable matrix for Azure and GCP cloud providers. #1777

Merged
merged 11 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,19 @@ jobs:

test-windows:
needs: build
name: ${{ matrix.cloud }} Windows java ${{ matrix.javaVersion }} JDBC${{ matrix.additionalMavenProfile }} ${{ matrix.category }}
name: ${{ matrix.runConfig.cloud }} Windows java ${{ matrix.runConfig.javaVersion }} JDBC${{ matrix.additionalMavenProfile }} ${{ matrix.category }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
cloud: [ 'AWS' ]
javaVersion: [ '8', '11', '17']
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}]
category: ['TestCategoryResultSet,TestCategoryOthers,TestCategoryLoader', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryArrow,TestCategoryCore', 'TestCategoryFips']
additionalMavenProfile: ['', '-Dthin-jar']
additionalMavenProfile: ['']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.javaVersion }}
java-version: ${{ matrix.runConfig.javaVersion }}
distribution: 'temurin'
cache: maven
- uses: actions/setup-python@v4
Expand All @@ -62,27 +61,26 @@ jobs:
shell: cmd
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
JDBC_TEST_CATEGORY: ${{ matrix.category }}
ADDITIONAL_MAVEN_PROFILE: ${{ matrix.additionalMavenProfile }}
run: ci\\test_windows.bat

test-mac:
needs: build
name: ${{ matrix.cloud }} Mac java ${{ matrix.javaVersion }} JDBC${{ matrix.additionalMavenProfile }} ${{ matrix.category }}
name: ${{ matrix.runConfig.cloud }} Mac java ${{ matrix.runConfig.javaVersion }} JDBC${{ matrix.additionalMavenProfile }} ${{ matrix.category }}
runs-on: macos-13
strategy:
fail-fast: false
matrix:
cloud: [ 'AWS' ]
javaVersion: [ '8', '11', '17']
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}]
category: ['TestCategoryResultSet,TestCategoryOthers,TestCategoryLoader', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryArrow,TestCategoryCore', 'TestCategoryFips']
additionalMavenProfile: ['', '-Dthin-jar']
additionalMavenProfile: ['']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.javaVersion }}
java-version: ${{ matrix.runConfig.javaVersion }}
distribution: 'temurin'
cache: maven
- uses: actions/setup-python@v4
Expand All @@ -95,7 +93,7 @@ jobs:
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
JDBC_TEST_CATEGORY: ${{ matrix.category }}
ADDITIONAL_MAVEN_PROFILE: ${{ matrix.additionalMavenProfile }}
run: /usr/local/bin/bash ./ci/test_mac.sh
Expand All @@ -108,7 +106,7 @@ jobs:
fail-fast: false
matrix:
image: [ 'jdbc-centos7-openjdk8', 'jdbc-centos7-openjdk11', 'jdbc-centos7-openjdk17' ]
cloud: [ 'AWS' ]
cloud: [ 'AWS', 'AZURE', 'GCP' ]
category: ['TestCategoryResultSet,TestCategoryOthers,TestCategoryLoader', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryArrow,TestCategoryCore', 'TestCategoryFips']
additionalMavenProfile: ['', '-Dthin-jar']
steps:
Expand Down
Binary file added .github/workflows/parameters_azure.json.gpg
Binary file not shown.
12 changes: 12 additions & 0 deletions FIPS/src/test/java/net/snowflake/client/RunningOnGCP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2012-2024 Snowflake Computing Inc. All right reserved.
*/
package net.snowflake.client;

/** Run tests only on specified cloud provider or ignore */
public class RunningOnGCP implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
String cloudProvider = TestUtil.systemGetEnv("CLOUD_PROVIDER");
return cloudProvider != null && cloudProvider.equalsIgnoreCase("GCP");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import javax.net.ssl.HttpsURLConnection;
import net.snowflake.client.AbstractDriverIT;
import net.snowflake.client.ConditionalIgnoreRule;
import net.snowflake.client.RunningOnGCP;
import net.snowflake.client.RunningOnGithubActions;
import net.snowflake.client.category.TestCategoryFips;
import net.snowflake.client.core.SecurityUtil;
Expand Down Expand Up @@ -289,7 +290,12 @@ public void testConnectUsingKeyPair() throws Exception {
DriverManager.getConnection(uri, properties).close();
}

/**
* Test case for connecting with FIPS and executing a query.
* Currently ignored execution on GCP due to exception thrown "SSlException Could not generate XDH keypair"
sfc-gh-dprzybysz marked this conversation as resolved.
Show resolved Hide resolved
*/
@Test
@ConditionalIgnoreRule.ConditionalIgnore(condition = RunningOnGCP.class)
sfc-gh-dprzybysz marked this conversation as resolved.
Show resolved Hide resolved
public void connectWithFipsAndQuery() throws SQLException {
try (Connection con = getConnection()) {
Statement statement = con.createStatement();
Expand Down
1 change: 1 addition & 0 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ for name in "${!TARGET_TEST_IMAGES[@]}"; do
-e BUILD_NUMBER \
-e JDBC_TEST_CATEGORY \
-e ADDITIONAL_MAVEN_PROFILE \
-e CLOUD_PROVIDER \
-e is_old_driver \
--add-host=snowflake.reg.local:${IP_ADDR} \
--add-host=s3testaccount.reg.local:${IP_ADDR} \
Expand Down
1 change: 1 addition & 0 deletions ci/test_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ echo [INFO] Database: %SNOWFLAKE_TEST_DATABASE%
echo [INFO] Schema: %SNOWFLAKE_TEST_SCHEMA%
echo [INFO] Warehouse: %SNOWFLAKE_TEST_WAREHOUSE%
echo [INFO] Role: %SNOWFLAKE_TEST_ROLE%
echo [INFO] PROVIDER: %CLOUD_PROVIDER%

echo [INFO] Creating schema %SNOWFLAKE_TEST_SCHEMA%
pushd %GITHUB_WORKSPACE%\ci\container
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/net/snowflake/client/RunningNotOnAWS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2012-2024 Snowflake Computing Inc. All right reserved.
*/
package net.snowflake.client;

/** Run tests only on specified cloud provider or ignore */
public class RunningNotOnAWS implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
String cloudProvider = TestUtil.systemGetEnv("CLOUD_PROVIDER");
return cloudProvider != null && !cloudProvider.equalsIgnoreCase("AWS");
}
}
12 changes: 12 additions & 0 deletions src/test/java/net/snowflake/client/RunningNotOnAzure.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2012-2024 Snowflake Computing Inc. All right reserved.
*/
package net.snowflake.client;

/** Run tests only on specified cloud provider or ignore */
public class RunningNotOnAzure implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
String cloudProvider = TestUtil.systemGetEnv("CLOUD_PROVIDER");
return cloudProvider != null && !cloudProvider.equalsIgnoreCase("Azure");
}
}
12 changes: 12 additions & 0 deletions src/test/java/net/snowflake/client/RunningNotOnGCP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2012-2024 Snowflake Computing Inc. All right reserved.
*/
package net.snowflake.client;

/** Run tests only on specified cloud provider or ignore */
public class RunningNotOnGCP implements ConditionalIgnoreRule.IgnoreCondition {
public boolean isSatisfied() {
String cloudProvider = TestUtil.systemGetEnv("CLOUD_PROVIDER");
return cloudProvider != null && !cloudProvider.equalsIgnoreCase("GCP");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import net.snowflake.client.ConditionalIgnoreRule;
import net.snowflake.client.RunningNotOnAWS;
import net.snowflake.client.RunningOnGithubAction;
import net.snowflake.client.TestUtil;
import net.snowflake.client.category.TestCategoryConnection;
Expand Down Expand Up @@ -1169,7 +1170,13 @@ public void testReadOnly() throws Throwable {
}
}

/**
* Test case for the method testDownloadStreamWithFileNotFoundException. This test verifies that a
* SQLException is thrown when attempting to download a file that does not exist. It verifies that
* the error code is ErrorCode.S3_OPERATION_ERROR so only runs on AWS.
*/
@Test
@ConditionalIgnoreRule.ConditionalIgnore(condition = RunningNotOnAWS.class)
sfc-gh-dprzybysz marked this conversation as resolved.
Show resolved Hide resolved
public void testDownloadStreamWithFileNotFoundException() throws SQLException {
try (Connection connection = getConnection();
Statement statement = connection.createStatement()) {
Expand Down
Loading