Skip to content

Commit

Permalink
[Dynamic Instrumentation] Fix line exploration tests (#6089)
Browse files Browse the repository at this point in the history
## Summary of changes
Line exploration tests should run for now only for protobuf
  • Loading branch information
dudikeleti authored Oct 25, 2024
1 parent e448361 commit adc7e8b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .azure-pipelines/ultimate-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3179,11 +3179,11 @@ stages:

- template: steps/restore-working-directory.yml

- script: tracer\build.cmd SetupExplorationTests -ExplorationTestUseCase $(explorationTestUseCase) -ExplorationTestName $(explorationTestName)
- script: tracer\build.cmd SetupExplorationTests --ExplorationTestUseCase $(explorationTestUseCase) --ExplorationTestName $(explorationTestName)
displayName: SetupExplorationTest $(explorationTestUseCase) $(explorationTestName)

- script: tracer\build.cmd RunExplorationTests -ExplorationTestUseCase $(explorationTestUseCase) -ExplorationTestName $(explorationTestName)
displayName: RunExplorationTest
- script: tracer\build.cmd RunExplorationTests --ExplorationTestUseCase $(explorationTestUseCase) --ExplorationTestName $(explorationTestName)
displayName: RunExplorationTest $(explorationTestUseCase) $(explorationTestName)
env:
DD_LOGGER_DD_API_KEY: $(ddApiKey)

Expand Down
25 changes: 13 additions & 12 deletions tracer/build/_build/Build.ExplorationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,23 +266,25 @@ void Test(TargetFramework targetFramework, Dictionary<string, string> envVariabl

private void CreateLineProbesIfNeeded()
{
var testDescription = ExplorationTestDescription.GetExplorationTestDescription(global::ExplorationTestName.protobuf);

if (!testDescription.LineProbesEnabled)
{
Logger.Information($"Skip line probes creation. The test case '{ExplorationTestName.Value}' does not support line scenario at the moment");
return;
}

ExplorationTestDescription testDescription = null;
if (ExplorationTestName.HasValue)
{
Logger.Information($"Provided exploration test name is {ExplorationTestName}.");
testDescription = ExplorationTestDescription.GetExplorationTestDescription(ExplorationTestName.Value);
if (!testDescription.LineProbesEnabled)
{
Logger.Information($"Provided exploration test name is {ExplorationTestName}.");
return;
}
}
else
{
Logger.Information("Exploration test name is not provided. Running protobuf test case");
testDescription = ExplorationTestDescription.GetExplorationTestDescription(global::ExplorationTestName.protobuf);
}

Logger.Information($"Provided exploration test name is {testDescription.Name}.");

ExplorationTestDescription.GetAllExplorationTestDescriptions();

var sw = new Stopwatch();
sw.Start();

Expand Down Expand Up @@ -470,8 +472,7 @@ string GetTracerAssemblyPath(TargetFramework framework)
throw new Exception("Can't determined the correct tracer framework version");
}

var extension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dll" : "so";
return MonitoringHomeDirectory / tracerFramework / "Datadog.Trace." + extension;
return MonitoringHomeDirectory / tracerFramework / "Datadog.Trace.dll";
}

static string[] GetAllTestAssemblies(string rootPath)
Expand Down
14 changes: 7 additions & 7 deletions tracer/build/_build/Build.VariableGenerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void GenerateConditionVariables()
"tracer/test/Datadog.Trace.Debugger.IntegrationTests",
"tracer/test/test-applications/debugger",
"tracer/build/_build/Build.Steps.Debugger.cs",
"tracer/build/_build/Build.ExplorationTests.cs",
}, new string[] { });
GenerateConditionVariableBasedOnGitChange("isProfilerChanged", new[]
{
Expand Down Expand Up @@ -324,11 +325,10 @@ void GenerateExplorationTestMatrices()
useCases.Add(global::ExplorationTestUseCase.Tracer.ToString());
}

// Debugger exploration tests are currently all broken, so disabling
// if (isDebuggerChanged)
// {
// useCases.Add(global::ExplorationTestUseCase.Debugger.ToString());
// }
if (isDebuggerChanged)
{
useCases.Add(global::ExplorationTestUseCase.Debugger.ToString());
}

if (isProfilerChanged)
{
Expand All @@ -348,8 +348,8 @@ void GenerateExplorationTestsWindowsMatrix(IEnumerable<string> useCases)
foreach (var testDescription in testDescriptions)
{
matrix.Add(
$"{explorationTestUseCase}_{testDescription.Name}",
new { explorationTestUseCase = explorationTestUseCase, explorationTestName = testDescription.Name });
$"{explorationTestUseCase}_{testDescription.Name.ToString()}",
new { explorationTestUseCase = explorationTestUseCase, explorationTestName = testDescription.Name.ToString() });
}
}

Expand Down

0 comments on commit adc7e8b

Please sign in to comment.