Skip to content

Commit

Permalink
Fix to execute test without specified host property in parameters.json
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmartinezramirez committed Mar 27, 2024
1 parent cc44a1b commit af93da0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Snowflake.Data.Tests.IntegrationTests
using Snowflake.Data.Tests.Mock;
using System.Runtime.InteropServices;
using System.Net.Http;
using System.Text.RegularExpressions;

[TestFixture]
class SFConnectionIT : SFBaseTest
Expand Down Expand Up @@ -1551,7 +1552,8 @@ public void TestNonProxyHostShouldBypassProxyServer(string regexHost, string pro
{
using (var conn = new SnowflakeDbConnection())
{
var nonProxyHosts = string.Format(regexHost, $"{testConfig.host}");
var host = ResolveHostToUseFromTestConfig(ConnectionString);
var nonProxyHosts = string.Format(regexHost, $"{host}");
var proxyHostForConnection = proxyHost ?? "proxyserverhost";
conn.ConnectionString =
$"{ConnectionString}USEPROXY=true;PROXYHOST={proxyHostForConnection};NONPROXYHOSTS={nonProxyHosts};PROXYPORT=3128;";
Expand Down Expand Up @@ -1840,6 +1842,11 @@ public void TestKeepAlive()
Assert.Fail();
}
}

private string ResolveHostToUseFromTestConfig(string connectionString)
{
return testConfig.host ?? $"{testConfig.account}.snowflakecomputing.com";
}
}

[TestFixture]
Expand Down Expand Up @@ -2219,6 +2226,7 @@ public void TestNativeOktaSuccess()
Assert.AreEqual(ConnectionState.Open, conn.State);
}
}

}
}

Expand Down

0 comments on commit af93da0

Please sign in to comment.