Skip to content

Commit

Permalink
nuget-packages tests log to standard test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed Dec 11, 2024
1 parent 57a2fd4 commit 1fee64a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/IntegrationTests/Helpers/EnvironmentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.*";

Expand All @@ -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");
}
}

0 comments on commit 1fee64a

Please sign in to comment.