mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Remove unused test server types (#1699)
* Remove unused test server types * Don't use secure file * Correct password
This commit is contained in:
@@ -14,10 +14,10 @@ steps:
|
|||||||
- script: docker pull mcr.microsoft.com/mssql/server:2022-latest
|
- script: docker pull mcr.microsoft.com/mssql/server:2022-latest
|
||||||
displayName: Pull MSSQL Docker Image
|
displayName: Pull MSSQL Docker Image
|
||||||
|
|
||||||
- bash: echo "##vso[task.setvariable variable=defaultSql2022_password;issecret=true]Test-$(Build.BuildNumber)-$(Get-Date -format yyyyMMdd-Hmmss)"
|
- bash: echo "##vso[task.setvariable variable=sqlOnPrem_password;issecret=true]Test-$(Build.BuildNumber)-$(Get-Date -format yyyyMMdd-Hmmss)"
|
||||||
displayName: Generate password for test server
|
displayName: Generate password for test server
|
||||||
|
|
||||||
- script: 'docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=$(defaultSql2022_password)" -e "MSSQL_AGENT_ENABLED=True" -p 1433:1433 --name sql1 -h sql1 -d mcr.microsoft.com/mssql/server:2022-latest'
|
- script: 'docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=$(sqlOnPrem_password)" -e "MSSQL_AGENT_ENABLED=True" -p 1433:1433 --name sql1 -h sql1 -d mcr.microsoft.com/mssql/server:2022-latest'
|
||||||
displayName: Starting Server in Docker Container
|
displayName: Starting Server in Docker Container
|
||||||
|
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
@@ -37,21 +37,25 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
projects: '**/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj'
|
projects: '**/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj'
|
||||||
|
|
||||||
- task: DownloadSecureFile@1
|
- bash: 'echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||||
displayName: Download Test Environment Configuration
|
<Instances>
|
||||||
name: testEnvironmentPath
|
<Instance VersionKey=\"sqlOnPrem\">
|
||||||
inputs:
|
<DataSource>localhost</DataSource>
|
||||||
secureFile: 'SQLConnectionInstances.xml'
|
<UserId>sa</UserId>
|
||||||
|
<Password></Password>
|
||||||
|
</Instance>
|
||||||
|
</Instances>" > test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/SQLConnectionInstances.xml'
|
||||||
|
displayName: 'Writing test environment config file'
|
||||||
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: DotNetCoreCLI@2
|
||||||
displayName: Setting Up Test Environment
|
displayName: Setting Up Test Environment
|
||||||
inputs:
|
inputs:
|
||||||
command: run
|
command: run
|
||||||
projects: '**/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj'
|
projects: 'test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj'
|
||||||
arguments: $(testEnvironmentPath.secureFilePath)
|
arguments: 'test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/SQLConnectionInstances.xml'
|
||||||
testRunTitle: 'Setting tests'
|
testRunTitle: 'Setting tests'
|
||||||
env:
|
env:
|
||||||
defaultSql2022_password: '$(defaultSql2022_password)'
|
sqlOnPrem_password: '$(sqlOnPrem_password)'
|
||||||
|
|
||||||
- task: AzureKeyVault@1
|
- task: AzureKeyVault@1
|
||||||
displayName: 'Azure Key Vault: SqlToolsSecretStore'
|
displayName: 'Azure Key Vault: SqlToolsSecretStore'
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
/// "user": "sa",
|
/// "user": "sa",
|
||||||
/// "password": "[putvaluehere]",
|
/// "password": "[putvaluehere]",
|
||||||
/// "serverType":"OnPrem",
|
/// "serverType":"OnPrem",
|
||||||
/// "VersionKey": "defaultSql2016"
|
/// "VersionKey": "sqlOnPrem"
|
||||||
/// }
|
/// }
|
||||||
/// ]
|
/// ]
|
||||||
/// }
|
/// }
|
||||||
|
|||||||
@@ -21,19 +21,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
private static Dictionary<string, InstanceInfo> connectionProfilesCache = new Dictionary<string, InstanceInfo>();
|
private static Dictionary<string, InstanceInfo> connectionProfilesCache = new Dictionary<string, InstanceInfo>();
|
||||||
private static TestConnectionProfileService instance = new TestConnectionProfileService();
|
private static TestConnectionProfileService instance = new TestConnectionProfileService();
|
||||||
|
|
||||||
public const string DefaultSql2005InstanceKey = "defaultSql2005";
|
public const string SqlAzureInstanceKey = "sqlAzure";
|
||||||
public const string DefaultSql2008InstanceKey = "defaultSql2008";
|
public const string SqlOnPremInstanceKey = "sqlOnPrem";
|
||||||
public const string DefaultSql2011InstanceKey = "defaultSql2011";
|
|
||||||
public const string DefaultSql2012Pcu1InstanceKey = "defaultSql2012pcu1";
|
|
||||||
public const string DefaultSql2014InstanceKey = "defaultSql2014";
|
|
||||||
public const string DefaultSqlAzureInstanceKey = "defaultSqlAzure";
|
|
||||||
public const string DefaultServerlessInstanceKey = "defaultServerless";
|
|
||||||
public const string DefaultSqlPdwInstanceKey = "defaultSqlPdw";
|
|
||||||
public const string DefaultSqlAzureV12InstanceKey = "defaultSqlAzureV12";
|
|
||||||
public const string DefaultSql2016InstanceKey = "defaultSql2016";
|
|
||||||
public const string DefaultSql2019InstanceKey = "defaultSql2019";
|
|
||||||
public const string DefaultSql2022InstanceKey = "defaultSql2022";
|
|
||||||
public const string DefaultSqlvNextInstanceKey = "defaultSqlvNext";
|
|
||||||
|
|
||||||
private TestConnectionProfileService()
|
private TestConnectionProfileService()
|
||||||
{
|
{
|
||||||
@@ -48,44 +37,14 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InstanceInfo DefaultSql2012Pcu1
|
public static InstanceInfo SqlAzure
|
||||||
{
|
{
|
||||||
get { return GetInstance(DefaultSql2012Pcu1InstanceKey); }
|
get { return GetInstance(SqlAzureInstanceKey); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InstanceInfo DefaultSql2014
|
public static InstanceInfo SqlOnPrem
|
||||||
{
|
{
|
||||||
get { return GetInstance(DefaultSql2014InstanceKey); }
|
get { return GetInstance(SqlOnPremInstanceKey); }
|
||||||
}
|
|
||||||
|
|
||||||
public static InstanceInfo DefaultSqlAzure
|
|
||||||
{
|
|
||||||
get { return GetInstance(DefaultSqlAzureInstanceKey); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static InstanceInfo DefaultSqlAzureV12
|
|
||||||
{
|
|
||||||
get { return GetInstance(DefaultSqlAzureV12InstanceKey); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static InstanceInfo DefaultSql2016
|
|
||||||
{
|
|
||||||
get { return GetInstance(DefaultSql2016InstanceKey); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static InstanceInfo DefaultSql2019
|
|
||||||
{
|
|
||||||
get { return GetInstance(DefaultSql2019InstanceKey); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static InstanceInfo DefaultSql2022
|
|
||||||
{
|
|
||||||
get { return GetInstance(DefaultSql2022InstanceKey); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static InstanceInfo DefaultSqlvNext
|
|
||||||
{
|
|
||||||
get { return GetInstance(DefaultSqlvNextInstanceKey); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -99,7 +58,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
return instanceInfo;
|
return instanceInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConnectParams GetConnectionParameters(string key = DefaultSql2022InstanceKey, string databaseName = null)
|
public ConnectParams GetConnectionParameters(string key = SqlOnPremInstanceKey, string databaseName = null)
|
||||||
{
|
{
|
||||||
InstanceInfo instanceInfo = GetInstance(key);
|
InstanceInfo instanceInfo = GetInstance(key);
|
||||||
if (instanceInfo != null)
|
if (instanceInfo != null)
|
||||||
@@ -192,7 +151,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
|
|
||||||
private static string ConvertServerTypeToVersionKey(TestServerType serverType)
|
private static string ConvertServerTypeToVersionKey(TestServerType serverType)
|
||||||
{
|
{
|
||||||
return serverType == TestServerType.OnPrem ? DefaultSql2022InstanceKey : DefaultSqlAzureV12InstanceKey;
|
return serverType == TestServerType.OnPrem ? SqlOnPremInstanceKey : SqlAzureInstanceKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -214,7 +173,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
|
|||||||
connectParams.Connection.DatabaseName = databaseName;
|
connectParams.Connection.DatabaseName = databaseName;
|
||||||
connectParams.Connection.DatabaseDisplayName = databaseName;
|
connectParams.Connection.DatabaseDisplayName = databaseName;
|
||||||
}
|
}
|
||||||
if (key == DefaultSqlAzureInstanceKey || key == DefaultSqlAzureV12InstanceKey)
|
if (key == SqlAzureInstanceKey || key == SqlAzureInstanceKey)
|
||||||
{
|
{
|
||||||
connectParams.Connection.ConnectTimeout = 30;
|
connectParams.Connection.ConnectTimeout = 30;
|
||||||
connectParams.Connection.Encrypt = true;
|
connectParams.Connection.Encrypt = true;
|
||||||
|
|||||||
@@ -67,23 +67,13 @@ namespace Microsoft.SqlTools.ServiceLayer.TestEnvConfig
|
|||||||
The following is an example of a setting_file:
|
The following is an example of a setting_file:
|
||||||
|
|
||||||
<Configuration>
|
<Configuration>
|
||||||
<Instance Name=""defaultSql2005"">
|
<Instance Name=""sqlOnPrem"">
|
||||||
<DataSource>SQL2005 servername</DataSource>
|
<DataSource>SQL On-Prem servername</DataSource>
|
||||||
<BackupMethod>RemoteShare</BackupMethod>
|
<BackupMethod>RemoteShare</BackupMethod>
|
||||||
<RemoteShare>SQL 2005 remote share</RemoteShare>
|
<RemoteShare>SQL remote share</RemoteShare>
|
||||||
</Instance>
|
</Instance>
|
||||||
<Instance Name=""defaultSql2008"">
|
<Instance Name=""sqlAzure"">
|
||||||
<DataSource>SQL2008 servername</DataSource>
|
<DataSource>SQL Azure servername</DataSource>
|
||||||
<BackupMethod>RemoteShare</BackupMethod>
|
|
||||||
<RemoteShare>SQL 2008 remote share</RemoteShare>
|
|
||||||
</Instance>
|
|
||||||
<Instance Name=""defaultSql2011"">
|
|
||||||
<DataSource>SQL2011 servername</DataSource>
|
|
||||||
<BackupMethod>RemoteShare</BackupMethod>
|
|
||||||
<RemoteShare>SQL 20011 remote share</RemoteShare>
|
|
||||||
</Instance>
|
|
||||||
<Instance Name=""defaultSqlAzureV12"">
|
|
||||||
<DataSource>SQLAzure servername</DataSource>
|
|
||||||
<BackupMethod>RemoteShare</BackupMethod>
|
<BackupMethod>RemoteShare</BackupMethod>
|
||||||
<RemoteShare>SQLAzure remote share</RemoteShare>
|
<RemoteShare>SQLAzure remote share</RemoteShare>
|
||||||
<UserId>user id</UserId>
|
<UserId>user id</UserId>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Instances>
|
<Instances>
|
||||||
<Instance VersionKey="defaultSql2022">
|
<Instance VersionKey="sqlOnPrem">
|
||||||
<DataSource>[server name]</DataSource>
|
<DataSource>[server name]</DataSource>
|
||||||
<UserId>[user name for SQL authentication]</UserId>
|
<UserId>[user name for SQL authentication]</UserId>
|
||||||
<Password>[password for SQL authentication]</Password>
|
<Password>[password for SQL authentication]</Password>
|
||||||
</Instance>
|
</Instance>
|
||||||
<Instance VersionKey="defaultSqlAzureV12">
|
<Instance VersionKey="sqlAzure">
|
||||||
<DataSource>[server name]</DataSource>
|
<DataSource>[server name]</DataSource>
|
||||||
<UserId>[user name for SQL authentication]</UserId>
|
<UserId>[user name for SQL authentication]</UserId>
|
||||||
<Password>[password for SQL authentication]</Password>
|
<Password>[password for SQL authentication]</Password>
|
||||||
|
|||||||
Reference in New Issue
Block a user