Skip to content
This repository
Browse code

Changes to clone fix per code review

  • Loading branch information...
commit acf21679e836d00a53cc3ce9926830621c152927 1 parent 1453369
Pranav K authored November 30, 2012
59  Kudu.FunctionalTests/GitRepositoryManagementTests.cs
@@ -40,6 +40,65 @@ public void PushRepoWithMultipleProjectsShouldDeploy()
40 40
             }
41 41
         }
42 42
 
  43
+        [Fact(Skip = "Dangerous")]
  44
+        public void PushSimpleWapWithInlineCommand()
  45
+        {
  46
+            // Arrange
  47
+            string repositoryName = "PushSimpleWapWithInlineCommand";
  48
+            string appName = KuduUtils.GetRandomWebsiteName("PushSimpleWapWithInlineCommand");
  49
+            string cloneUrl = "https://github.com/KuduApps/CustomBuildScript.git";
  50
+
  51
+            using (var repo = Git.Clone(repositoryName, cloneUrl))
  52
+            {
  53
+                repo.WriteFile(".deployment", @"
  54
+[config]
  55
+command = msbuild SimpleWebApplication/SimpleWebApplication.csproj /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir=""%DEPLOYMENT_TARGET%"";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Debug;SolutionDir=""%DEPLOYMENT_SOURCE%""");
  56
+                Git.Commit(repo.PhysicalPath, "Custom build command added");
  57
+
  58
+                ApplicationManager.Run(appName, appManager =>
  59
+                {
  60
+                    // Act
  61
+                    GitDeploymentResult deployResult = appManager.GitDeploy(repo.PhysicalPath);
  62
+                    var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList();
  63
+
  64
+                    // Assert
  65
+                    Assert.Equal(1, results.Count);
  66
+                    Assert.Equal(DeployStatus.Success, results[0].Status);
  67
+                    KuduAssert.VerifyUrl(appManager.SiteUrl, "DEBUG");
  68
+                });
  69
+            }
  70
+        }
  71
+
  72
+        [Fact(Skip = "Dangerous")]
  73
+        public void PushSimpleWapWithCustomDeploymentScript()
  74
+        {
  75
+            // Arrange
  76
+            string repositoryName = "WapWithCustomDeploymentScript";
  77
+            string appName = KuduUtils.GetRandomWebsiteName("WapWithCustomDeploymentScript");
  78
+            string cloneUrl = "https://github.com/KuduApps/CustomBuildScript.git";
  79
+
  80
+            using (var repo = Git.Clone(repositoryName, cloneUrl))
  81
+            {
  82
+                repo.WriteFile(".deployment", @"
  83
+[config]
  84
+command = deploy.cmd");
  85
+                Git.Commit(repo.PhysicalPath, "Custom build script added");
  86
+
  87
+                ApplicationManager.Run(appName, appManager =>
  88
+                {
  89
+                    // Act
  90
+                    GitDeploymentResult deployResult = appManager.GitDeploy(repo.PhysicalPath);
  91
+                    var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList();
  92
+
  93
+                    // Assert
  94
+                    Assert.Equal(1, results.Count);
  95
+                    Assert.Equal(DeployStatus.Success, results[0].Status);
  96
+                    KuduAssert.VerifyUrl(appManager.SiteUrl, "DEBUG");
  97
+                });
  98
+            }
  99
+        }
  100
+
  101
+
43 102
         [Fact]
44 103
         public void PushSimpleWapWithFailingCustomDeploymentScript()
45 104
         {
3  Kudu.TestHarness/Git.cs
@@ -112,7 +112,6 @@ private static string CreateCachedRepo(string repositoryName, string source, IDi
112 112
             if (source.IndexOf("github.com", StringComparison.OrdinalIgnoreCase) != -1)
113 113
             {
114 114
                 // If we're allowed to cache the repository, check if it already exists. If not clone it.
115  
-                Trace.WriteLine(String.Format("Checking if a cached copy exists for repository {0}", source));
116 115
                 string repoName = Path.GetFileNameWithoutExtension(source.Split('/').Last());
117 116
                 cachedPath = Path.Combine(PathHelper.RepositoryCachePath, repoName);
118 117
                 if (Directory.Exists(cachedPath))
@@ -121,7 +120,7 @@ private static string CreateCachedRepo(string repositoryName, string source, IDi
121 120
                 }
122 121
                 else
123 122
                 {
124  
-                    Trace.WriteLine(String.Format("Could not find a cached copy for {0}. Cloning from source {1}.", repositoryName, source));
  123
+                    Trace.WriteLine(String.Format("Could not find a cached copy at {0}. Cloning from source {1}.", cachedPath, source));
125 124
                     PathHelper.EnsureDirectory(cachedPath);
126 125
                     gitExe = GetGitExe(cachedPath, environments);
127 126
                     gitExe.Execute("clone \"{0}\" .", source);

0 notes on commit acf2167

Please sign in to comment.
Something went wrong with that request. Please try again.