Skip to content

Commit 2be41ed

Browse files
authored
Bumped the Test Platform version to 16.10.0-preview-20210211-01. (#770)
1 parent f55dc39 commit 2be41ed

File tree

16 files changed

+200
-84
lines changed

16 files changed

+200
-84
lines changed

Localize/LocProject.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"Projects": [
3+
{
4+
"LanguageSet": "VS_Main_Languages",
5+
"LocItems": [
6+
{
7+
"SourceFile": "src\\Adapter\\MSTest.CoreAdapter\\Resources\\xlf\\Resource.xlf",
8+
"Languages": "",
9+
"CopyOption": "LangIDOnName",
10+
"OutputPath": "src\\Adapter\\MSTest.CoreAdapter\\Resources\\xlf\\",
11+
"LclFile": "Localize\\lcl\\{Lang}\\src\\Adapter\\MSTest.CoreAdapter\\Resources\\xlf\\Resource.xlf.lcl"
12+
}
13+
]
14+
},
15+
{
16+
"LanguageSet": "VS_Main_Languages",
17+
"LocItems": [
18+
{
19+
"SourceFile": "src\\Adapter\\PlatformServices.Shared\\netstandard1.3\\Resources\\xlf\\Resource.xlf",
20+
"Languages": "",
21+
"CopyOption": "LangIDOnName",
22+
"OutputPath": "src\\Adapter\\PlatformServices.Shared\\netstandard1.3\\Resources\\xlf\\",
23+
"LclFile": "Localize\\lcl\\{Lang}\\src\\Adapter\\PlatformServices.Shared\\netstandard1.3\\Resources\\xlf\\Resource.xlf.lcl"
24+
}
25+
]
26+
},
27+
{
28+
"LanguageSet": "VS_Main_Languages",
29+
"LocItems": [
30+
{
31+
"SourceFile": "src\\TestFramework\\MSTest.Core\\Resources\\xlf\\FrameworkMessages.xlf",
32+
"Languages": "",
33+
"CopyOption": "LangIDOnName",
34+
"OutputPath": "src\\TestFramework\\MSTest.Core\\Resources\\xlf\\",
35+
"LclFile": "Localize\\lcl\\{Lang}\\src\\TestFramework\\MSTest.Core\\Resources\\xlf\\FrameworkMessages.xlf.lcl"
36+
}
37+
]
38+
}
39+
]
40+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<TestPlatformVersion Condition=" '$(TestPlatformVersion)' == '' ">16.10.0-preview-20210204-01</TestPlatformVersion>
4+
<TestPlatformVersion Condition=" '$(TestPlatformVersion)' == '' ">16.10.0-preview-20210211-01</TestPlatformVersion>
55
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
66
</PropertyGroup>
77
</Project>

scripts/common.lib.ps1

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,65 @@ function Write-Log ([string] $message, $messageColor = "Green") {
175175
}
176176
$Host.UI.RawUI.ForegroundColor = $currentColor
177177
}
178+
179+
function Install-DotNetCli
180+
{
181+
Write-Log "Install-DotNetCli: Get dotnet-install.ps1 script..."
182+
$dotnetInstallRemoteScript = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1"
183+
$dotnetInstallScript = Join-Path $env:TF_TOOLS_DIR "dotnet-install.ps1"
184+
if (-not (Test-Path $env:TF_TOOLS_DIR)) {
185+
New-Item $env:TF_TOOLS_DIR -Type Directory | Out-Null
186+
}
187+
188+
$dotnet_dir= Join-Path $env:TF_TOOLS_DIR "dotnet"
189+
190+
if (-not (Test-Path $dotnet_dir)) {
191+
New-Item $dotnet_dir -Type Directory | Out-Null
192+
}
193+
194+
(New-Object System.Net.WebClient).DownloadFile($dotnetInstallRemoteScript, $dotnetInstallScript)
195+
196+
if (-not (Test-Path $dotnetInstallScript)) {
197+
Write-Error "Failed to download dotnet install script."
198+
}
199+
200+
Unblock-File $dotnetInstallScript
201+
202+
Write-Log "Install-DotNetCli: Get the latest dotnet cli toolset..."
203+
$dotnetInstallPath = Join-Path $env:TF_TOOLS_DIR "dotnet"
204+
New-Item -ItemType directory -Path $dotnetInstallPath -Force | Out-Null
205+
& $dotnetInstallScript -Channel "master" -InstallDir $dotnetInstallPath -Version $env:DOTNET_CLI_VERSION
206+
207+
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '2.1.0' -Channel '2.1.0' -Architecture x64 -NoPath
208+
$env:DOTNET_ROOT= $dotnetInstallPath
209+
210+
& $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.0' -Channel '2.1.0' -Architecture x86 -NoPath
211+
${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86"
212+
213+
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '3.1.0' -Channel '3.1.0' -Architecture x64 -NoPath
214+
$env:DOTNET_ROOT= $dotnetInstallPath
215+
216+
& $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '3.1.0' -Channel '3.1.0' -Architecture x86 -NoPath
217+
${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86"
218+
219+
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '5.0.1' -Channel '5.0.1' -Architecture x64 -NoPath
220+
$env:DOTNET_ROOT= $dotnetInstallPath
221+
222+
& $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '5.0.1' -Channel '5.0.1' -Architecture x86 -NoPath
223+
${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86"
224+
225+
$env:DOTNET_MULTILEVEL_LOOKUP=0
226+
227+
"---- dotnet environment variables"
228+
Get-ChildItem "Env:\dotnet_*"
229+
230+
"`n`n---- x64 dotnet"
231+
& "$env:DOTNET_ROOT\dotnet.exe" --info
232+
233+
"`n`n---- x86 dotnet"
234+
# avoid erroring out because we don't have the sdk for x86 that global.json requires
235+
try {
236+
& "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info 2> $null
237+
} catch {}
238+
Write-Log "Install-DotNetCli: Complete."
239+
}

scripts/test.ps1

Lines changed: 78 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@ Param(
2626
[Switch] $Help = $false
2727
)
2828

29-
. $PSScriptRoot\common.lib.ps1
30-
3129
#
3230
# Script Preferences
3331
#
3432
$ErrorActionPreference = "Stop"
3533

34+
$CurrentScriptDir = (Get-Item (Split-Path $MyInvocation.MyCommand.Path))
35+
3636
#
3737
# Variables
3838
#
39+
$env:TF_ROOT_DIR = $CurrentScriptDir.Parent.FullName
40+
$env:TF_TOOLS_DIR = Join-Path $env:TF_ROOT_DIR "tools"
41+
$env:DOTNET_CLI_VERSION = "6.0.100-alpha.1.21067.8"
3942
$env:TF_TESTS_OUTDIR_PATTERN = "*.Tests"
4043
$env:TF_UNITTEST_FILES_PATTERN = "*.UnitTests*.dll"
4144
$env:TF_COMPONENTTEST_FILES_PATTERN = "*.ComponentTests*.dll"
4245
$env:TF_E2ETEST_FILES_PATTERN = "*.E2ETests*.dll"
4346
$env:TF_NetCoreContainers =@("MSTestAdapter.PlatformServices.NetCore.UnitTests.dll")
47+
4448
#
4549
# Test configuration
4650
#
@@ -49,7 +53,9 @@ $TFT_Configuration = $Configuration
4953
$TFT_Pattern = $Pattern
5054
$TFT_Parallel = $Parallel
5155
$TFT_All = $All
52-
$TestFramework = ".NETCoreApp,Version=v2.1"
56+
$TestFramework = ".NETCoreApp2.1"
57+
58+
. $PSScriptRoot\common.lib.ps1
5359

5460
#
5561
# Prints help text for the switches this script supports.
@@ -75,52 +81,54 @@ function Print-Help {
7581

7682
function Invoke-Test
7783
{
84+
& dotnet --info
85+
7886
$timer = Start-Timer
7987

8088
Write-Log "Run-Test: Started."
81-
89+
8290
Write-Log " Computing Test Containers."
8391
# Get all the test project folders. They should all be ending with ".Tests"
84-
$outDir = Join-Path $env:TF_OUT_DIR -ChildPath $TFT_Configuration
85-
$testFolders = Get-ChildItem $outDir -Directory -Filter $env:TF_TESTS_OUTDIR_PATTERN | %{$_.FullName}
92+
$outDir = Join-Path $env:TF_OUT_DIR -ChildPath $TFT_Configuration
93+
$testFolders = Get-ChildItem $outDir -Directory -Filter $env:TF_TESTS_OUTDIR_PATTERN | %{$_.FullName}
8694

8795
# Get test assemblies from these folders that match the pattern specified.
88-
foreach($container in $testFolders)
89-
{
90-
$testContainer = Get-ChildItem $container\* -Recurse -Include $env:TF_UNITTEST_FILES_PATTERN, $env:TF_COMPONENTTEST_FILES_PATTERN, $env:TF_E2ETEST_FILES_PATTERN
91-
96+
foreach($container in $testFolders)
97+
{
98+
$testContainer = Get-ChildItem $container\* -Recurse -Include $env:TF_UNITTEST_FILES_PATTERN, $env:TF_COMPONENTTEST_FILES_PATTERN, $env:TF_E2ETEST_FILES_PATTERN
99+
92100
$testContainerName = $testContainer.Name
93101
$testContainerPath = $testContainer.FullName
94102
$allContainers += ,"$testContainerName"
95103

96104
if($TFT_All)
97105
{
98-
if($env:TF_NetCoreContainers -Contains $testContainerName)
99-
{
100-
$netCoreTestContainers += ,"$testContainerPath"
101-
}
102-
else
103-
{
104-
$testContainers += ,"$testContainerPath"
105-
}
106+
if($env:TF_NetCoreContainers -Contains $testContainerName)
107+
{
108+
$netCoreTestContainers += ,"$testContainerPath"
109+
}
110+
else
111+
{
112+
$testContainers += ,"$testContainerPath"
113+
}
106114
}
107115
else
108116
{
109117
if($testContainerPath -match $TFT_Pattern)
110118
{
111-
if($env:TF_NetCoreContainers -Contains $testContainerName)
112-
{
113-
$netCoreTestContainers += ,"$testContainerPath"
114-
115-
}
116-
else
117-
{
118-
$testContainers += ,"$testContainerPath"
119-
}
119+
if($env:TF_NetCoreContainers -Contains $testContainerName)
120+
{
121+
$netCoreTestContainers += ,"$testContainerPath"
122+
123+
}
124+
else
125+
{
126+
$testContainers += ,"$testContainerPath"
127+
}
120128
}
121129
}
122-
}
123-
130+
}
131+
124132
if($testContainers.Count -gt 0 -Or $netCoreTestContainers.Count -gt 0)
125133
{
126134
$testContainersString = [system.String]::Join(",",$testContainers)
@@ -133,8 +141,8 @@ function Invoke-Test
133141
Write-Log " None of the test containers matched the pattern $TFT_Pattern."
134142
Write-Log " Test Containers available: $allContainersString."
135143
}
136-
137-
Write-Log "Run-Test: Complete. {$(Get-ElapsedTime($timer))}"
144+
145+
Write-Log "Run-Test: Complete. {$(Get-ElapsedTime($timer))}"
138146
}
139147

140148
function Run-Test([string[]] $testContainers, [string[]] $netCoreTestContainers)
@@ -146,52 +154,53 @@ function Run-Test([string[]] $testContainers, [string[]] $netCoreTestContainers)
146154
{
147155
$additionalArguments += "/parallel"
148156
}
149-
150-
if($testContainers.Count -gt 0)
151-
{
152-
if(!(Test-Path $vstestPath))
153-
{
154-
Write-Error "Unable to find vstest.console.exe at $vstestPath. Test aborted."
155-
}
156-
157-
Write-Verbose "$vstestPath $testContainers $additionalArguments /logger:trx"
158-
& $vstestPath $testContainers $additionalArguments /logger:trx
159-
160-
if ($lastExitCode -ne 0)
161-
{
162-
throw "Tests failed."
163-
}
164-
}
165-
166-
if($netCoreTestContainers.Count -gt 0)
167-
{
168-
Try
169-
{
170-
Write-Verbose "dotnet test $netCoreTestContainers /framework:$TestFramework $additionalArguments /logger:trx"
171-
& dotnet test $netCoreTestContainers /framework:$TestFramework $additionalArguments /logger:trx
172-
}
173-
174-
Catch [System.Management.Automation.CommandNotFoundException]
175-
{
176-
Write-Error "Unable to find dotnet.exe. Test aborted."
177-
}
178-
179-
if ($lastExitCode -ne 0)
180-
{
181-
throw "Tests failed."
182-
}
183-
}
157+
158+
if($testContainers.Count -gt 0)
159+
{
160+
if(!(Test-Path $vstestPath))
161+
{
162+
Write-Error "Unable to find vstest.console.exe at $vstestPath. Test aborted."
163+
}
164+
165+
Write-Verbose "$vstestPath $testContainers $additionalArguments /logger:trx"
166+
& $vstestPath $testContainers $additionalArguments /logger:trx
167+
168+
if ($lastExitCode -ne 0)
169+
{
170+
throw "Tests failed."
171+
}
172+
}
173+
174+
if($netCoreTestContainers.Count -gt 0)
175+
{
176+
Try
177+
{
178+
Write-Verbose "dotnet test $netCoreTestContainers /framework:`"$TestFramework`" $additionalArguments /logger:trx"
179+
& dotnet test $netCoreTestContainers /framework:"$TestFramework" $additionalArguments /logger:trx
180+
}
181+
182+
Catch [System.Management.Automation.CommandNotFoundException]
183+
{
184+
Write-Error "Unable to find dotnet.exe. Test aborted."
185+
}
186+
187+
if ($lastExitCode -ne 0)
188+
{
189+
throw "Tests failed."
190+
}
191+
}
184192
}
185193

186194
function Get-VSTestPath
187195
{
188196
$versionsFile = "$PSScriptRoot\build\TestFx.Versions.targets"
189197
$TestPlatformVersion = (([XML](Get-Content $versionsFile)).Project.PropertyGroup.TestPlatformVersion).InnerText
190198

191-
$vsInstallPath = "$PSScriptRoot\..\packages\Microsoft.TestPlatform.$TestPlatformVersion\"
192-
$vstestPath = Join-Path -path $vsInstallPath "tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
193-
return Resolve-Path -path $vstestPath
199+
$vsInstallPath = "$PSScriptRoot\..\packages\Microsoft.TestPlatform.$TestPlatformVersion\"
200+
$vstestPath = Join-Path -path $vsInstallPath "tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
201+
return Resolve-Path -path $vstestPath
194202
}
195203

196204
Print-Help
205+
Install-DotNetCli
197206
Invoke-Test

src/Adapter/PlatformServices.Desktop/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net451" developmentDependency="true" />
4-
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210204-01" targetFramework="net45" />
4+
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210211-01" targetFramework="net45" />
55
<package id="NuGet.Frameworks" version="5.0.0" targetFramework="net45" />
66
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
77
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net45" />

src/Adapter/PlatformServices.Interface/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="MicroBuild.Core" version="0.2.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
4-
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210204-01" targetFramework="portable45-net45+win8+wp8+wpa81" />
4+
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210211-01" targetFramework="portable45-net45+win8+wp8+wpa81" />
55
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
66
<package id="System.Collections" version="4.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
77
<package id="System.ComponentModel" version="4.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />

src/Adapter/PlatformServices.Portable/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="MicroBuild.Core" version="0.2.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
4-
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210204-01" targetFramework="portable45-net45+win8+wp8+wpa81" />
4+
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210211-01" targetFramework="portable45-net45+win8+wp8+wpa81" />
55
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
66
<package id="System.Collections" version="4.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
77
<package id="System.ComponentModel" version="4.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />

test/ComponentTests/PlatformServices.Desktop.Component.Tests/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Castle.Core" version="4.2.1" targetFramework="net451" />
4-
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210204-01" targetFramework="net451" />
4+
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210211-01" targetFramework="net451" />
55
<package id="Moq" version="4.8.2" targetFramework="net451" />
66
<package id="NuGet.Frameworks" version="5.0.0" targetFramework="net451" />
77
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net451" developmentDependency="true" />

test/E2ETests/Automation.CLI/CLITestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class CLITestBase
2020
private const string PackagesFolder = "packages";
2121

2222
// This value is automatically updated by "build.ps1" script.
23-
private const string TestPlatformCLIPackage = @"Microsoft.TestPlatform.16.10.0-preview-20210204-01";
23+
private const string TestPlatformCLIPackage = @"Microsoft.TestPlatform.16.10.0-preview-20210211-01";
2424
private const string VstestConsoleRelativePath = @"tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe";
2525

2626
private static VsTestConsoleWrapper vsTestConsoleWrapper;

test/E2ETests/Automation.CLI/packages.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.TestPlatform" version="16.10.0-preview-20210204-01" targetFramework="net46" />
4-
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210204-01" targetFramework="net46" />
5-
<package id="Microsoft.TestPlatform.TranslationLayer" version="16.10.0-preview-20210204-01" targetFramework="net46" />
6-
<package id="Microsoft.TestPlatform.AdapterUtilities" version="16.10.0-preview-20210204-01" targetFramework="net452" />
3+
<package id="Microsoft.TestPlatform" version="16.10.0-preview-20210211-01" targetFramework="net46" />
4+
<package id="Microsoft.TestPlatform.ObjectModel" version="16.10.0-preview-20210211-01" targetFramework="net46" />
5+
<package id="Microsoft.TestPlatform.TranslationLayer" version="16.10.0-preview-20210211-01" targetFramework="net46" />
6+
<package id="Microsoft.TestPlatform.AdapterUtilities" version="16.10.0-preview-20210211-01" targetFramework="net452" />
77
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
88
<package id="NuGet.Frameworks" version="5.0.0" targetFramework="net46" />
99
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net46" developmentDependency="true" />

0 commit comments

Comments
 (0)