Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2dcade3
snapshot exploration test - initial implementation
dudikeleti Sep 23, 2024
9e1f4b6
Fix reflection issues
dudikeleti Oct 10, 2024
b535301
WIP snapshot exploration test
dudikeleti Oct 13, 2024
5eac233
WIP
dudikeleti Oct 14, 2024
32ac154
Add test to ignore list
dudikeleti Oct 14, 2024
96ab370
report case where there was comparison between reference type to valu…
dudikeleti Oct 17, 2024
2a9f06a
create no operation in case of snapshot exploration test
dudikeleti Oct 17, 2024
e07c827
use static instance of NoOpSymbolsUploader
dudikeleti Oct 17, 2024
4db5e03
create unique file per process
dudikeleti Oct 17, 2024
243eb49
report error when there is an open generic type and the generic type …
dudikeleti Oct 17, 2024
0c794db
add nullable enable
dudikeleti Oct 17, 2024
bfac855
Skip snapshot exploration test for predefined assemblies
dudikeleti Oct 17, 2024
0e6363f
change csv format
dudikeleti Oct 18, 2024
1bba7ff
fix csv format
dudikeleti Oct 21, 2024
430a6f5
fix build
dudikeleti Dec 10, 2024
dad2499
fix build
dudikeleti Mar 17, 2025
9c6f0b8
change paths
dudikeleti Mar 19, 2025
8557b7f
enable adding probe processors in case of test
dudikeleti Mar 22, 2025
01afc7c
do not add multiple probes
dudikeleti Mar 22, 2025
6364ff2
read logs from native and wip
dudikeleti Mar 25, 2025
31d3d6a
rebasing
dudikeleti Nov 26, 2025
0819aeb
rebase wip
dudikeleti Nov 26, 2025
5b6e3ad
finish rebase
dudikeleti Nov 26, 2025
8f84046
wip
dudikeleti Nov 28, 2025
3f257c5
revert me
dudikeleti Nov 28, 2025
c83128e
snapshot exploration test wip
dudikeleti Apr 17, 2026
0999e43
Stabilize snapshot exploration tests and simplify config
dudikeleti Apr 23, 2026
721d938
clone pinned repos at the target tag
dudikeleti Apr 23, 2026
7495873
disable agent commumication in exploration test
dudikeleti Apr 28, 2026
9b8ae74
fix testhost matching
dudikeleti Apr 28, 2026
2b0da8e
fix extraction of type and method
dudikeleti Apr 28, 2026
7d4fec8
fix how we collect values for nullable types
dudikeleti Apr 28, 2026
f070f97
production-ready cleanup of snapshot exploration test branch
dudikeleti May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 79 additions & 32 deletions tracer/build/_build/Build.ExplorationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ void GitCloneAndBuild(ExplorationTestDescription testDescription)
{
if (Framework != null && !testDescription.IsFrameworkSupported(Framework))
{
throw new InvalidOperationException($"The framework '{Framework}' is not listed in the project's target frameworks of {testDescription.Name}");
throw new InvalidOperationException(
$"The framework '{Framework}' is not listed in the project's target frameworks of {testDescription.Name}");
}

var depth = testDescription.IsGitShallowCloneSupported ? "--depth 1" : "";
Expand All @@ -134,8 +135,8 @@ void GitCloneAndBuild(ExplorationTestDescription testDescription)
.SetProjectFile(projectPath)
.SetConfiguration(BuildConfiguration)
.SetProcessArgumentConfigurator(arguments => arguments
.Add("-consoleLoggerParameters:ErrorsOnly")
.Add("-property:NuGetAudit=false"))
.Add("-consoleLoggerParameters:ErrorsOnly")
.Add("-property:NuGetAudit=false"))
.When(Framework != null, settings => settings.SetFramework(Framework))
);
}
Expand All @@ -160,6 +161,44 @@ Target RunExplorationTests
})
;

Target SetUpSnapshotExplorationTests
=> _ => _
.Description("Sets up the Snapshot Exploration Test")
.Requires(() => ExplorationTestUseCase)
.After(Clean, BuildTracerHome)
.Executes(() =>
{
if (ExplorationTestUseCase != global::ExplorationTestUseCase.Debugger)
{
return;
}

GitCloneBuild();
SetUpSnapshotExplorationTestsInternal();
});

Target RunSnapshotExplorationTests
=> _ => _
.Description("Runs the Snapshot Exploration Test")
.Requires(() => ExplorationTestUseCase)
.After(Clean, BuildTracerHome, BuildNativeLoader, SetUpSnapshotExplorationTests)
.Executes(() =>
{
if (ExplorationTestUseCase != global::ExplorationTestUseCase.Debugger)
{
return;
}

try
{
RunSnapshotExplorationTestsInternal();
}
finally
{
CopyDumpsToBuildData();
}
});

Dictionary<string, string> GetEnvironmentVariables(ExplorationTestDescription testDescription, TargetFramework framework)
{
var envVariables = new Dictionary<string, string>
Expand All @@ -168,7 +207,12 @@ Dictionary<string, string> GetEnvironmentVariables(ExplorationTestDescription te
["DD_SERVICE"] = "exploration_tests",
["DD_VERSION"] = Version,
// Disable logs injection for exploration tests to avoid interfering with third-party test expectations
["DD_LOGS_INJECTION"] = "false"
["DD_LOGS_INJECTION"] = "false",
// Increase log file size to prevent rolling during long exploration tests (default is 10MB)
// This ensures we don't lose error data when analyzing logs after test completion
["DD_MAX_LOGFILE_SIZE"] = "100000000", // 100MB
// Prevent log cleanup during test
["DD_TRACE_LOGFILE_RETENTION_DAYS"] = "30"
};

switch (ExplorationTestUseCase)
Expand Down Expand Up @@ -228,45 +272,45 @@ void RunUnitTest(ExplorationTestDescription testDescription)

Logger.Information($"Running exploration test {testDescription.Name}.");

if (Framework != null && !testDescription.IsFrameworkSupported(Framework))
{
throw new InvalidOperationException($"The framework '{Framework}' is not listed in the project's target frameworks of {testDescription.Name}");
}

if (Framework == null)
{
foreach (var targetFramework in testDescription.SupportedFrameworks)
{
var envVariables = GetEnvironmentVariables(testDescription, targetFramework);
Test(targetFramework, envVariables);
Test(testDescription, targetFramework, envVariables);
}
}
else
{
if (!testDescription.IsFrameworkSupported(Framework))
{
throw new InvalidOperationException($"The framework '{Framework}' is not listed in the project's target frameworks of {testDescription.Name}");
}

var envVariables = GetEnvironmentVariables(testDescription, Framework);
Test(Framework, envVariables);
Test(testDescription, Framework, envVariables);
}
}

void Test(TargetFramework targetFramework, Dictionary<string, string> envVariables)
{
DotNetTest(
x =>
{
x = x
.SetDotnetPath(TargetPlatform)
.SetProjectFile(testDescription.GetTestTargetPath(ExplorationTestsDirectory, targetFramework, BuildConfiguration))
.EnableNoRestore()
.EnableNoBuild()
.SetConfiguration(BuildConfiguration)
.SetFramework(targetFramework)
.SetProcessEnvironmentVariables(envVariables)
.SetIgnoreFilter(testDescription.TestsToIgnore)
.WithMemoryDumpAfter(100)
;

return x;
});
}
void Test(ExplorationTestDescription testDescription, TargetFramework targetFramework, Dictionary<string, string> envVariables)
{
DotNetTest(
x =>
{
x = x
.SetDotnetPath(TargetPlatform)
.SetProjectFile(testDescription.GetTestTargetPath(ExplorationTestsDirectory, targetFramework, BuildConfiguration))
.EnableNoRestore()
.EnableNoBuild()
.SetConfiguration(BuildConfiguration)
.SetFramework(targetFramework)
.SetProcessEnvironmentVariables(envVariables)
.SetIgnoreFilter(testDescription.TestsToIgnore)
.WithMemoryDumpAfter(100)
;

return x;
});
}

private void CreateLineProbesIfNeeded()
Expand Down Expand Up @@ -584,7 +628,7 @@ class ExplorationTestDescription

public bool ShouldRun { get; set; } = true;
public bool LineProbesEnabled { get; set; }

public bool IsSnapshotScenario { get; set; }
public string GetTestTargetPath(AbsolutePath explorationTestsDirectory, TargetFramework framework, Configuration buildConfiguration)
{
var projectPath = $"{explorationTestsDirectory}/{Name}/{PathToUnitTestProject}";
Expand Down Expand Up @@ -647,6 +691,9 @@ public static ExplorationTestDescription GetExplorationTestDescription(Explorati
"Google.Protobuf.CodedInputStreamTest.MaliciousRecursion_UnknownFields",
"Google.Protobuf.CodedInputStreamTest.RecursionLimitAppliedWhileSkippingGroup",
"Google.Protobuf.JsonParserTest.MaliciousRecursion",
"Google.Protobuf.Test.RefStructCompatibilityTest",
"Google.Protobuf.RefStructCompatibilityTest.GeneratedCodeCompilesWithOldCsharpCompiler",
"Google.Protobuf.RefStructCompatibilityTest.RunOldCsharpCompilerAndCheckSuccess",
// exclude those "legacy" tests because they are on manually modified code
// that throws a NotImplementedException on the `Descriptor` property that we use.
"Google.Protobuf.LegacyGeneratedCodeTest.IntermixingOfNewAndLegacyGeneratedCodeWorksWithCodedInputStream",
Expand Down
Loading
Loading