From c4e8bb786656b6bbb44e81362df6c2d74215122e Mon Sep 17 00:00:00 2001 From: Samdanae Imran Date: Fri, 8 Nov 2024 14:13:19 +1300 Subject: [PATCH] Add free disk space logs --- .../Support/IntegrationTest.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/Octopus.Tentacle.Tests.Integration/Support/IntegrationTest.cs b/source/Octopus.Tentacle.Tests.Integration/Support/IntegrationTest.cs index 79c83541d..5b1e1177b 100644 --- a/source/Octopus.Tentacle.Tests.Integration/Support/IntegrationTest.cs +++ b/source/Octopus.Tentacle.Tests.Integration/Support/IntegrationTest.cs @@ -1,9 +1,11 @@ using System; using System.IO; +using System.Linq; using System.Threading; using Halibut.Util; using NUnit.Framework; using NUnit.Framework.Interfaces; +using Octopus.Client.Extensions; using Octopus.Tentacle.Tests.Integration.Util; using Serilog; @@ -20,7 +22,8 @@ public abstract class IntegrationTest : IDisposable public void SetUp() { Logger = new SerilogLoggerBuilder().Build().ForContext(GetType()); - Logger.Information("Test started"); + var driveInfos = DriveInfo.GetDrives(); + Logger.Information($"Test started. Available Disk space before starting: {driveInfos.Select(d => $"{d.Name}: {d.AvailableFreeSpace}").ToList().StringJoin(", ")}"); // Time out the cancellation token so we cancel the test if it takes too long // The IntegrationTestTimeout attribute will also cancel the test if it takes too long, but nunit will not call TearDown on the test @@ -40,7 +43,9 @@ public void TearDown() Logger.Information("Disposing CancellationTokenSource"); cancellationTokenSource?.Dispose(); cancellationTokenSource = null; - Logger.Information("Finished Test Tearing Down"); + var driveInfos = DriveInfo.GetDrives(); + Logger.Information($"Finished Test Tearing Down. Available Disk space before starting: {driveInfos.Select(d => $"{d.Name}: {d.AvailableFreeSpace}").ToList().StringJoin(", ")}"); + } void WriteTentacleLogToOutputIfTestHasFailed()