Use deterministic temp paths in integration tests

This commit is contained in:
Jordan Dominion
2023-10-16 09:38:28 -04:00
parent dfff65cad7
commit c462fabe8e
2 changed files with 3 additions and 2 deletions
@@ -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);
+2 -1
View File
@@ -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