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-1616480: Remove gcs presigned url test since it is not supported #1923

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1470,54 +1470,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
Loading