Skip to content

Commit

Permalink
Update version conflict test (#6226)
Browse files Browse the repository at this point in the history
## Summary of changes

Change the version conflict test to something sane

## Reason for change

Since 3.x, this test doesn't really make sense - it's meant to test the
behaviour of the app when the _manual_ version is _higher_ than the
automatic version. Since 3.x, we don't ship Datadog.Trace.dll in the
NuGet package, so this scenario, where the manual version is _higher_
than the automatic, can't happen in practice.

What we _can_ still have is a manual version 2.x with automatic 3.x, so
changed the test to check that scenario instead.

## Implementation details

- Stop using the magic "future" NuGet and use the existing latest 2.x
line.
- The behaviour should be the same for both .NET FX and .NET Core now

## Test coverage

Kinda the same, kinda different. We're testing auto > manual instead of
manual > auto now.

## Other details

This is particularly necessarily for supporting .NET 9, seeing as the
existing 255.x.x package won't support it, so we would need to create a
new one, which isn't worth the hassle seeing as it can't happen.
  • Loading branch information
andrewlock authored Nov 4, 2024
1 parent 6f4580e commit bf5333d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,11 @@ public async Task SubmitTraces()
// When version 2.1 of the tracer ships, we can go back to the test and add a case using nuget 2.0,
// which will actually test the version conflict behavior.

#if NETCOREAPP
httpSpans.Should()
.HaveCount(2)
.And.OnlyContain(s => s.ParentId == rootSpan.SpanId && s.TraceId == rootSpan.TraceId)
.And.OnlyContain(s => !s.Metrics.ContainsKey(Metrics.SamplingPriority));
#else
httpSpans.Should()
.HaveCount(2)
.And.OnlyContain(s => s.ParentId == rootSpan.SpanId && s.TraceId == rootSpan.TraceId)
.And.ContainSingle(s => s.Metrics[Metrics.SamplingPriority] == SamplingPriorityValues.UserKeep)
.And.ContainSingle(s => s.Metrics[Metrics.SamplingPriority] == SamplingPriorityValues.UserReject);
#endif

// Check the headers of the outbound http requests
var outputLines = processResult.StandardOutput.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


<ItemGroup>
<PackageReference Include="Datadog.Trace" Version="255.1.6-prerelease" />
<PackageReference Include="Datadog.Trace" Version="2.60.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

Expand Down

0 comments on commit bf5333d

Please sign in to comment.