Skip to content

Commit

Permalink
Add debugging messages around execution to see if we can figure out w…
Browse files Browse the repository at this point in the history
…here the duplicate IDs are coming from
  • Loading branch information
bradwilson committed Jul 17, 2024
1 parent c27ccda commit 804749b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/xunit.runner.visualstudio/VsTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ async Task RunTestsInAssembly(
var testCaseSerializations = new List<string>();
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(
Expand Down Expand Up @@ -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<string>(TestCaseUniqueIDProperty, null);
var serialization = testCase.GetPropertyValue<string>(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))
Expand Down

0 comments on commit 804749b

Please sign in to comment.