Skip to content

Commit

Permalink
Reinstate version mismatch tests (#4879)
Browse files Browse the repository at this point in the history
* Reinstate tracer version mismatch tests where possible

* Update package versions to support .NET 8 in version mismatch scenarios

* Temporarily update the version to build the Datadog.Trace package

* Revert "Temporarily update the version to build the Datadog.Trace package"

This reverts commit 964bc39c6132b4701f48d4f873e58d441cf9511b.

* Update snapshots
  • Loading branch information
andrewlock authored Nov 22, 2023
1 parent 1d1be61 commit 9e0d614
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ public class TraceAnnotationsVersionMismatchAfterFeatureTests : TraceAnnotations
public TraceAnnotationsVersionMismatchAfterFeatureTests(ITestOutputHelper output)
: base("TraceAnnotations.VersionMismatch.AfterFeature", twoAssembliesLoaded: true, enableTelemetry: false, output)
{
#if NET8_0
// The .NET 8 runtime is more aggressive in optimising structs
// so if you reference a version of the .NET tracer prior to this fix:
// https://github.com/DataDog/dd-trace-dotnet/pull/4608 you may get
// struct tearing issues. Bumping the TraceAnnotations.VersionMismatch.AfterFeature project to a version
// with the issue solves the problem.
// _However_ Duck-typing is broken on .NET 8 prior to when we added explicit support, so there's no
// "older" package version we can test with (yet)
throw new SkipException("FIXME: Failing with .NET 8 SDK on .NET Framework only currently");
#endif
}
}

Expand All @@ -50,7 +40,7 @@ public class TraceAnnotationsVersionMismatchBeforeFeatureTests : TraceAnnotation
public TraceAnnotationsVersionMismatchBeforeFeatureTests(ITestOutputHelper output)
: base("TraceAnnotations.VersionMismatch.BeforeFeature", twoAssembliesLoaded: true, enableTelemetry: false, output)
{
#if NET8_0
#if NET8_0_OR_GREATER
// The .NET 8 runtime is more aggressive in optimising structs
// so if you reference a version of the .NET tracer prior to this fix:
// https://github.com/DataDog/dd-trace-dotnet/pull/4608 you may get
Expand All @@ -66,18 +56,9 @@ public TraceAnnotationsVersionMismatchBeforeFeatureTests(ITestOutputHelper outpu
public class TraceAnnotationsVersionMismatchNewerNuGetTests : TraceAnnotationsTests
{
public TraceAnnotationsVersionMismatchNewerNuGetTests(ITestOutputHelper output)
#if NETFRAMEWORK
: base("TraceAnnotations.VersionMismatch.NewerNuGet", twoAssembliesLoaded: true, enableTelemetry: false, output)
{
// For some reason the .NET 8 SDK isn't setting the DD_GIT_ tags correctly in this _single_ app
// _only_ on .NET FX. I don't know why...
throw new SkipException("FIXME: Failing with .NET 8 SDK on .NET Framework only currently");
}
#else
: base("TraceAnnotations.VersionMismatch.NewerNuGet", twoAssembliesLoaded: false, enableTelemetry: false, output)
{
}
#endif
}

[UsesVerify]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ public ILoggerVersionConflict2xTests(ITestOutputHelper output)
SetEnvironmentVariable("DD_LOGS_INJECTION", "true");
}

#if NET8_0
[SkippableFact(Skip = "FIXME: Failing in .NET 8 only currently")]
#else
[SkippableFact]
#endif
[Trait("Category", "EndToEnd")]
[Trait("RunOnWindows", "True")]
public void InjectsLogs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ public Log4NetVersionConflict2xTests(ITestOutputHelper output)
SetServiceVersion("1.0.0");
}

#if NET8_0
[SkippableFact(Skip = "FIXME: Failing in .NET 8 only currently")]
#else
[SkippableFact]
#endif
[Trait("Category", "EndToEnd")]
[Trait("RunOnWindows", "True")]
public void InjectsLogsWhenEnabled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ public NLogVersionConflict2xTests(ITestOutputHelper output)
SetServiceVersion("1.0.0");
}

#if NET8_0
[SkippableFact(Skip = "FIXME: Failing in .NET 8 only currently")]
#else
[SkippableFact]
#endif
[Trait("Category", "EndToEnd")]
[Trait("RunOnWindows", "True")]
public void InjectsLogsWhenEnabled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ public SerilogVersionConflict2xTests(ITestOutputHelper output)
SetServiceVersion("1.0.0");
}

#if NET8_0
[SkippableFact(Skip = "FIXME: Failing in .NET 8 only currently")]
#else
[SkippableFact]
#endif
[Trait("Category", "EndToEnd")]
[Trait("RunOnWindows", "True")]
public void InjectsLogsWhenEnabled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public VersionConflict2xTests(ITestOutputHelper output)
[SkippableFact]
public void SubmitTraces()
{
#if NET8_0
if (EnvironmentTools.IsLinux())
{
throw new SkipException("FIXME: Failing in .NET 8 only currently");
}
#endif
// 1 manual span + 2 http spans
const int expectedSpanCount = 3;

Expand Down
Loading

0 comments on commit 9e0d614

Please sign in to comment.