Permalink
Browse files

Changes to clone fix per code review

  • Loading branch information...
1 parent 1453369 commit acf21679e836d00a53cc3ce9926830621c152927 @pranavkm pranavkm committed Nov 30, 2012
Showing with 60 additions and 2 deletions.
  1. +59 −0 Kudu.FunctionalTests/GitRepositoryManagementTests.cs
  2. +1 −2 Kudu.TestHarness/Git.cs
@@ -40,6 +40,65 @@ public void PushRepoWithMultipleProjectsShouldDeploy()
}
}
+ [Fact(Skip = "Dangerous")]
+ public void PushSimpleWapWithInlineCommand()
+ {
+ // Arrange
+ string repositoryName = "PushSimpleWapWithInlineCommand";
+ string appName = KuduUtils.GetRandomWebsiteName("PushSimpleWapWithInlineCommand");
+ string cloneUrl = "https://github.com/KuduApps/CustomBuildScript.git";
+
+ using (var repo = Git.Clone(repositoryName, cloneUrl))
+ {
+ repo.WriteFile(".deployment", @"
+[config]
+command = msbuild SimpleWebApplication/SimpleWebApplication.csproj /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir=""%DEPLOYMENT_TARGET%"";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Debug;SolutionDir=""%DEPLOYMENT_SOURCE%""");
+ Git.Commit(repo.PhysicalPath, "Custom build command added");
+
+ ApplicationManager.Run(appName, appManager =>
+ {
+ // Act
+ GitDeploymentResult deployResult = appManager.GitDeploy(repo.PhysicalPath);
+ var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList();
+
+ // Assert
+ Assert.Equal(1, results.Count);
+ Assert.Equal(DeployStatus.Success, results[0].Status);
+ KuduAssert.VerifyUrl(appManager.SiteUrl, "DEBUG");
+ });
+ }
+ }
+
+ [Fact(Skip = "Dangerous")]
+ public void PushSimpleWapWithCustomDeploymentScript()
+ {
+ // Arrange
+ string repositoryName = "WapWithCustomDeploymentScript";
+ string appName = KuduUtils.GetRandomWebsiteName("WapWithCustomDeploymentScript");
+ string cloneUrl = "https://github.com/KuduApps/CustomBuildScript.git";
+
+ using (var repo = Git.Clone(repositoryName, cloneUrl))
+ {
+ repo.WriteFile(".deployment", @"
+[config]
+command = deploy.cmd");
+ Git.Commit(repo.PhysicalPath, "Custom build script added");
+
+ ApplicationManager.Run(appName, appManager =>
+ {
+ // Act
+ GitDeploymentResult deployResult = appManager.GitDeploy(repo.PhysicalPath);
+ var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList();
+
+ // Assert
+ Assert.Equal(1, results.Count);
+ Assert.Equal(DeployStatus.Success, results[0].Status);
+ KuduAssert.VerifyUrl(appManager.SiteUrl, "DEBUG");
+ });
+ }
+ }
+
+
[Fact]
public void PushSimpleWapWithFailingCustomDeploymentScript()
{
View
@@ -112,7 +112,6 @@ private static string CreateCachedRepo(string repositoryName, string source, IDi
if (source.IndexOf("github.com", StringComparison.OrdinalIgnoreCase) != -1)
{
// If we're allowed to cache the repository, check if it already exists. If not clone it.
- Trace.WriteLine(String.Format("Checking if a cached copy exists for repository {0}", source));
string repoName = Path.GetFileNameWithoutExtension(source.Split('/').Last());
cachedPath = Path.Combine(PathHelper.RepositoryCachePath, repoName);
if (Directory.Exists(cachedPath))
@@ -121,7 +120,7 @@ private static string CreateCachedRepo(string repositoryName, string source, IDi
}
else
{
- Trace.WriteLine(String.Format("Could not find a cached copy for {0}. Cloning from source {1}.", repositoryName, source));
+ Trace.WriteLine(String.Format("Could not find a cached copy at {0}. Cloning from source {1}.", cachedPath, source));
PathHelper.EnsureDirectory(cachedPath);
gitExe = GetGitExe(cachedPath, environments);
gitExe.Execute("clone \"{0}\" .", source);

0 comments on commit acf2167

Please sign in to comment.