Skip to content

Commit 1137a33

Browse files
bouwkastNachoEchevarria
authored andcommitted
Revert "Try to make global.json to use .NET 8"
This reverts commit c3dd3d3.
1 parent f0bcc75 commit 1137a33

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

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

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public async Task DoesNotInstrumentDotnetBuild()
8282

8383
using var agent = EnvironmentHelper.GetMockAgent(useTelemetry: true);
8484

85-
var logDir = await RunDotnet("new console -n instrumentation_test -o . --no-restore");
85+
var logDir = await RunDotnet("new console -n instrumentation_test -o . --no-restore -f net8.0");
8686
AssertNotInstrumented(agent, logDir);
8787

8888
logDir = await RunDotnet("restore");
@@ -110,14 +110,11 @@ public async Task DoesNotInstrumentExcludedNames(string excludedProcess)
110110
var workingDir = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(Path.GetRandomFileName()));
111111
Directory.CreateDirectory(workingDir);
112112

113-
// Hack to ensure that the .NET 8.0 SDK is used instead of .NET 10 as it complains about not finding the runtime
114-
EnsureNet8Sdk(workingDir);
115-
116113
Output.WriteLine("Using workingDirectory: " + workingDir);
117114

118115
using var agent = EnvironmentHelper.GetMockAgent(useTelemetry: true);
119116

120-
var logDir = await RunDotnet($"new console -n {excludedProcess} -o . --no-restore");
117+
var logDir = await RunDotnet($"new console -n {excludedProcess} -o . --no-restore -f net8.0");
121118
AssertNotInstrumented(agent, logDir);
122119

123120
var programCs = GetProgramCSThatMakesSpans();
@@ -151,14 +148,11 @@ public async Task DoesInstrumentAllowedProcesses(string allowedProcess)
151148
var workingDir = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(Path.GetRandomFileName()));
152149
Directory.CreateDirectory(workingDir);
153150

154-
// Hack to ensure that the .NET 8.0 SDK is used instead of .NET 10 as it complains about not finding the runtime
155-
EnsureNet8Sdk(workingDir);
156-
157151
Output.WriteLine("Using workingDirectory: " + workingDir);
158152

159153
using var agent = EnvironmentHelper.GetMockAgent(useTelemetry: true);
160154

161-
var logDir = await RunDotnet($"new console -n {allowedProcess} -o . --no-restore");
155+
var logDir = await RunDotnet($"new console -n {allowedProcess} -o . --no-restore -f net8.0");
162156
AssertNotInstrumented(agent, logDir);
163157
var programCs = GetProgramCSThatMakesSpans();
164158

@@ -188,14 +182,11 @@ public async Task InstrumentsDotNetTest()
188182
var workingDir = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(Path.GetRandomFileName()));
189183
Directory.CreateDirectory(workingDir);
190184

191-
// Hack to ensure that the .NET 8.0 SDK is used instead of .NET 10 as it complains about not finding the runtime
192-
EnsureNet8Sdk(workingDir);
193-
194185
Output.WriteLine("Using workingDirectory: " + workingDir);
195186

196187
using var agent = EnvironmentHelper.GetMockAgent(useTelemetry: true);
197188

198-
var logDir = await RunDotnet("new xunit -n instrumentation_test -o . --no-restore");
189+
var logDir = await RunDotnet("new xunit -n instrumentation_test -o . --no-restore -f net8.0");
199190
AssertNotInstrumented(agent, logDir);
200191

201192
// this _should_ be instrumented so we expect managed data.
@@ -849,17 +840,6 @@ private void AddFilesAsReportable(string logDir, AssertionScope scope, string[]
849840
});
850841
}
851842

852-
private void EnsureNet8Sdk(string workingDirectory)
853-
{
854-
var globalJson = @"{
855-
""sdk"": {
856-
""version"": ""8.0.0"",
857-
""rollForward"": ""latestMinor""
858-
}
859-
}";
860-
File.WriteAllText(Path.Combine(workingDirectory, "global.json"), globalJson);
861-
}
862-
863843
private bool IsAllLoggingDisabledForBailout()
864844
{
865845
var isSsi = EnvironmentHelper.CustomEnvironmentVariables.TryGetValue("DD_INJECTION_ENABLED", out var injectionEnabled)

0 commit comments

Comments
 (0)