Skip to content

Commit

Permalink
TestResults folder names are now cross platform compatible, as per #678
Browse files Browse the repository at this point in the history
… (#1119)

Co-authored-by: Jason Cole <jason.cole@jsitelecom.com>
  • Loading branch information
JasonMurrayCole and Jason Cole authored Jun 14, 2022
1 parent ee96b05 commit 21f6be4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public override void AddDeploymentItemsBasedOnMsTestSetting(string testSource, I
/// <returns>Root deployment directory.</returns>
public override string GetRootDeploymentDirectory(string baseDirectory)
{
string dateTimeSufix = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
string directoryName = string.Format(CultureInfo.CurrentCulture, Resource.TestRunName, DeploymentFolderPrefix, Environment.UserName, dateTimeSufix);
string dateTimeSufix = DateTime.Now.ToString("yyyyMMddTHHmmss", DateTimeFormatInfo.InvariantInfo);
string directoryName = string.Format(CultureInfo.InvariantCulture, Resource.TestRunName, DeploymentFolderPrefix, Environment.UserName, dateTimeSufix);
directoryName = this.FileUtility.ReplaceInvalidFileNameCharacters(directoryName);

return this.FileUtility.GetNextIterationDirectoryName(baseDirectory, directoryName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public override void AddDeploymentItemsBasedOnMsTestSetting(string testSource, I
/// <returns>Root deployment directory.</returns>
public override string GetRootDeploymentDirectory(string baseDirectory)
{
string dateTimeSufix = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
string directoryName = string.Format(CultureInfo.CurrentCulture, Resource.TestRunName, DeploymentFolderPrefix, Environment.UserName, dateTimeSufix);
string dateTimeSufix = DateTime.Now.ToString("yyyyMMddTHHmmss", DateTimeFormatInfo.InvariantInfo);
string directoryName = string.Format(CultureInfo.InvariantCulture, Resource.TestRunName, DeploymentFolderPrefix, Environment.UserName, dateTimeSufix);
directoryName = this.FileUtility.ReplaceInvalidFileNameCharacters(directoryName);

return this.FileUtility.GetNextIterationDirectoryName(baseDirectory, directoryName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public override void AddDeploymentItemsBasedOnMsTestSetting(string testSource, I
/// <returns>Root deployment directory.</returns>
public override string GetRootDeploymentDirectory(string baseDirectory)
{
string dateTimeSufix = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
string directoryName = string.Format(CultureInfo.CurrentCulture, Resource.TestRunName, DeploymentFolderPrefix, Environment.GetEnvironmentVariable("USERNAME") ?? Environment.GetEnvironmentVariable("USER"), dateTimeSufix);
string dateTimeSufix = DateTime.Now.ToString("yyyyMMddTHHmmss", DateTimeFormatInfo.InvariantInfo);
string directoryName = string.Format(CultureInfo.InvariantCulture, Resource.TestRunName, DeploymentFolderPrefix, Environment.GetEnvironmentVariable("USERNAME") ?? Environment.GetEnvironmentVariable("USER"), dateTimeSufix);
directoryName = this.FileUtility.ReplaceInvalidFileNameCharacters(directoryName);

return this.FileUtility.GetNextIterationDirectoryName(baseDirectory, directoryName);
Expand Down

0 comments on commit 21f6be4

Please sign in to comment.