From c462fabe8e6fe211ed7013b2e86873223038c3a2 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 16 Oct 2023 09:38:28 -0400 Subject: [PATCH] Use deterministic temp paths in integration tests --- tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs | 2 +- tests/Tgstation.Server.Tests/TestVersions.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs b/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs index b2430e68d2..0d40229b19 100644 --- a/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs +++ b/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs @@ -84,7 +84,7 @@ namespace Tgstation.Server.Tests.Live Assert.IsTrue(port >= 10000); // for testing bridge request limit Directory = BaseDirectory; - Directory = Path.Combine(Directory, Guid.NewGuid().ToString()); + Directory = Path.Combine(Directory, swarmConfiguration?.Identifier ?? "default"); System.IO.Directory.CreateDirectory(Directory); string urlString = $"http://localhost:{port}"; Url = new Uri(urlString); diff --git a/tests/Tgstation.Server.Tests/TestVersions.cs b/tests/Tgstation.Server.Tests/TestVersions.cs index cba96b07e0..d8ade9ff91 100644 --- a/tests/Tgstation.Server.Tests/TestVersions.cs +++ b/tests/Tgstation.Server.Tests/TestVersions.cs @@ -30,6 +30,7 @@ using Tgstation.Server.Host.System; using System.Net; using Tgstation.Server.Api.Models.Internal; using Tgstation.Server.Api.Models; +using Tgstation.Server.Tests.Live; namespace Tgstation.Server.Tests { @@ -210,7 +211,7 @@ namespace Tgstation.Server.Tests loggerFactory); var ioManager = new DefaultIOManager(); - var tempPath = Path.GetTempFileName(); + var tempPath = ioManager.ConcatPath(LiveTestingServer.BaseDirectory, "mapthreads"); await ioManager.DeleteFile(tempPath, default); await ioManager.CreateDirectory(tempPath, default); try