Skip to content

Commit e01757b

Browse files
author
Nicholas King
committed
Fix and re-record slot swap with preview tests
1 parent 610b499 commit e01757b

File tree

4 files changed

+8597
-5
lines changed

4 files changed

+8597
-5
lines changed

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppSlotTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,14 @@ public void TestWebAppRegularSlotSwap()
106106
WebsitesController.NewInstance.RunPsTest("Test-WebAppRegularSlotSwap");
107107
}
108108

109-
[Fact(Skip = "iss#6044 The test needs to be re-written")]
110109
[Trait(Category.AcceptanceType, Category.CheckIn)]
111110
public void TestWebAppSwapWithPreviewResetSlotSwap()
112111
{
113112
WebsitesController.NewInstance.RunPsTest("Test-WebAppSwapWithPreviewResetSlotSwap");
114113
}
115114

116-
[Fact(Skip = "Need service team to re-record test after changes to the ClientRuntime.")]
115+
[Fact]
117116
[Trait(Category.AcceptanceType, Category.CheckIn)]
118-
[Trait("Re-record", "ClientRuntime changes")]
119117
public void TestWebAppSwapWithPreviewCompleteSlotSwap()
120118
{
121119
WebsitesController.NewInstance.RunPsTest("Test-WebAppSwapWithPreviewCompleteSlotSwap");

src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebAppSlotTests.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,13 +886,17 @@ function Test-SlotSwapWithPreview($swapWithPreviewAction)
886886
Switch-AzureRmWebAppSlot -ResourceGroupName $rgname -Name $appname -SourceSlotName $sourceSlotName -DestinationSlotName $destinationSlotName -SwapWithPreviewAction 'ApplySlotConfig'
887887
Wait-Seconds 30
888888
$sourceWebApp = Get-AzureRmWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $sourceSlotName
889-
Validate-SlotSwapAppSetting $sourceWebApp $appSettingName $originalDestinationAppSettingValue
889+
Validate-SlotSwapAppSetting $sourceWebApp $appSettingName $originalSourceAppSettingValue
890890

891891
# Let's finish the current slot swap operation (complete or reset)
892892
Switch-AzureRmWebAppSlot -ResourceGroupName $rgname -Name $appname -SourceSlotName $sourceSlotName -DestinationSlotName $destinationSlotName -SwapWithPreviewAction $swapWithPreviewAction
893893
Wait-Seconds 30
894894
$sourceWebApp = Get-AzureRmWebAppSlot -ResourceGroupName $rgname -Name $appname -Slot $sourceSlotName
895-
#Validate-SlotSwapAppSetting $sourceWebApp $appSettingName $originalSourceAppSettingValue
895+
If ($swapWithPreviewAction -eq 'ResetSlotSwap') {
896+
Validate-SlotSwapAppSetting $sourceWebApp $appSettingName $originalSourceAppSettingValue
897+
} Else {
898+
Validate-SlotSwapAppSetting $sourceWebApp $appSettingName $originalDestinationAppSettingValue
899+
}
896900
}
897901
finally
898902
{

src/ResourceManager/Websites/Commands.Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests/TestWebAppSwapWithPreviewCompleteSlotSwap.json

Lines changed: 4400 additions & 0 deletions
Large diffs are not rendered by default.

src/ResourceManager/Websites/Commands.Websites.Test/SessionRecords/Microsoft.Azure.Commands.Websites.Test.ScenarioTests.WebAppSlotTests/TestWebAppSwapWithPreviewResetSlotSwap.json

Lines changed: 4190 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)