Skip to content

Commit

Permalink
Add free disk space logs
Browse files Browse the repository at this point in the history
  • Loading branch information
samdanaei committed Nov 8, 2024
1 parent fdb6f03 commit c4e8bb7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit c4e8bb7

Please sign in to comment.