Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwoctopusdeploy committed Dec 19, 2023
1 parent c1eb30a commit ff7ef84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ _test
.DS_Store
.env
scripts/development/
artifacts/trace-logs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Threading;
using Octopus.Tentacle.CommonTestUtils;
using IAsyncDisposable = System.IAsyncDisposable;

namespace Octopus.Tentacle.Tests.Integration.Support
Expand Down Expand Up @@ -78,13 +79,20 @@ public static DirectoryInfo LogFileDirectory()
// The current directory is expected to have the following structure
// (w/ variance depending on Debug/Release and dotnet framework used (net6.0, net48 etc):
//
// <REPO ROOT>\source\Halibut.Tests\bin\Debug\net6.0
// <REPO ROOT>\source\Octopus.Tentacle.Tests.Integration\bin\Debug\net6.0
//
// Therefore we go up 5 levels to get to the <REPO ROOT> directory,
// from which point we can navigate to the artifacts directory.
var currentDirectory = Directory.GetCurrentDirectory();

var rootDirectory = new DirectoryInfo(currentDirectory).Parent!.Parent!.Parent!.Parent!.Parent!;

if (PlatformDetection.IsRunningOnWindows)
{
// If running on Windows the Debug/Release directory is not created
rootDirectory = new DirectoryInfo(currentDirectory).Parent!.Parent!.Parent!.Parent!;
}

var traceLogsDirectory = rootDirectory.CreateSubdirectory("artifacts").CreateSubdirectory("trace-logs");
return traceLogsDirectory;
}
Expand Down

0 comments on commit ff7ef84

Please sign in to comment.