Permalink
Browse files

* Changing ApplicationManager.Run to create a dump file for individua…

…l tests

* Cleanup the log file directory during app cleanup.
  • Loading branch information...
1 parent e69e658 commit 32cf6bdf2f1d768bf8fdb322e8105927ff37a6d2 @pranavkm pranavkm committed Jan 17, 2013
@@ -13,6 +13,7 @@ public interface IEnvironment
string TempPath { get; }
string ScriptPath { get; }
string NodeModulesPath { get; }
+ string LogFilesPath { get; } // e.g. /logfiles
string TracePath { get; } // e.g. /logfiles/git/trace
string DeploymentTracePath { get; } // e.g. /logfiles/git/deployment
}
View
@@ -16,6 +16,7 @@ public class Environment : IEnvironment
private readonly string _scriptPath;
private readonly string _nodeModulesPath;
private readonly string _repositoryPath;
+ private readonly string _logFilesPath;
private readonly string _tracePath;
private readonly string _deploymentTracePath;
@@ -52,6 +53,7 @@ public class Environment : IEnvironment
_sshKeyPath = sshKeyPath;
_scriptPath = scriptPath;
_nodeModulesPath = nodeModulesPath;
+ _logFilesPath = Path.Combine(rootPath, Constants.LogFilesPath);
_tracePath = Path.Combine(rootPath, Constants.TracePath);
_deploymentTracePath = Path.Combine(rootPath, Constants.DeploymentTracePath);
}
@@ -137,6 +139,14 @@ public string NodeModulesPath
}
}
+ public string LogFilesPath
+ {
+ get
+ {
+ return _logFilesPath;
+ }
+ }
+
public string TracePath
{
get
@@ -22,7 +22,7 @@ public class DeploymentManagerTests
[Fact]
public void DeploymentApisReturn404IfDeploymentIdDoesntExist()
{
- string appName = KuduUtils.GetRandomWebsiteName("Rtn404IfDeployIdNotExist");
+ string appName = "Rtn404IfDeployIdNotExist";
ApplicationManager.Run(appName, appManager =>
{
@@ -52,7 +52,7 @@ public void DeploymentApis()
{
// Arrange
- string appName = KuduUtils.GetRandomWebsiteName("DeploymentApis");
+ string appName = "DeploymentApis";
using (var repo = Git.Clone("HelloWorld"))
{
@@ -135,7 +135,7 @@ public void DeploymentManagerExtensibility()
{
// Arrange
string repositoryName = "Mvc3Application";
- string appName = KuduUtils.GetRandomWebsiteName("DeploymentApis");
+ string appName = "DeploymentApis";
using (var repo = Git.CreateLocalRepository(repositoryName))
{
@@ -159,7 +159,7 @@ public void DeploymentManagerExtensibility()
public void DeleteKuduSiteCleansEverything()
{
// Arrange
- string appName = KuduUtils.GetRandomWebsiteName("DeleteKuduSiteCleansEverything");
+ string appName = "DeleteKuduSiteCleansEverything";
using (var repo = Git.Clone("HelloWorld"))
{
@@ -186,7 +186,7 @@ public void DeleteKuduSiteCleansEverything()
public void PullApiTestGitHubFormat()
{
string githubPayload = @"{ ""after"": ""7e2a599e2d28665047ec347ab36731c905c95e8b"", ""before"": ""7e2a599e2d28665047ec347ab36731c905c95e8b"", ""commits"": [ { ""added"": [], ""author"": { ""email"": ""prkrishn@hotmail.com"", ""name"": ""Pranav K"", ""username"": ""pranavkm"" }, ""id"": ""43acf30efa8339103e2bed5c6da1379614b00572"", ""message"": ""Changes from master again"", ""modified"": [ ""Hello.txt"" ], ""timestamp"": ""2012-12-17T17:32:15-08:00"" } ], ""compare"": ""https://github.com/KuduApps/GitHookTest/compare/7e2a599e2d28...7e2a599e2d28"", ""created"": false, ""deleted"": false, ""forced"": false, ""head_commit"": { ""added"": [ "".gitignore"", ""SimpleWebApplication.sln"", ""SimpleWebApplication/About.aspx"", ""SimpleWebApplication/About.aspx.cs"", ""SimpleWebApplication/About.aspx.designer.cs"", ""SimpleWebApplication/Account/ChangePassword.aspx"", ""SimpleWebApplication/Account/ChangePassword.aspx.cs"", ""SimpleWebApplication/Account/ChangePassword.aspx.designer.cs"", ""SimpleWebApplication/Account/ChangePasswordSuccess.aspx"", ""SimpleWebApplication/Account/ChangePasswordSuccess.aspx.cs"", ""SimpleWebApplication/Account/ChangePasswordSuccess.aspx.designer.cs"", ""SimpleWebApplication/Account/Login.aspx"", ""SimpleWebApplication/Account/Login.aspx.cs"", ""SimpleWebApplication/Account/Login.aspx.designer.cs"", ""SimpleWebApplication/Account/Register.aspx"", ""SimpleWebApplication/Account/Register.aspx.cs"", ""SimpleWebApplication/Account/Register.aspx.designer.cs"", ""SimpleWebApplication/Account/Web.config"", ""SimpleWebApplication/Default.aspx"", ""SimpleWebApplication/Default.aspx.cs"", ""SimpleWebApplication/Default.aspx.designer.cs"", ""SimpleWebApplication/Global.asax"", ""SimpleWebApplication/Global.asax.cs"", ""SimpleWebApplication/Properties/AssemblyInfo.cs"", ""SimpleWebApplication/Scripts/jquery-1.4.1-vsdoc.js"", ""SimpleWebApplication/Scripts/jquery-1.4.1.js"", ""SimpleWebApplication/Scripts/jquery-1.4.1.min.js"", ""SimpleWebApplication/SimpleWebApplication.csproj"", ""SimpleWebApplication/Site.Master"", ""SimpleWebApplication/Site.Master.cs"", ""SimpleWebApplication/Site.Master.designer.cs"", ""SimpleWebApplication/Styles/Site.css"", ""SimpleWebApplication/Web.Debug.config"", ""SimpleWebApplication/Web.Release.config"", ""SimpleWebApplication/Web.config"" ], ""author"": { ""email"": ""david.ebbo@microsoft.com"", ""name"": ""davidebbo"", ""username"": ""davidebbo"" }, ""committer"": { ""email"": ""david.ebbo@microsoft.com"", ""name"": ""davidebbo"", ""username"": ""davidebbo"" }, ""distinct"": false, ""id"": ""7e2a599e2d28665047ec347ab36731c905c95e8b"", ""message"": ""Initial"", ""modified"": [], ""removed"": [], ""timestamp"": ""2011-11-21T23:07:42-08:00"", ""url"": ""https://github.com/KuduApps/GitHookTest/commit/7e2a599e2d28665047ec347ab36731c905c95e8b"" }, ""pusher"": { ""name"": ""none"" }, ""ref"": ""refs/heads/master"", ""repository"": { ""created_at"": ""2012-06-28T00:07:55-07:00"", ""description"": """", ""fork"": false, ""forks"": 1, ""has_downloads"": true, ""has_issues"": true, ""has_wiki"": true, ""language"": ""ASP"", ""name"": ""GitHookTest"", ""open_issues"": 0, ""organization"": ""KuduApps"", ""owner"": { ""email"": ""kuduapps@hotmail.com"", ""name"": ""KuduApps"" }, ""private"": false, ""pushed_at"": ""2012-06-28T00:11:48-07:00"", ""size"": 188, ""url"": ""https://github.com/KuduApps/SimpleWebApplication"", ""watchers"": 1 } }";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestGitHubFormat");
+ string appName = "PullApiTestGitHubFormat";
ApplicationManager.Run(appName, appManager =>
{
@@ -212,7 +212,7 @@ public void PullApiTestGitHubFormat()
public void PullApiTestBitbucketFormat()
{
string bitbucketPayload = @"{ ""canon_url"": ""https://github.com"", ""commits"": [ { ""author"": ""davidebbo"", ""branch"": ""master"", ""files"": [ { ""file"": ""Mvc3Application/Views/Home/Index.cshtml"", ""type"": ""modified"" } ], ""message"": ""Blah2\n"", ""node"": ""e550351c5188"", ""parents"": [ ""297fcc65308c"" ], ""raw_author"": ""davidebbo <david.ebbo@microsoft.com>"", ""raw_node"": ""ea1c6d7ea669c816dd5f86206f7b47b228fdcacd"", ""revision"": null, ""size"": -1, ""timestamp"": ""2012-09-20 03:11:20"", ""utctimestamp"": ""2012-09-20 01:11:20+00:00"" } ], ""repository"": { ""absolute_url"": ""/KuduApps/SimpleWebApplication"", ""fork"": false, ""is_private"": false, ""name"": ""Mvc3Application"", ""owner"": ""davidebbo"", ""scm"": ""git"", ""slug"": ""mvc3application"", ""website"": """" }, ""user"": ""davidebbo"" }";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestBitbucketFormat");
+ string appName = "PullApiTestBitbucketFormat";
ApplicationManager.Run(appName, appManager =>
{
@@ -239,7 +239,7 @@ public void PullApiTestBitbucketFormat()
public void PullApiTestBitbucketFormatWithMercurial()
{
string bitbucketPayload = @"{""canon_url"":""https://bitbucket.org"",""commits"":[{""author"":""pranavkm"",""branch"":""default"",""files"":[{""file"":""Hello.txt"",""type"":""modified""}],""message"":""Some more changes"",""node"":""0bbefd70c4c4"",""parents"":[""3cb8bf8aec0a""],""raw_author"":""Pranav <pranavkm@outlook.com>"",""raw_node"":""0bbefd70c4c4213bba1e91998141f6e861cec24d"",""revision"":4,""size"":-1,""timestamp"":""2012-12-17 19:41:28"",""utctimestamp"":""2012-12-17 18:41:28+00:00""}],""repository"":{""absolute_url"":""/kudutest/hellomercurial/"",""fork"":false,""is_private"":false,""name"":""HelloMercurial"",""owner"":""kudutest"",""scm"":""hg"",""slug"":""hellomercurial"",""website"":""""},""user"":""kudutest""}";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestBitbucketFormatWithMercurial");
+ string appName = "PullApiTestBitbucketFormatWithMercurial";
ApplicationManager.Run(appName, appManager =>
{
@@ -268,7 +268,7 @@ public void PullApiTestBitbucketFormatWithMercurial()
public void PullApiTestBitbucketFormatWithPrivateMercurialRepository()
{
string bitbucketPayload = @"{ ""canon_url"": ""https://bitbucket.org"", ""commits"": [ { ""author"": ""pranavkm"", ""branch"": ""Test-Branch"", ""files"": [ { ""file"": ""Hello.txt"", ""type"": ""modified"" } ], ""message"": ""Hello Mercurial! change"", ""node"": ""ee26963f2e54"", ""parents"": [ ""16ea3237dbcd"" ], ""raw_author"": ""Pranav <pranavkm@outlook.com>"", ""raw_node"": ""ee26963f2e54b9db5c0cd160600b29c4f7a7eff7"", ""revision"": 10, ""size"": -1, ""timestamp"": ""2012-12-24 18:22:14"", ""utctimestamp"": ""2012-12-24 17:22:14+00:00"" } ], ""repository"": { ""absolute_url"": ""/kudutest/privatemercurial/"", ""fork"": false, ""is_private"": true, ""name"": ""PrivateMercurial"", ""owner"": ""kudutest"", ""scm"": ""hg"", ""slug"": ""privatemercurial"", ""website"": """" }, ""user"": ""kudutest"" }";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestBitbucketFormatWithMercurial");
+ string appName = "PullApiTestBitbucketFormatWithMercurial";
ApplicationManager.Run(appName, appManager =>
{
@@ -301,7 +301,7 @@ public void PullApiTestBitbucketFormatWithPrivateMercurialRepository()
public void PullApiTestGitlabHQFormat()
{
string payload = @"{ ""before"":""7e2a599e2d28665047ec347ab36731c905c95e8b"", ""after"":""ea1c6d7ea669c816dd5f86206f7b47b228fdcacd"", ""ref"":""refs/heads/master"", ""user_id"":1, ""user_name"":""Remco Ros"", ""commits"":[ { ""id"":""ea1c6d7ea669c816dd5f86206f7b47b228fdcacd"", ""message"":""Settings as content file"", ""timestamp"":""2012-11-11T14:32:02+01:00"", ""url"":""http://gitlab.proscat.nl/inspectbin/commits/4109312962bb269ecc3a0d7a3c82a119dcd54c8b"", ""author"":{ ""name"":""Remco Ros"", ""email"":""r.ros@proscat.nl"" }}], ""repository"":{ ""name"":""testing"", ""private"":false, ""url"":""https://github.com/KuduApps/SimpleWebApplication"", ""description"":null, ""homepage"":""https://github.com/KuduApps/SimpleWebApplication"" }}";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestGitlabHQFormat");
+ string appName = "PullApiTestGitlabHQFormat";
ApplicationManager.Run(appName, appManager =>
{
@@ -320,7 +320,7 @@ public void PullApiTestGitlabHQFormat()
public void PullApiTestCodebaseFormat()
{
string payload = @"{ ""before"":""7e2a599e2d28665047ec347ab36731c905c95e8b"", ""after"":""ea1c6d7ea669c816dd5f86206f7b47b228fdcacd"", ""ref"":""refs/heads/master"", ""repository"":{ ""name"":""testing"", ""public_access"":true, ""url"":""http://test.codebasehq.com/projects/test-repositories/repositories/git1"", ""clone_urls"": {""ssh"": ""git@codebasehq.com:test/test-repositories/git1.git"", ""http"": ""https://github.com/KuduApps/SimpleWebApplication""}}}";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestCodebaseFormat");
+ string appName = "PullApiTestCodebaseFormat";
ApplicationManager.Run(appName, appManager =>
{
@@ -346,7 +346,7 @@ public void PullApiTestCodebaseFormat()
public void PullApiTestGenericFormat()
{
string payload = @"{ ""oldRef"": ""0000000000000000000"", ""newRef"": ""7e2a599e2d28665047ec347ab36731c905c95e8b"", ""url"": ""https://github.com/KuduApps/SimpleWebApplication.git"", ""deployer"" : ""CodePlex"", ""branch"":""master"" }";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestGenericFormat");
+ string appName = "PullApiTestGenericFormat";
ApplicationManager.Run(appName, appManager =>
{
@@ -370,7 +370,7 @@ public void PullApiTestGenericFormat()
public void PullApiTestGenericFormatCustomBranch()
{
string payload = @"{ ""oldRef"": ""0000000000000000000"", ""newRef"": ""ad21595c668f3de813463df17c04a3b23065fedc"", ""url"": ""https://github.com/KuduApps/RepoWithMultipleBranches.git"", ""deployer"" : ""CodePlex"", branch: ""test"" }";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestGenericCustomBranch");
+ string appName = "PullApiTestGenericCustomBranch";
ApplicationManager.Run(appName, appManager =>
{
@@ -395,7 +395,7 @@ public void PullApiTestGenericFormatCustomBranch()
public void DeployingBranchThatExists()
{
string payload = @"{ ""url"": ""https://github.com/KuduApps/RepoWithMultipleBranches.git"", ""deployer"" : ""CodePlex"", branch: ""test"", newRef: ""ad21595c668f3de813463df17c04a3b23065fedc"" }";
- string appName = KuduUtils.GetRandomWebsiteName("DeployingBranchThatExists");
+ string appName = "DeployingBranchThatExists";
ApplicationManager.Run(appName, appManager =>
{
@@ -420,7 +420,7 @@ public void DeployingBranchThatExists()
public void PullApiTestConsecutivePushesGetQueued()
{
string payload = @"{ ""oldRef"": ""0000000000000000000"", ""newRef"": ""1ef30333deac14b99ac4bc93453cf4232ae88c24"", ""url"": ""https://github.com/KuduApps/RepoWithMultipleBranches.git"", ""deployer"" : ""CodePlex"", branch: ""master"" }";
- string appName = KuduUtils.GetRandomWebsiteName("PullApiTestPushesGetQueued");
+ string appName = "PullApiTestPushesGetQueued";
ApplicationManager.Run(appName, appManager =>
{
@@ -18,7 +18,7 @@ public class DiagnosticsApiFacts
public void ConstructorTest()
{
string repositoryName = "Mvc3Application";
- string appName = KuduUtils.GetRandomWebsiteName("ConstructorTest");
+ string appName = "ConstructorTest";
using (var repo = Git.CreateLocalRepository(repositoryName))
{
@@ -54,7 +54,7 @@ public void SetGetDeleteValue()
};
string repositoryName = "Mvc3Application";
- string appName = KuduUtils.GetRandomWebsiteName("SetGetDeleteValue");
+ string appName = "SetGetDeleteValue";
using (var repo = Git.CreateLocalRepository(repositoryName))
{
@@ -37,7 +37,7 @@ public void TestDropboxBasic()
AccountInfo account = GetAccountInfo(oauth);
DropboxDeployInfo deploy = GetDeployInfo(oauth, account);
- string appName = KuduUtils.GetRandomWebsiteName("DropboxTest");
+ string appName = "DropboxTest";
ApplicationManager.Run(appName, appManager =>
{
HttpClient client = HttpClientHelper.CreateClient(appManager.ServiceUrl, appManager.DeploymentManager.Credentials);
@@ -71,7 +71,7 @@ public void CustomDeploymentScriptShouldHaveDeploymentSetting()
{
var verificationLogText = "Settings Were Set Properly";
- string randomTestName = KuduUtils.GetRandomWebsiteName("CustomDeploymentScriptShouldHaveDeploymentSetting");
+ string randomTestName = "CustomDeploymentScriptShouldHaveDeploymentSetting";
ApplicationManager.Run(randomTestName, appManager =>
{
appManager.SettingsManager.SetValue("TESTED_VAR", verificationLogText).Wait();
@@ -97,7 +97,7 @@ public void CustomDeploymentScriptShouldHaveDeploymentSetting()
{
using (new LatencyLogger("PushAndDeployApps - " + repoCloneUrl))
{
- string randomTestName = KuduUtils.GetRandomWebsiteName(Path.GetFileNameWithoutExtension(repoCloneUrl));
+ string randomTestName = Path.GetFileNameWithoutExtension(repoCloneUrl);
ApplicationManager.Run(randomTestName, appManager =>
{
// Act
Oops, something went wrong.

0 comments on commit 32cf6bd

Please sign in to comment.