private void DoGitPush(ApplicationManager appManager, TestRepository testRepository, string appName, string verificationContent) { appManager.GitDeploy(testRepository.PhysicalPath, "master"); var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList(); if (results[0].Status != Kudu.Core.Deployment.DeployStatus.Success) { string msg = string.Format("Deployment of app {0} failed. Deployment count: {1} . Deployment Status: {2}", appName, results.Count, results[0].Status); throw new ApplicationException(msg); } StressUtils.VerifySite(appManager.SiteUrl, verificationContent); }
private void PushAndVerifyConsoleWorker(ApplicationManager appManager, TestRepository testRepository, string[] expectedVerificationFileLines, int expectedDeployments = 1) { appManager.GitDeploy(testRepository.PhysicalPath); var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList(); Assert.Equal(expectedDeployments, results.Count); for (int i = 0; i < expectedDeployments; i++) { Assert.Equal(DeployStatus.Success, results[i].Status); } var expectedContinuousJob = new ContinuousJob() { Name = "deployedJob", JobType = "continuous", Status = "Running", RunCommand = "ConsoleWorker.exe" }; WaitUntilAssertVerified( "verify continuous job", TimeSpan.FromSeconds(60), () => { ContinuousJob deployedJob = appManager.JobsManager.GetContinuousJobAsync("deployedJob").Result; AssertContinuousJob(expectedContinuousJob, deployedJob); }); WaitUntilAssertVerified( "verification file", TimeSpan.FromSeconds(30), () => { VerifyVerificationFile(appManager, expectedVerificationFileLines); }); }
private static void GitDeployApp(ApplicationManager hookAppManager, TestRepository hookAppRepository) { TestTracer.Trace("Deploy test app"); hookAppManager.GitDeploy(hookAppRepository.PhysicalPath); var deploymentResults = hookAppManager.DeploymentManager.GetResultsAsync().Result.ToList(); Assert.Equal(1, deploymentResults.Count); Assert.Equal(DeployStatus.Success, deploymentResults[0].Status); }