From 01597068d13a5ec7af9166bac8ac1a22e4f9278e Mon Sep 17 00:00:00 2001 From: nohwnd Date: Thu, 5 Mar 2020 16:12:44 +0100 Subject: [PATCH 01/11] Take TestCaseFilter from runsettings --- .../RunSettingsArgumentProcessor.cs | 6 +++++ .../TestCaseFilterArgumentProcessor.cs | 10 +++++++- .../RunSettingsArgumentProcessorTests.cs | 24 ++++++++++++++++++ .../TestCaseFilterArgumentProcessorTests.cs | 25 +++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/vstest.console/Processors/RunSettingsArgumentProcessor.cs b/src/vstest.console/Processors/RunSettingsArgumentProcessor.cs index 734386c18c..58fa801998 100644 --- a/src/vstest.console/Processors/RunSettingsArgumentProcessor.cs +++ b/src/vstest.console/Processors/RunSettingsArgumentProcessor.cs @@ -144,6 +144,12 @@ public void Initialize(string argument) this.commandLineOptions.InIsolation = true; this.runSettingsManager.UpdateRunSettingsNode(InIsolationArgumentExecutor.RunSettingsPath, "true"); } + + var testCaseFilter = this.runSettingsManager.QueryRunSettingsNode("RunConfiguration.TestCaseFilter"); + if (testCaseFilter != null) + { + this.commandLineOptions.TestCaseFilterValue = testCaseFilter; + } } catch (XmlException exception) { diff --git a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs index 3f10e0143d..ffac50c265 100644 --- a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs +++ b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs @@ -116,10 +116,18 @@ public TestCaseFilterArgumentExecutor(CommandLineOptions options) /// /// Argument that was provided with the command. public void Initialize(string argument) - { + { if (string.IsNullOrWhiteSpace(argument)) { + if (!string.IsNullOrWhiteSpace(this.commandLineOptions.TestCaseFilterValue)) + { + // if user did not specify the argument, and we have a previously set value (for example from settings) + // we keep the value and return, otherwise we throw because there was no default value, and the user did not provide any either + return; + } + throw new CommandLineException(string.Format(CultureInfo.CurrentUICulture, CommandLineResources.TestCaseFilterValueRequired)); + } this.commandLineOptions.TestCaseFilterValue = argument; diff --git a/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs index bc3d6ef0fa..838f76fc6e 100644 --- a/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/RunSettingsArgumentProcessorTests.cs @@ -363,6 +363,30 @@ public void InitializeShouldNotSetInIsolataionToTrueIfEnvironmentVariablesNotSpe Assert.IsNull(this.settingsProvider.QueryRunSettingsNode(InIsolationArgumentExecutor.RunSettingsPath)); } + [TestMethod] + public void InitializeShouldUpdateTestCaseFilterIfProvided() + { + // Arrange. + var fileName = "C:\\temp\\r.runsettings"; + var filter = "TestCategory=Included"; + var settingsXml = $"{filter}"; + + var executor = new TestableRunSettingsArgumentExecutor( + CommandLineOptions.Instance, + this.settingsProvider, + settingsXml); + + // Setup mocks. + var mockFileHelper = new Mock(); + mockFileHelper.Setup(fh => fh.Exists(It.IsAny())).Returns(true); + executor.FileHelper = mockFileHelper.Object; + + // Act. + executor.Initialize(fileName); + + // Assert. + Assert.AreEqual(filter, CommandLineOptions.Instance.TestCaseFilterValue); + } #endregion #region Testable Implementations diff --git a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs index d684c7109c..2ca39627c5 100644 --- a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs @@ -63,6 +63,31 @@ public void ExecutorInitializeWithNullOrEmptyTestCaseFilterShouldThrowCommandLin } } + [TestMethod] + public void ExecutorInitializeWithNullOrEmptyTestCaseFilterShouldNotThrowWhenTestFilterWasSpecifiedByPreviousStep() + { + var options = CommandLineOptions.Instance; + options.TestCaseFilterValue = "Test=FilterFromPreviousStep"; + TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options); + + executor.Initialize(null); + } + + [TestMethod] + public void ExecutorInitializeWithTestCaseFilterShouldOverwriteTheValueProvidedByPreviousStep() + { + var options = CommandLineOptions.Instance; + var defaultValue = "Test=FilterFromPreviousStep"; + options.TestCaseFilterValue = defaultValue; + Assert.AreEqual(defaultValue, options.TestCaseFilterValue); + TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options); + + var value = "Test=NewFilter"; + executor.Initialize(value); + + Assert.AreEqual(value, options.TestCaseFilterValue); + } + [TestMethod] public void ExecutorInitializeWithValidTestCaseFilterShouldAddTestCaseFilterToCommandLineOptions() { From 06329b5f86131d4686b556c0d09ce8ff9ab67680 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 9 Mar 2020 16:55:13 +0100 Subject: [PATCH 02/11] add filter on discovery --- .../RunSettings/RunConfiguration.cs | 17 +++++++++++++++++ .../TestPlatformHelpers/TestRequestManager.cs | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs index 5656640d21..580db75a51 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs @@ -487,6 +487,11 @@ public bool ResultsDirectorySet /// public bool CollectSourceInformationSet { get; private set; } = false; + /// + /// Default filter to use to filter tests + /// + public string TestCaseFilter { get; private set; } + #endregion /// @@ -571,6 +576,13 @@ public override XmlElement ToXml() root.AppendChild(targetDevice); } + if (!string.IsNullOrEmpty(this.TestCaseFilter)) + { + XmlElement testCaseFilter = doc.CreateElement(nameof(TestCaseFilter)); + testCaseFilter.InnerXml = this.TestCaseFilter; + root.AppendChild(testCaseFilter); + } + return root; } @@ -867,6 +879,11 @@ public static RunConfiguration FromXml(XmlReader reader) runConfiguration.TargetDevice = reader.ReadElementContentAsString(); break; + case "TestCaseFilter": + XmlRunSettingsUtilities.ThrowOnHasAttributes(reader); + runConfiguration.TestCaseFilter = reader.ReadElementContentAsString(); + break; + default: // Ignore a runsettings element that we don't understand. It could occur in the case // the test runner is of a newer version, but the test host is of an earlier version. diff --git a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs index 08699a5f82..778006ebf5 100644 --- a/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +++ b/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs @@ -150,6 +150,7 @@ public void DiscoverTests(DiscoveryRequestPayload discoveryPayload, ITestDiscove var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(runsettings); var batchSize = runConfiguration.BatchSize; + var testCaseFilterFromRunsettings = runConfiguration.TestCaseFilter; if (requestData.IsTelemetryOptedIn) { @@ -160,10 +161,12 @@ public void DiscoverTests(DiscoveryRequestPayload discoveryPayload, ITestDiscove this.LogCommandsTelemetryPoints(requestData); } + + // create discovery request var criteria = new DiscoveryCriteria(discoveryPayload.Sources, batchSize, this.commandLineOptions.TestStatsEventTimeout, runsettings) { - TestCaseFilter = this.commandLineOptions.TestCaseFilterValue + TestCaseFilter = this.commandLineOptions.TestCaseFilterValue ?? testCaseFilterFromRunsettings }; // Make sure to run the run request inside a lock as the below section is not thread-safe From 5d82b97d517cba9f5372667b2fa29f8250c0bcb5 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Tue, 10 Mar 2020 12:20:36 +0100 Subject: [PATCH 03/11] Remove space --- .../Processors/TestCaseFilterArgumentProcessor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs index ffac50c265..814004924b 100644 --- a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs +++ b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs @@ -1,4 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.VisualStudio.TestPlatform.CommandLine.Processors @@ -116,7 +117,7 @@ public TestCaseFilterArgumentExecutor(CommandLineOptions options) /// /// Argument that was provided with the command. public void Initialize(string argument) - { + { if (string.IsNullOrWhiteSpace(argument)) { if (!string.IsNullOrWhiteSpace(this.commandLineOptions.TestCaseFilterValue)) From da1b6a5fb67465a89c744d9ad1707f1f42f66952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 19 Mar 2020 13:34:51 +0100 Subject: [PATCH 04/11] Remove duplicated header line --- src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs index 814004924b..e5ac545086 100644 --- a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs +++ b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.VisualStudio.TestPlatform.CommandLine.Processors From 17acf08ab445cfd8c7661d323d0852e401395700 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Tue, 24 Mar 2020 16:54:43 +0100 Subject: [PATCH 05/11] Pin dotnet to the recommended version from arcade --- global.json | 5 ++++- scripts/build.ps1 | 2 +- scripts/build.sh | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/global.json b/global.json index 1321affc3d..eff658fa7a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,9 @@ { + "sdk": { + "version": "3.1.101" + }, "tools": { - "dotnet": "3.1.100" + "dotnet": "3.1.101" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20052.1", diff --git a/scripts/build.ps1 b/scripts/build.ps1 index a17998919e..893b3f24a8 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -82,7 +82,7 @@ $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 # Dotnet build doesn't support --packages yet. See https://github.com/dotnet/cli/issues/2712 $env:NUGET_PACKAGES = $env:TP_PACKAGES_DIR $env:NUGET_EXE_Version = "3.4.3" -$env:DOTNET_CLI_VERSION = "3.1.100" +$env:DOTNET_CLI_VERSION = "3.1.101" # $env:DOTNET_RUNTIME_VERSION = "LATEST" $env:VSWHERE_VERSION = "2.0.2" $env:MSBUILD_VERSION = "15.0" diff --git a/scripts/build.sh b/scripts/build.sh index bbd447aab8..fe93fa812b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -111,7 +111,7 @@ VERSION=$(test -z $VERSION && grep TPVersionPrefix $TP_ROOT_DIR/scripts/build/Te export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Dotnet build doesnt support --packages yet. See https://github.com/dotnet/cli/issues/2712 export NUGET_PACKAGES=$TP_PACKAGES_DIR -DOTNET_CLI_VERSION="3.1.100" +DOTNET_CLI_VERSION="3.1.101" #DOTNET_RUNTIME_VERSION="LATEST" # From a2f431d62c393e78634f034673d349e04c973822 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 25 Mar 2020 12:08:39 +0100 Subject: [PATCH 06/11] Merge filters --- global.json | 4 +++- .../TestCaseFilterArgumentProcessor.cs | 23 +++++++++++-------- .../TestCaseFilterArgumentProcessorTests.cs | 7 +++--- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/global.json b/global.json index eff658fa7a..e3d780ab6a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,8 @@ { "sdk": { - "version": "3.1.101" + "version": "3.1.101", + "rollForward": "latestPatch", + "allowPrerelease": false }, "tools": { "dotnet": "3.1.101" diff --git a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs index e5ac545086..8eb75e0f05 100644 --- a/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs +++ b/src/vstest.console/Processors/TestCaseFilterArgumentProcessor.cs @@ -117,20 +117,23 @@ public TestCaseFilterArgumentExecutor(CommandLineOptions options) /// Argument that was provided with the command. public void Initialize(string argument) { - if (string.IsNullOrWhiteSpace(argument)) + var defaultFilter = this.commandLineOptions.TestCaseFilterValue; + var hasDefaultFilter = !string.IsNullOrWhiteSpace(defaultFilter); + + if (!hasDefaultFilter && string.IsNullOrWhiteSpace(argument)) { - if (!string.IsNullOrWhiteSpace(this.commandLineOptions.TestCaseFilterValue)) - { - // if user did not specify the argument, and we have a previously set value (for example from settings) - // we keep the value and return, otherwise we throw because there was no default value, and the user did not provide any either - return; - } - throw new CommandLineException(string.Format(CultureInfo.CurrentUICulture, CommandLineResources.TestCaseFilterValueRequired)); - } - this.commandLineOptions.TestCaseFilterValue = argument; + if (!hasDefaultFilter) + { + this.commandLineOptions.TestCaseFilterValue = argument; + } + else + { + // Merge default filter an provided filter by AND operator to have both the default filter and custom filter applied. + this.commandLineOptions.TestCaseFilterValue = $"({defaultFilter})&({argument})"; + } } /// diff --git a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs index 2ca39627c5..ca1e545ada 100644 --- a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs @@ -74,7 +74,7 @@ public void ExecutorInitializeWithNullOrEmptyTestCaseFilterShouldNotThrowWhenTes } [TestMethod] - public void ExecutorInitializeWithTestCaseFilterShouldOverwriteTheValueProvidedByPreviousStep() + public void ExecutorInitializeWithTestCaseFilterShouldMergeWithTheValueProvidedByPreviousStep() { var options = CommandLineOptions.Instance; var defaultValue = "Test=FilterFromPreviousStep"; @@ -84,8 +84,9 @@ public void ExecutorInitializeWithTestCaseFilterShouldOverwriteTheValueProvidedB var value = "Test=NewFilter"; executor.Initialize(value); - - Assert.AreEqual(value, options.TestCaseFilterValue); + + var expectedValue = $"({defaultValue})&({value})"; + Assert.AreEqual(expectedValue, options.TestCaseFilterValue); } [TestMethod] From 57087d87d0ab6ecc6539ea8a0d5e1953df388868 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 25 Mar 2020 12:48:47 +0100 Subject: [PATCH 07/11] Fix dotnet setup --- global.json | 5 +++-- scripts/build.ps1 | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/global.json b/global.json index e3d780ab6a..d2637af033 100644 --- a/global.json +++ b/global.json @@ -1,8 +1,9 @@ { "sdk": { "version": "3.1.101", - "rollForward": "latestPatch", - "allowPrerelease": false + "rollForward": "minor", + "allowPrerelease": false, + "architecture": "x64" }, "tools": { "dotnet": "3.1.101" diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 893b3f24a8..0f515c4c2b 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -176,10 +176,10 @@ function Install-DotNetCli # Pull in additional shared frameworks. # Get netcoreapp2.1 shared components. - & $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 -NoPath + & $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '2.1.0' -Channel '2.1.0' -Architecture x64 -NoPath $env:DOTNET_ROOT= $dotnetInstallPath - & $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 -NoPath + & $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.0' -Channel '2.1.0' -Architecture x86 -NoPath ${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86" $env:DOTNET_MULTILEVEL_LOOKUP=0 @@ -191,9 +191,10 @@ function Install-DotNetCli & "$env:DOTNET_ROOT\dotnet.exe" --info "`n`n---- x86 dotnet" - & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info - - + # avoid erroring out because we don't have the sdk for x86 that global.json requires + try { + & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null + } catch {} Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } From 564bae5ce3df530cbf40e1a181f297348a96a520 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 25 Mar 2020 13:45:16 +0100 Subject: [PATCH 08/11] remove test that tested just setter --- .../Processors/TestCaseFilterArgumentProcessorTests.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs index ca1e545ada..7bd0c9292d 100644 --- a/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs +++ b/test/vstest.console.UnitTests/Processors/TestCaseFilterArgumentProcessorTests.cs @@ -89,16 +89,6 @@ public void ExecutorInitializeWithTestCaseFilterShouldMergeWithTheValueProvidedB Assert.AreEqual(expectedValue, options.TestCaseFilterValue); } - [TestMethod] - public void ExecutorInitializeWithValidTestCaseFilterShouldAddTestCaseFilterToCommandLineOptions() - { - var options = CommandLineOptions.Instance; - TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options); - - executor.Initialize("Debug"); - Assert.AreEqual("Debug", options.TestCaseFilterValue); - } - [TestMethod] public void ExecutorExecutoreturnArgumentProcessorResultSuccess() { From 5b4d653b482d28f90b931e4dad41858c25334ff6 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 25 Mar 2020 14:32:41 +0100 Subject: [PATCH 09/11] Remove listing dotnet sdks and runtimes It fails because of pin to newer dotnet, it's nice to have will fix later. --- scripts/build.ps1 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 999152316c..b6baaeb447 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -187,15 +187,15 @@ function Install-DotNetCli "---- dotnet environment variables" Get-ChildItem "Env:\dotnet_*" - "`n`n---- x64 dotnet" - & "$env:DOTNET_ROOT\dotnet.exe" --info - - "`n`n---- x86 dotnet" - # avoid erroring out because we don't have the sdk for x86 that global.json requires - try { - & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null - } catch {} - Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" + # "`n`n---- x64 dotnet" + # & "$env:DOTNET_ROOT\dotnet.exe" --info + + # "`n`n---- x86 dotnet" + # # avoid erroring out because we don't have the sdk for x86 that global.json requires + # try { + # & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null + # } catch {} + # Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } function Clear-Package { From 4bc0ca7ccac93e8ea62785f48b31c476e60dc298 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 25 Mar 2020 16:23:40 +0100 Subject: [PATCH 10/11] It was actually test.ps1 that was failing --- scripts/build.ps1 | 18 +++++++++--------- scripts/test.ps1 | 6 +++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index b6baaeb447..999152316c 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -187,15 +187,15 @@ function Install-DotNetCli "---- dotnet environment variables" Get-ChildItem "Env:\dotnet_*" - # "`n`n---- x64 dotnet" - # & "$env:DOTNET_ROOT\dotnet.exe" --info - - # "`n`n---- x86 dotnet" - # # avoid erroring out because we don't have the sdk for x86 that global.json requires - # try { - # & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null - # } catch {} - # Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" + "`n`n---- x64 dotnet" + & "$env:DOTNET_ROOT\dotnet.exe" --info + + "`n`n---- x86 dotnet" + # avoid erroring out because we don't have the sdk for x86 that global.json requires + try { + & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null + } catch {} + Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } function Clear-Package { diff --git a/scripts/test.ps1 b/scripts/test.ps1 index 338e5e39eb..d5915e602b 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -82,7 +82,11 @@ Get-ChildItem "Env:\dotnet_*" & "$env:DOTNET_ROOT\dotnet.exe" --info "`n`n---- x86 dotnet" -& "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info +# avoid erroring out because we don't have the sdk for x86 that global.json requires +try { + & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null +} catch {} +Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" # Dotnet build doesn't support --packages yet. See https://github.com/dotnet/cli/issues/2712 From 74ececcbba273834a0d488e45d1d8d71cc7f5403 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 25 Mar 2020 16:39:44 +0100 Subject: [PATCH 11/11] copy paste errors --- scripts/test.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/test.ps1 b/scripts/test.ps1 index d5915e602b..ed2bea934b 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -86,8 +86,7 @@ Get-ChildItem "Env:\dotnet_*" try { & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null } catch {} -Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" - + # Dotnet build doesn't support --packages yet. See https://github.com/dotnet/cli/issues/2712 $env:NUGET_PACKAGES = $env:TP_PACKAGES_DIR