Skip to content

Commit bb84c83

Browse files
committed
Add additional integration test
1 parent 7071dcb commit bb84c83

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/TelemetryTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public TelemetryTests(ITestOutputHelper output)
4848
[MemberData(nameof(Data))]
4949
public async Task Telemetry_Agentless_IsSentOnAppClose(bool? enableDependencies)
5050
{
51+
// This is the default, we're just setting it to test the telemetry sent
52+
SetEnvironmentVariable(ConfigurationKeys.GitMetadataEnabled, "1");
53+
5154
using var agent = MockTracerAgent.Create(Output, useTelemetry: true);
5255
Output.WriteLine($"Assigned port {agent.Port} for the agentPort.");
5356

@@ -71,6 +74,19 @@ public async Task Telemetry_Agentless_IsSentOnAppClose(bool? enableDependencies)
7174
await telemetry.AssertConfigurationAsync(ConfigurationKeys.PropagationStyleExtract, "Datadog,tracecontext,baggage");
7275
await telemetry.AssertConfigurationAsync(ConfigurationKeys.PropagationStyleInject, "Datadog,tracecontext,baggage");
7376

77+
// verify that we report both the default and explicit value to telemetry
78+
var allConfigKeys = (await telemetry.GetConfigurationValuesAsync(ConfigurationKeys.GitMetadataEnabled)).ToList();
79+
allConfigKeys
80+
.Should()
81+
.HaveCount(2)
82+
.And
83+
.BeEquivalentTo(
84+
[
85+
new { Name = ConfigurationKeys.GitMetadataEnabled, Value = true, Origin = "default" },
86+
new { Name = ConfigurationKeys.GitMetadataEnabled, Value = true, Origin = "env_var" }
87+
]);
88+
allConfigKeys[0].SeqId.Should().BeLessThan(allConfigKeys[1].SeqId);
89+
7490
await AssertServiceAsync(telemetry, "Samples.Telemetry", ServiceVersion);
7591
await AssertDependenciesAsync(telemetry, enableDependencies);
7692
await AssertNoRedactedErrorLogsAsync(telemetry);

0 commit comments

Comments
 (0)