Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update unit tests
  • Loading branch information
stevejgordon committed Dec 4, 2025
commit d04d7f8d15ecdb351e89da509149f9665025b870
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Elastic.OpenTelemetry.Tests.Configuration;

public class CompositeElasticOpenTelemetryOptionsTests(ITestOutputHelper output)
{
private const int ExpectedLogsLength = 7;
private const int ExpectedLogsLength = 9;

[Fact]
public void DefaultCtor_SetsExpectedDefaults_WhenNoEnvironmentVariablesAreConfigured()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public void CheckNonActivation(string environmentVariable, string value)
}

[Theory]
[InlineData("trace", LogLevel.Debug, true)]
[InlineData("Trace", LogLevel.Debug, true)]
[InlineData("TraCe", LogLevel.Debug, true)]
[InlineData("trace", LogLevel.Trace, true)]
[InlineData("Trace", LogLevel.Trace, true)]
[InlineData("TraCe", LogLevel.Trace, true)]
[InlineData("debug", LogLevel.Debug, true)]
[InlineData("info", LogLevel.Information, false)]
[InlineData("warn", LogLevel.Warning, false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public partial class LoggingTests(ITestOutputHelper output)
{
private readonly ITestOutputHelper _output = output;

[GeneratedRegex(@"\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\]\[\d{6}\]\[-*\]\[Information\]\s+Elastic Distribution of OpenTelemetry \(EDOT\) \.NET:.*")]
[GeneratedRegex(@"\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{7}Z\]\[\d{6}\]\[-*\]\[Information\]\s+Elastic Distribution of OpenTelemetry \(EDOT\) \.NET:.*")]
private static partial Regex EdotPreamble();

[GeneratedRegex(@"\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\]\[\d{6}\]\[-*\]\[Debug\]\s+Reusing existing shared components\.\s+")]
[GeneratedRegex(@"\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{7}Z\]\[\d{6}\]\[-*\]\[Debug\]\s+Reusing existing shared components\.\s+")]
private static partial Regex UsingSharedComponents();

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ public partial class InstrumentationScanningTests(WebApplicationFactory<Program>
private readonly ITestOutputHelper _output = output;

#if NET8_0
[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\]\[\d{6}\]\[-*\]\[Debug\]\s+Added contrib instrumentation 'HTTP' to TracerProviderBuilder*")]
[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{7}Z\]\[\d{6}\]\[-*\]\[Debug\]\s+Added contrib instrumentation 'HTTP' to TracerProviderBuilder*")]
private static partial Regex HttpTracerProviderBuilderRegex();

[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\]\[\d{6}\]\[-*\]\[Debug\]\s+Added contrib instrumentation 'HTTP' to MeterProviderBuilder*")]
[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{7}Z\]\[\d{6}\]\[-*\]\[Debug\]\s+Added contrib instrumentation 'HTTP' to MeterProviderBuilder*")]
private static partial Regex HttpMeterProviderBuilderRegex();
#elif NET9_0_OR_GREATER
[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\]\[\d{6}\]\[-*\]\[Debug\]\s+Added 'System.Net.Http' to TracerProviderBuilder.*")]
[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{7}Z\]\[\d{6}\]\[-*\]\[Debug\]\s+Added 'System.Net.Http' to TracerProviderBuilder.*")]
private static partial Regex HttpTracerProviderBuilderRegex();

[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\]\[\d{6}\]\[-*\]\[Debug\]\s+Added 'System.Net.Http' meter to MeterProviderBuilder.*")]
[GeneratedRegex(@"^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{7}Z\]\[\d{6}\]\[-*\]\[Debug\]\s+Added 'System.Net.Http' meter to MeterProviderBuilder.*")]
private static partial Regex HttpMeterProviderBuilderRegex();
#endif

Expand Down Expand Up @@ -71,7 +71,7 @@ public async Task InstrumentationAssemblyScanning_AddsAspNetCoreInstrumentation(
public async Task InstrumentationAssemblyScanning_AddsHttpInstrumentation()
{
// NOTE: When this runs on NET8, we expect the contrib library to be used.
// On NET9, the library dependency is not included with Elastic.OpenTelemetry,
// On NET9+, the library dependency is not included with Elastic.OpenTelemetry,
// so we expect the native instrumentation to be used.

var exportedItems = new List<Activity>();
Expand Down