From 1fee64a35ef5e869fa4603eeb2b33539d14a1ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Wed, 11 Dec 2024 09:11:37 +0100 Subject: [PATCH] nuget-packages tests log to standard test folder --- .../IntegrationTests/Helpers/EnvironmentHelper.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/IntegrationTests/Helpers/EnvironmentHelper.cs b/test/IntegrationTests/Helpers/EnvironmentHelper.cs index f3d2b6b469..c13a45ae33 100644 --- a/test/IntegrationTests/Helpers/EnvironmentHelper.cs +++ b/test/IntegrationTests/Helpers/EnvironmentHelper.cs @@ -16,7 +16,7 @@ public class EnvironmentHelper private readonly ITestOutputHelper _output; private readonly int _major; private readonly int _minor; - private readonly string? _patch = null; + private readonly string? _patch; private readonly string _appNamePrepend; private readonly string _runtime; @@ -61,6 +61,10 @@ public EnvironmentHelper( // Only integration tests assume the default environment variable settings. SetDefaultEnvironmentVariables(); } + else if (testApplicationType == "nuget-packages") + { + SetDefaultLogEnvironmentVariables(); + } } public bool DebugModeEnabled { get; set; } = true; @@ -270,8 +274,7 @@ private void SetDefaultEnvironmentVariables() CustomEnvironmentVariables["COR_PROFILER"] = EnvironmentTools.ProfilerClsId; CustomEnvironmentVariables["COR_PROFILER_PATH"] = profilerPath; - CustomEnvironmentVariables["OTEL_LOG_LEVEL"] = "debug"; - CustomEnvironmentVariables["OTEL_DOTNET_AUTO_LOG_DIRECTORY"] = Path.Combine(EnvironmentTools.GetSolutionDirectory(), "test-artifacts", "profiler-logs"); + SetDefaultLogEnvironmentVariables(); CustomEnvironmentVariables["OTEL_DOTNET_AUTO_HOME"] = GetNukeBuildOutput(); CustomEnvironmentVariables["OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES"] = "TestApplication.*"; @@ -280,4 +283,10 @@ private void SetDefaultEnvironmentVariables() CustomEnvironmentVariables["OTEL_METRICS_EXPORTER"] = "none"; CustomEnvironmentVariables["OTEL_LOGS_EXPORTER"] = "none"; } + + private void SetDefaultLogEnvironmentVariables() + { + CustomEnvironmentVariables["OTEL_LOG_LEVEL"] = "debug"; + CustomEnvironmentVariables["OTEL_DOTNET_AUTO_LOG_DIRECTORY"] = Path.Combine(EnvironmentTools.GetSolutionDirectory(), "test-artifacts", "profiler-logs"); + } }