From 8c0f159e2940e2b998f241855904d438dc85591e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Mon, 13 Jun 2022 15:28:06 +0200 Subject: [PATCH 1/2] Fix which value is used in platform warning --- src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs index 5325088ee5..aa709443e8 100644 --- a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs +++ b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs @@ -666,7 +666,7 @@ public static IEnumerable FilterCompatibleSources(Architecture chosenPla if (incompatiblityFound) { - incompatibleSettingWarning = string.Format(CultureInfo.CurrentCulture, OMResources.DisplayChosenSettings, chosenFramework, defaultArchitecture, warnings.ToString(), MultiTargetingForwardLink); + incompatibleSettingWarning = string.Format(CultureInfo.CurrentCulture, OMResources.DisplayChosenSettings, chosenFramework, chosenPlatform, warnings.ToString(), MultiTargetingForwardLink); } return compatibleSources; From ab36e15b6a3512d0af13ae792f3040fffd3d7b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Tue, 14 Jun 2022 08:40:58 +0200 Subject: [PATCH 2/2] Add default VS settings to playground --- playground/TestPlatform.Playground/Program.cs | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/playground/TestPlatform.Playground/Program.cs b/playground/TestPlatform.Playground/Program.cs index e096d723ef..ec75b93897 100644 --- a/playground/TestPlatform.Playground/Program.cs +++ b/playground/TestPlatform.Playground/Program.cs @@ -25,7 +25,7 @@ static void Main(string[] args) { // This project references TranslationLayer, vstest.console, TestHostProvider, testhost and MSTest1 projects, to make sure // we build all the dependencies of that are used to run tests via VSTestConsoleWrapper. It then copies the components from - // their original build locations, to $(TargetDir)\vstest.console directory, and it's subfolders to create an executable + // their original build locations, to $(TargetDir)\vstest.console directory, and its subfolders to create an executable // copy of TestPlatform that is similar to what we ship. // // The copying might trigger only on re-build, if you see outdated dependencies, Rebuild this project instead of just Build. @@ -40,14 +40,30 @@ static void Main(string[] args) var console = Path.Combine(here, "vstest.console", "vstest.console.exe"); - var sourceSettings = @" - - - true - 0 - - - "; + var maxCpuCount = Environment.GetEnvironmentVariable("VSTEST_MAX_CPU_COUNT") ?? "0"; + var sourceSettings = $$$""" + + + + + + + + + False + True + + + 999999 + + + + + + + + + """; var sources = new[] { Path.Combine(playground, "MSTest1", "bin", "Debug", "net472", "MSTest1.dll"), @@ -83,7 +99,7 @@ static void Main(string[] args) { EnvironmentVariables = EnvironmentVariables.Variables, LogFilePath = Path.Combine(here, "logs", "log.txt"), - TraceLevel = TraceLevel.Verbose, + TraceLevel = TraceLevel.Off, }; var options = new TestPlatformOptions { @@ -112,6 +128,7 @@ static void Main(string[] args) //r.RunTests(sources, sourceSettings, options, sessionHandler.TestSessionInfo, new TestRunHandler()); var rd = sw.ElapsedMilliseconds; Console.WriteLine($"Discovery: {discoveryDuration} ms, Run: {rd} ms, Total: {discoveryDuration + rd} ms"); + Console.WriteLine($"Settings:\n{sourceSettings}"); } public class PlaygroundTestDiscoveryHandler : ITestDiscoveryEventsHandler, ITestDiscoveryEventsHandler2