From 804749b7cb0797635c353f7f8fbd7e414b044700 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 17 Jul 2024 11:42:03 -0700 Subject: [PATCH] Add debugging messages around execution to see if we can figure out where the duplicate IDs are coming from --- src/xunit.runner.visualstudio/VsTestRunner.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xunit.runner.visualstudio/VsTestRunner.cs b/src/xunit.runner.visualstudio/VsTestRunner.cs index 98bfccf..413d7a5 100644 --- a/src/xunit.runner.visualstudio/VsTestRunner.cs +++ b/src/xunit.runner.visualstudio/VsTestRunner.cs @@ -508,6 +508,8 @@ async Task RunTestsInAssembly( var testCaseSerializations = new List(); if (runInfo.TestCases is null || !runInfo.TestCases.Any()) { + logger.LogWithSource(assemblyFileName, "Discovering tests for full assembly execution"); + // Discover tests var assemblyDiscoveredInfo = default(AssemblyDiscoveredInfo); await DiscoverTestsInAssembly( @@ -554,13 +556,19 @@ await DiscoverTestsInAssembly( testCaseSerializations.Add(filteredTestCase.TestCase.Serialization); } } + + logger.LogWithSource(assemblyFileName, "Discovery complete"); } else { + logger.LogWithSource(assemblyFileName, "Selective execution requested for the following test case serializations:"); + foreach (var testCase in runInfo.TestCases) { var uniqueID = testCase.GetPropertyValue(TestCaseUniqueIDProperty, null); var serialization = testCase.GetPropertyValue(TestCaseSerializationProperty, null); + logger.LogWithSource(assemblyFileName, " {0} :: {1}", uniqueID ?? "(null)", serialization ?? "(null)"); + if (uniqueID is null) logger.LogWarningWithSource(assemblyFileName, "VSTestCase {0} did not have an associated unique ID", testCase.DisplayName); else if (testCasesMap.ContainsKey(uniqueID))