Skip to content

Commit

Permalink
Test | Fix managed instance TVP test source file (#1878)
Browse files Browse the repository at this point in the history
  • Loading branch information
JRahnama committed Jan 17, 2023
1 parent 35a029f commit 8e9f3c0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions BUILDGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ Manual Tests require the below setup to run:
|IsAzureSynpase | (Optional) When set to 'true', test suite runs compatible tests for Azure Synapse/Parallel Data Warehouse. | `true` OR `false`|
|EnclaveAzureDatabaseConnString | (Optional) Connection string for Azure database with enclaves |
|ManagedIdentitySupported | (Optional) When set to `false` **Managed Identity** related tests won't run. The default value is `true`. |
|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`. |
|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` |

### Commands to run Manual Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public static class DataTestUtility
private static Dictionary<string, bool> AvailableDatabases;
private static BaseEventListener TraceListener;

public static readonly bool IsManagedInstance = false;

//Kerberos variables
public static readonly string KerberosDomainUser = null;
internal static readonly string KerberosDomainPassword = null;
Expand Down Expand Up @@ -114,6 +116,7 @@ static DataTestUtility()
KerberosDomainPassword = c.KerberosDomainPassword;
KerberosDomainUser = c.KerberosDomainUser;
ManagedIdentitySupported = c.ManagedIdentitySupported;
IsManagedInstance = c.IsManagedInstance;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,25 @@ private void RunTest()
private bool RunTestCoreAndCompareWithBaseline()
{
string outputPath = "SqlParameterTest.out";
string baselinePath;
#if DEBUG
string baselinePath = DataTestUtility.IsNotAzureServer() ? "SqlParameterTest_DebugMode.bsl" : "SqlParameterTest_DebugMode_Azure.bsl";
if (DataTestUtility.IsNotAzureServer() || DataTestUtility.IsManagedInstance)
{
baselinePath = "SqlParameterTest_DebugMode.bsl";
}
else
{
baselinePath = "SqlParameterTest_DebugMode_Azure.bsl";
}
#else
string baselinePath = DataTestUtility.IsNotAzureServer() ? "SqlParameterTest_ReleaseMode.bsl" : "SqlParameterTest_ReleaseMode_Azure.bsl";
if (DataTestUtility.IsNotAzureServer() || DataTestUtility.IsManagedInstance)
{
baselinePath = "SqlParameterTest_ReleaseMode.bsl";
}
else
{
baselinePath = "SqlParameterTest_ReleaseMode_Azure.bsl";
}
#endif

var fstream = new FileStream(outputPath, FileMode.Create, FileAccess.Write, FileShare.Read);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class Config
public string PowerShellPath = null;
public string KerberosDomainPassword = null;
public string KerberosDomainUser = null;
public bool IsManagedInstance = false;

public static Config Load(string configPath = @"config.json")
{
Expand Down

0 comments on commit 8e9f3c0

Please sign in to comment.