Skip to content

Commit 9df5168

Browse files
committed
[Test] Check the original deployment has been moved away.
1 parent 58fc58c commit 9df5168

File tree

1 file changed

+17
-1
lines changed
  • src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests

1 file changed

+17
-1
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,29 @@ public void AzureDeploymentTest()
569569
}, "The server encountered an internal error. Please retry the request.", 10, 30);
570570
result = vmPowershellCmdlets.GetAzureDeployment(serviceName, DeploymentSlotType.Production);
571571
pass &= Utilities.PrintAndCompareDeployment(result, serviceName, deploymentName, deploymentLabel, DeploymentSlotType.Production, null, 1);
572-
Console.WriteLine("successfully moved");
572+
Console.WriteLine("successfully moved.");
573573

574574
ExtensionContext extResult1 = vmPowershellCmdlets.GetAzureServiceExtension(serviceName, DeploymentSlotType.Production)[0];
575575
Utilities.PrintContext(extResult1);
576576

577577
Assert.IsTrue(string.Equals(extResult0.Id, extResult1.Id));
578578

579+
// Check until the deployment moving is done, and the staging slot is empty.
580+
Utilities.RetryActionUntilSuccess(() =>
581+
{
582+
try
583+
{
584+
result = vmPowershellCmdlets.GetAzureDeployment(serviceName, DeploymentSlotType.Staging);
585+
Assert.IsNull(result);
586+
}
587+
catch (Exception e)
588+
{
589+
const string errorMessage = "No deployments were found.";
590+
Assert.IsTrue(e.ToString().Contains(errorMessage) || (e.InnerException != null && e.InnerException.ToString().Contains(errorMessage)));
591+
}
592+
}, "Assert", 10, 60);
593+
Console.WriteLine("successfully checked original deployment has been moved away.");
594+
579595
// Re-create the Staging depoyment with the extension
580596
Utilities.RetryActionUntilSuccess(() =>
581597
{

0 commit comments

Comments
 (0)