From 41f3dae9c897cfb891fcecd2ba84c1b217c2f12c Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 24 Nov 2020 19:49:46 +0100 Subject: [PATCH 1/4] Fix paths in LogviewerTests --- .../Umbraco.Infrastructure/Logging/LogviewerTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs index 2b78714997..6a0fde5116 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs @@ -42,12 +42,12 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Infrastructure.Logging var loggingConfiguration = TestHelper.GetLoggingConfiguration(hostingEnv); - var exampleLogfilePath = Path.Combine(testRoot, @"TestHelpers\Assets\", _logfileName); + var exampleLogfilePath = Path.Combine(testRoot, "TestHelpers","Assets", _logfileName); _newLogfileDirPath = loggingConfiguration.LogDirectory; _newLogfilePath = Path.Combine(_newLogfileDirPath, _logfileName); - var exampleSearchfilePath = Path.Combine(testRoot, @"TestHelpers\Assets\", _searchfileName); - _newSearchfileDirPath = Path.Combine(hostingEnv.ApplicationPhysicalPath, @"Config\"); + var exampleSearchfilePath = Path.Combine(testRoot, "TestHelpers","Assets", _searchfileName); + _newSearchfileDirPath = Path.Combine(hostingEnv.ApplicationPhysicalPath, @"Config"); _newSearchfilePath = Path.Combine(_newSearchfileDirPath, _searchfileName); //Create/ensure Directory exists From 0b7f7e4f37d3b778d37cb91a28dd7c4744570284 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 25 Nov 2020 07:22:32 +0100 Subject: [PATCH 2/4] Use temp path for test Signed-off-by: Bjarke Berg --- .../HostedServices/TempFileCleanupTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs index 7feda1e9da..2fcc618397 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Infrastructure.HostedServices public class TempFileCleanupTests { private Mock _mockIOHelper; - private string _testPath = @"c:\test\temp\path"; + private string _testPath = Path.GetTempPath(); [Test] public async Task Does_Not_Execute_When_Not_Main_Dom() From 1e2ad85718ebe3e06d6d2bc76db0f0f35d864a25 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 25 Nov 2020 07:31:39 +0100 Subject: [PATCH 3/4] Fix test for linux: config folder is lowercase Signed-off-by: Bjarke Berg --- .../Umbraco.Infrastructure/Logging/LogviewerTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs index 6a0fde5116..183e87e5ca 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs @@ -47,7 +47,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Infrastructure.Logging _newLogfilePath = Path.Combine(_newLogfileDirPath, _logfileName); var exampleSearchfilePath = Path.Combine(testRoot, "TestHelpers","Assets", _searchfileName); - _newSearchfileDirPath = Path.Combine(hostingEnv.ApplicationPhysicalPath, @"Config"); + _newSearchfileDirPath = Path.Combine(hostingEnv.ApplicationPhysicalPath, @"config"); _newSearchfilePath = Path.Combine(_newSearchfileDirPath, _searchfileName); //Create/ensure Directory exists From a117d6be925a0b090d40ca5ce1fe4223a946270d Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 25 Nov 2020 07:40:56 +0100 Subject: [PATCH 4/4] Fix test for linux: use temp folder inside content root Signed-off-by: Bjarke Berg --- .../HostedServices/TempFileCleanupTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs index 2fcc618397..98666ece2f 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Infrastructure.HostedServices public class TempFileCleanupTests { private Mock _mockIOHelper; - private string _testPath = Path.GetTempPath(); + private string _testPath = Path.Combine(TestContext.CurrentContext.TestDirectory.Split("bin")[0], "App_Data", "TEMP"); [Test] public async Task Does_Not_Execute_When_Not_Main_Dom()