Skip to content

Commit dc1ffcc

Browse files
committed
Merge pull request #780 from dominiqa/dev
Fixes for SQL Replication Cmdlets and tests
2 parents 7da0852 + 116a3ab commit dc1ffcc

38 files changed

+49520
-2531
lines changed

setup/azurecmdfiles.wxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,6 +2077,9 @@
20772077
<Component Id="cmp55FEE041CC305952FE17E655815CE51A" Guid="*">
20782078
<File Id="fil14F4B8C7E95C606DDDE47BE166D9F241" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Commands.Sql.format.ps1xml" />
20792079
</Component>
2080+
<Component Id="cmpF23457BA331434DDB0815F84746FD1E7" Guid="*">
2081+
<File Id="fil1972DDA29C9A5FC7D61122B5F5E1D84B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Commands.Sql.Types.ps1xml" />
2082+
</Component>
20802083
<Component Id="cmp057F4C8C0E8E8DB3E57FD8B64885B30F" Guid="*">
20812084
<File Id="fil17C8016A3D5AA097BE35FB83C7539AB9" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Commands.Tags.dll" />
20822085
</Component>
@@ -5475,6 +5478,7 @@
54755478
<ComponentRef Id="cmp56F52674BB946225BB64533814DCF37F" />
54765479
<ComponentRef Id="cmp499092B04619C0EDE4686B78E1128605" />
54775480
<ComponentRef Id="cmp55FEE041CC305952FE17E655815CE51A" />
5481+
<ComponentRef Id="cmpF23457BA331434DDB0815F84746FD1E7" />
54785482
<ComponentRef Id="cmp057F4C8C0E8E8DB3E57FD8B64885B30F" />
54795483
<ComponentRef Id="cmpC6D3C91080AD47682B7959EF9DF193D3" />
54805484
<ComponentRef Id="cmpD7CC32C127B6074C2D5CA20EAA1B14A0" />

src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ ScriptsToProcess = @()
5555

5656
# Type files (.ps1xml) to be loaded when importing this module
5757
TypesToProcess = @(
58-
'.\Compute\Microsoft.Azure.Commands.Compute.Types.ps1xml'
58+
'.\Compute\Microsoft.Azure.Commands.Compute.Types.ps1xml',
59+
'.\Sql\Microsoft.Azure.Commands.Sql.Types.ps1xml'
5960
)
6061

6162
# Format files (.ps1xml) to be loaded when importing this module

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,12 @@
187187
</Compile>
188188
<Compile Include="ScenarioTests\DatabaseActivationTests.cs" />
189189
<Compile Include="ScenarioTests\DatabaseBackupTests.cs" />
190+
<Compile Include="ScenarioTests\DatabaseReplicationTests.cs" />
190191
<Compile Include="ScenarioTests\DatabaseCrudTests.cs" />
191192
<Compile Include="ScenarioTests\DataMaskingTests.cs" />
193+
<None Include="ScenarioTests\DatabaseReplicationTests.ps1">
194+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
195+
</None>
192196
<None Include="ScenarioTests\LocationCapabilitiesTests.ps1">
193197
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
194198
</None>
@@ -404,6 +408,30 @@
404408
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestDatabaseUpdateV2.json">
405409
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
406410
</None>
411+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateDatabaseCopy.json">
412+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
413+
</None>
414+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateDatabaseCopyV2.json">
415+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
416+
</None>
417+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateSecondaryDatabase.json">
418+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
419+
</None>
420+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateSecondaryDatabaseV2.json">
421+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
422+
</None>
423+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestGetReplicationLink.json">
424+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
425+
</None>
426+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestGetReplicationLinkV2.json">
427+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
428+
</None>
429+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestRemoveSecondaryDatabase.json">
430+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
431+
</None>
432+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestRemoveSecondaryDatabaseV2.json">
433+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
434+
</None>
407435
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DataMaskingTests\TestDatabaseDataMaskingBasicRuleLifecycle.json">
408436
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
409437
</None>

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/Common.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,8 @@ function Get-ElasticPoolName
161161
.SYNOPSIS
162162
Creates a resource group for tests
163163
#>
164-
function Create-ResourceGroupForTest ()
164+
function Create-ResourceGroupForTest ($location = "Japan East")
165165
{
166-
$location = "Japan East"
167166
$rgName = Get-ResourceGroupName
168167

169168
$rg = New-AzureResourceGroup -Name $rgName -Location $location
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
16+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17+
using Xunit;
18+
19+
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
20+
{
21+
public class DatabaseReplicationTests : SqlTestsBase
22+
{
23+
[Fact]
24+
[Trait(Category.AcceptanceType, Category.CheckIn)]
25+
public void TestCreateDatabaseCopy()
26+
{
27+
RunPowerShellTest("Test-CreateDatabaseCopy");
28+
}
29+
30+
[Fact]
31+
[Trait(Category.Sql, Category.CheckIn)]
32+
public void TestCreateDatabaseCopyV2()
33+
{
34+
RunPowerShellTest("Test-CreateDatabaseCopyV2");
35+
}
36+
37+
[Fact]
38+
[Trait(Category.AcceptanceType, Category.CheckIn)]
39+
public void TestCreateSecondaryDatabase()
40+
{
41+
RunPowerShellTest("Test-CreateSecondaryDatabase");
42+
}
43+
44+
[Fact]
45+
[Trait(Category.Sql, Category.CheckIn)]
46+
public void TestCreateSecondaryDatabaseV2()
47+
{
48+
RunPowerShellTest("Test-CreateSecondaryDatabaseV2");
49+
}
50+
51+
[Fact]
52+
[Trait(Category.Sql, Category.CheckIn)]
53+
public void TestGetReplicationLink()
54+
{
55+
RunPowerShellTest("Test-GetReplicationLink");
56+
}
57+
58+
[Fact]
59+
[Trait(Category.Sql, Category.CheckIn)]
60+
public void TestGetReplicationLinkV2()
61+
{
62+
RunPowerShellTest("Test-GetReplicationLinkV2");
63+
}
64+
65+
[Fact]
66+
[Trait(Category.AcceptanceType, Category.CheckIn)]
67+
public void TestRemoveSecondaryDatabase()
68+
{
69+
RunPowerShellTest("Test-RemoveSecondaryDatabase");
70+
}
71+
72+
[Fact]
73+
[Trait(Category.Sql, Category.CheckIn)]
74+
public void TestRemoveSecondaryDatabaseV2()
75+
{
76+
RunPowerShellTest("Test-RemoveSecondaryDatabaseV2");
77+
}
78+
}
79+
}

0 commit comments

Comments
 (0)