From 2180c138056d9c493d6914d768b5f181ef3495fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Apr 2026 00:58:06 +0000 Subject: [PATCH] Centralize RuntimeVersions in DumpTestBase to share between TestConfigurations and GetDumpSource Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/abad0672-00fa-4cc2-960b-65b41cd0ac62 Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- .../cdac/tests/DumpTests/DumpTestBase.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs index 0da34a20d74821..4b1a0a1f38f338 100644 --- a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs +++ b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs @@ -24,6 +24,12 @@ public abstract class DumpTestBase : IDisposable private ContractDescriptorTarget? _target; private DumpInfo? _dumpInfo; + /// + /// The runtime version identifiers tested by and + /// searched by . Centralised here so both share the same list. + /// + private static readonly string[] RuntimeVersions = ["local", "net10.0"]; + /// /// The set of runtime versions and R2R modes to test against. /// Each entry produces a separate test invocation via [MemberData]. @@ -37,11 +43,11 @@ public static IEnumerable TestConfigurations string? dumpSource = GetDumpSource(); foreach (string r2rMode in GetR2RModes()) { - if (!IsVersionSkipped("local")) - yield return [new TestConfiguration("local", r2rMode, dumpSource)]; - - if (!IsVersionSkipped("net10.0")) - yield return [new TestConfiguration("net10.0", r2rMode, dumpSource)]; + foreach (string version in RuntimeVersions) + { + if (!IsVersionSkipped(version)) + yield return [new TestConfiguration(version, r2rMode, dumpSource)]; + } } } } @@ -188,7 +194,7 @@ private static string GetDumpRoot() return null; // Try loading dump-info.json from any version directory to get OS/Arch - foreach (string versionDir in new[] { "local", "net10.0" }) + foreach (string versionDir in RuntimeVersions) { DumpInfo? info = DumpInfo.TryLoad(Path.Combine(dumpRoot, versionDir)); if (info is not null)