Skip to content

Commit 8e9f3c0

Browse files
author
Javad
authored
Test | Fix managed instance TVP test source file (#1878)
1 parent 35a029f commit 8e9f3c0

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

BUILDGUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ Manual Tests require the below setup to run:
187187
|IsAzureSynpase | (Optional) When set to 'true', test suite runs compatible tests for Azure Synapse/Parallel Data Warehouse. | `true` OR `false`|
188188
|EnclaveAzureDatabaseConnString | (Optional) Connection string for Azure database with enclaves |
189189
|ManagedIdentitySupported | (Optional) When set to `false` **Managed Identity** related tests won't run. The default value is `true`. |
190+
|IsManagedInstance | (Optional) When set to `true` **TVP** related tests will use on non-Azure bs files to compare test results. this is needed when testing against Managed Instances or TVP Tests will fail on Test set 3. The default value is `false`. |
190191
|PowerShellPath | The full path to PowerShell.exe. This is not required if the path is present in the PATH environment variable. | `D:\\escaped\\absolute\\path\\to\\PowerShell.exe` |
191192

192193
### Commands to run Manual Tests

src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public static class DataTestUtility
7878
private static Dictionary<string, bool> AvailableDatabases;
7979
private static BaseEventListener TraceListener;
8080

81+
public static readonly bool IsManagedInstance = false;
82+
8183
//Kerberos variables
8284
public static readonly string KerberosDomainUser = null;
8385
internal static readonly string KerberosDomainPassword = null;
@@ -114,6 +116,7 @@ static DataTestUtility()
114116
KerberosDomainPassword = c.KerberosDomainPassword;
115117
KerberosDomainUser = c.KerberosDomainUser;
116118
ManagedIdentitySupported = c.ManagedIdentitySupported;
119+
IsManagedInstance = c.IsManagedInstance;
117120

118121
System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;
119122

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpTest.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,25 @@ private void RunTest()
195195
private bool RunTestCoreAndCompareWithBaseline()
196196
{
197197
string outputPath = "SqlParameterTest.out";
198+
string baselinePath;
198199
#if DEBUG
199-
string baselinePath = DataTestUtility.IsNotAzureServer() ? "SqlParameterTest_DebugMode.bsl" : "SqlParameterTest_DebugMode_Azure.bsl";
200+
if (DataTestUtility.IsNotAzureServer() || DataTestUtility.IsManagedInstance)
201+
{
202+
baselinePath = "SqlParameterTest_DebugMode.bsl";
203+
}
204+
else
205+
{
206+
baselinePath = "SqlParameterTest_DebugMode_Azure.bsl";
207+
}
200208
#else
201-
string baselinePath = DataTestUtility.IsNotAzureServer() ? "SqlParameterTest_ReleaseMode.bsl" : "SqlParameterTest_ReleaseMode_Azure.bsl";
209+
if (DataTestUtility.IsNotAzureServer() || DataTestUtility.IsManagedInstance)
210+
{
211+
baselinePath = "SqlParameterTest_ReleaseMode.bsl";
212+
}
213+
else
214+
{
215+
baselinePath = "SqlParameterTest_ReleaseMode_Azure.bsl";
216+
}
202217
#endif
203218

204219
var fstream = new FileStream(outputPath, FileMode.Create, FileAccess.Write, FileShare.Read);

src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/Config.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class Config
4343
public string PowerShellPath = null;
4444
public string KerberosDomainPassword = null;
4545
public string KerberosDomainUser = null;
46+
public bool IsManagedInstance = false;
4647

4748
public static Config Load(string configPath = @"config.json")
4849
{

0 commit comments

Comments
 (0)