Skip to content

Commit

Permalink
Merge branch 'SNOW-1732907-custom-azure-headers' of github.com:snowfl…
Browse files Browse the repository at this point in the history
…akedb/snowflake-jdbc into SNOW-1732907-custom-azure-headers
  • Loading branch information
sfc-gh-dheyman-1 committed Oct 17, 2024
2 parents 5678d58 + f3bb222 commit f9db619
Showing 1 changed file with 0 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1485,54 +1485,6 @@ public void testNoSpaceLeftOnDeviceException() throws SQLException {
}
}

@Test
@Ignore // ignored until SNOW-1616480 is resolved
public void testUploadWithGCSPresignedUrlWithoutConnection() throws Throwable {
File destFolder = tmpFolder.newFolder();
String destFolderCanonicalPath = destFolder.getCanonicalPath();
// set parameter for presignedUrl upload instead of downscoped token
Properties paramProperties = new Properties();
paramProperties.put("GCS_USE_DOWNSCOPED_CREDENTIAL", false);
try (Connection connection = getConnection("gcpaccount", paramProperties);
Statement statement = connection.createStatement()) {
try {
// create a stage to put the file in
statement.execute("CREATE OR REPLACE STAGE " + testStageName);

SFSession sfSession = connection.unwrap(SnowflakeConnectionV1.class).getSfSession();

// Test put file with internal compression
String putCommand = "put file:///dummy/path/file1.gz @" + testStageName;
SnowflakeFileTransferAgent sfAgent =
new SnowflakeFileTransferAgent(putCommand, sfSession, new SFStatement(sfSession));
List<SnowflakeFileTransferMetadata> metadata = sfAgent.getFileTransferMetadatas();

String srcPath = getFullPathFileInResource(TEST_DATA_FILE);
for (SnowflakeFileTransferMetadata oneMetadata : metadata) {
InputStream inputStream = new FileInputStream(srcPath);

assertTrue(oneMetadata.isForOneFile());
SnowflakeFileTransferAgent.uploadWithoutConnection(
SnowflakeFileTransferConfig.Builder.newInstance()
.setSnowflakeFileTransferMetadata(oneMetadata)
.setUploadStream(inputStream)
.setRequireCompress(true)
.setNetworkTimeoutInMilli(0)
.setOcspMode(OCSPMode.FAIL_OPEN)
.build());
}

assertTrue(
"Failed to get files",
statement.execute(
"GET @" + testStageName + " 'file://" + destFolderCanonicalPath + "/' parallel=8"));
assertTrue(isFileContentEqual(srcPath, false, destFolderCanonicalPath + "/file1.gz", true));
} finally {
statement.execute("DROP STAGE if exists " + testStageName);
}
}
}

@Test
@ConditionalIgnoreRule.ConditionalIgnore(condition = RunningOnGithubAction.class)
public void testUploadWithGCSDownscopedCredentialWithoutConnection() throws Throwable {
Expand Down

0 comments on commit f9db619

Please sign in to comment.