Skip to content

Commit

Permalink
SNOW-1672654 fix 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dstempniak committed Oct 28, 2024
1 parent a738b8e commit b2e816f
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Snowflake.Data.Tests/IntegrationTests/SFPutGetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public enum StageType
{
USER,
TABLE,
NAMED,
NAMED_SSE // without client side encryption
NAMED
}

[OneTimeSetUp]
Expand Down Expand Up @@ -510,7 +509,7 @@ public void TestPutDirectoryMixedWildcard()
[Test]
public void TestPutGetCommand(
[Values("none", "gzip", "bzip2", "brotli", "deflate", "raw_deflate", "zstd")] string sourceFileCompressionType,
[Values(StageType.USER, StageType.TABLE, StageType.NAMED)] StageType stageType,
[Values] StageType stageType,
[Values("", "/TEST_PATH", "/DEEP/TEST_PATH")] string stagePath,
[Values] bool autoCompress)
{
Expand All @@ -527,13 +526,12 @@ public void TestPutGetCommand(

[Test]
[IgnoreOnEnvIs("snowflake_cloud_env", new [] { "GCP", "AZURE" })]
public void TestPutGetCommandWithoutClientSideEncryption(
public void TestPutGetCommandForNamedStageWithoutClientSideEncryption(
[Values("none", "gzip", "bzip2", "brotli", "deflate", "raw_deflate", "zstd")] string sourceFileCompressionType,
[Values(StageType.NAMED_SSE)] StageType stageType,
[Values("", "/TEST_PATH", "/DEEP/TEST_PATH")] string stagePath,
[Values] bool autoCompress)
{
PrepareTest(sourceFileCompressionType, stageType, stagePath, autoCompress);
PrepareTest(sourceFileCompressionType, StageType.NAMED, stagePath, autoCompress, false);

using (var conn = new SnowflakeDbConnection(ConnectionString))
{
Expand Down Expand Up @@ -563,7 +561,8 @@ public void TestPutGetGcsDownscopedCredential(
}
}

private void PrepareTest(string sourceFileCompressionType, StageType stageType, string stagePath, bool autoCompress)
private void PrepareTest(string sourceFileCompressionType, StageType stageType, string stagePath,
bool autoCompress, bool clientEncryption = true)
{
t_stageType = stageType;
t_sourceCompressionType = sourceFileCompressionType;
Expand Down Expand Up @@ -596,10 +595,9 @@ private void PrepareTest(string sourceFileCompressionType, StageType stageType,
t_internalStagePath = $"@{t_schemaName}.%{t_tableName}{stagePath}";
break;
case StageType.NAMED:
t_internalStagePath = $"@{t_schemaName}.{t_stageName}{stagePath}";
break;
case StageType.NAMED_SSE:
t_internalStagePath = $"@{t_schemaName}.{t_stageNameSse}{stagePath}";
t_internalStagePath = clientEncryption
? $"@{t_schemaName}.{t_stageName}{stagePath}"
: $"@{t_schemaName}.{t_stageNameSse}{stagePath}";
break;
}
}
Expand Down

0 comments on commit b2e816f

Please sign in to comment.