From 71fff14deed96bed7793d26f4efd2e2f938f695a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 31 Aug 2018 00:35:41 +0000 Subject: [PATCH 1/9] Updating submodule(s) Configuration => 4d3f720193095ac58784ca6bc6e0f4b5cb4000e3 KestrelHttpServer => 153020ef8a81aa6b4c6efebd83a8b04863e4d40d [auto-updated: submodules] --- modules/Configuration | 2 +- modules/KestrelHttpServer | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Configuration b/modules/Configuration index 544666fd83..4d3f720193 160000 --- a/modules/Configuration +++ b/modules/Configuration @@ -1 +1 @@ -Subproject commit 544666fd831a4b04cec9ae058b7720c5f6e7b6a1 +Subproject commit 4d3f720193095ac58784ca6bc6e0f4b5cb4000e3 diff --git a/modules/KestrelHttpServer b/modules/KestrelHttpServer index 80b30b21ee..153020ef8a 160000 --- a/modules/KestrelHttpServer +++ b/modules/KestrelHttpServer @@ -1 +1 @@ -Subproject commit 80b30b21eecc743551d2b748e0dd45379d28350f +Subproject commit 153020ef8a81aa6b4c6efebd83a8b04863e4d40d From 5e5bf6712a182da956599d773018cc30f1b92e1e Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 31 Aug 2018 15:21:57 +0000 Subject: [PATCH 2/9] Updating submodule(s) IISIntegration => db01ae37170c948bf9b6d61332d67c4d0bdb6e8d [auto-updated: submodules] --- modules/IISIntegration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/IISIntegration b/modules/IISIntegration index 729a98adfc..db01ae3717 160000 --- a/modules/IISIntegration +++ b/modules/IISIntegration @@ -1 +1 @@ -Subproject commit 729a98adfc03442b27b3f7953704e7022a9e1829 +Subproject commit db01ae37170c948bf9b6d61332d67c4d0bdb6e8d From 64078159fac582c33fd34dc47fd086d7f464d662 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 31 Aug 2018 09:11:18 -0700 Subject: [PATCH 3/9] Updating submodule(s) IISIntegration => 0459b6d0d48635e72939ecf789cad32fb41578ba [auto-updated: submodules] --- modules/IISIntegration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/IISIntegration b/modules/IISIntegration index db01ae3717..0459b6d0d4 160000 --- a/modules/IISIntegration +++ b/modules/IISIntegration @@ -1 +1 @@ -Subproject commit db01ae37170c948bf9b6d61332d67c4d0bdb6e8d +Subproject commit 0459b6d0d48635e72939ecf789cad32fb41578ba From a57ed95fd30bfb8503a8d38260a5792e1639b1db Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 31 Aug 2018 11:20:58 -0700 Subject: [PATCH 4/9] Fix errors connecting to github from powershell and TLS1.2 in test scripts --- scripts/common.psm1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/common.psm1 b/scripts/common.psm1 index 97b5216f85..c7a59ee7df 100644 --- a/scripts/common.psm1 +++ b/scripts/common.psm1 @@ -1,4 +1,6 @@ $ErrorActionPreference = 'Stop' +# Update the default TLS support to 1.2 +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 function Assert-Git { if (!(Get-Command git -ErrorAction Ignore)) { From e7f50eb932b40fb32c8c9d3041b72628ca0c5852 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 31 Aug 2018 18:34:30 +0000 Subject: [PATCH 5/9] Updating submodule(s) Scaffolding => 1b91f5cae8b17fed684c3b0f3a433340beba2e08 [auto-updated: submodules] --- modules/Scaffolding | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Scaffolding b/modules/Scaffolding index 5b113cd96f..1b91f5cae8 160000 --- a/modules/Scaffolding +++ b/modules/Scaffolding @@ -1 +1 @@ -Subproject commit 5b113cd96f4dd324291e5339331e64956b1a7e2c +Subproject commit 1b91f5cae8b17fed684c3b0f3a433340beba2e08 From 60fc0158c1250df281408d7356d5c78c91c38f65 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 31 Aug 2018 12:25:29 -0700 Subject: [PATCH 6/9] Flow the ProdCon restore feed in to E2E tests --- test/Cli.FunctionalTests/run-tests.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Cli.FunctionalTests/run-tests.ps1 b/test/Cli.FunctionalTests/run-tests.ps1 index 4de03f0552..61197640c1 100644 --- a/test/Cli.FunctionalTests/run-tests.ps1 +++ b/test/Cli.FunctionalTests/run-tests.ps1 @@ -93,6 +93,9 @@ try { $env:MSBuildSdksPath = '' $env:PATH = "$dotnetRoot;$env:PATH" + # Required by the tests. It is assumed packages on this feed will end up on nuget.org + $env:NUGET_PACKAGE_SOURCE = $RestoreSources + Invoke-Block { & $dotnet test ` --logger "console;verbosity=detailed" ` --logger "trx;LogFileName=$repoRoot/artifacts/logs/e2etests.trx" ` From 3cbf1ea7d192ec72af143252afa3c1df7802617b Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 31 Aug 2018 13:03:48 -0700 Subject: [PATCH 7/9] Updating submodule(s) Scaffolding => d67c85e2e7e59046083214e91cf0aeee38199dcf [auto-updated: submodules] --- modules/Scaffolding | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Scaffolding b/modules/Scaffolding index 1b91f5cae8..d67c85e2e7 160000 --- a/modules/Scaffolding +++ b/modules/Scaffolding @@ -1 +1 @@ -Subproject commit 1b91f5cae8b17fed684c3b0f3a433340beba2e08 +Subproject commit d67c85e2e7e59046083214e91cf0aeee38199dcf From b2cf5028e0216c459cf77e0ce648a99bbcb605b4 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 31 Aug 2018 14:24:32 -0700 Subject: [PATCH 8/9] Run E2E tests in parallel and on macOS (#1369) --- .vsts/builds/e2e-tests.yml | 81 ++++++++++++++++++++------ test/Cli.FunctionalTests/run-tests.ps1 | 65 +++++++++++++++++++-- 2 files changed, 123 insertions(+), 23 deletions(-) diff --git a/.vsts/builds/e2e-tests.yml b/.vsts/builds/e2e-tests.yml index 014f5481ba..d4f237a600 100644 --- a/.vsts/builds/e2e-tests.yml +++ b/.vsts/builds/e2e-tests.yml @@ -1,19 +1,64 @@ trigger: none -queue: - name: DotNetCore-Windows - timeoutInMinutes: 120 -steps: -- task: NodeTool@0 - displayName: Install Node 10.x - inputs: - versionSpec: 10.x -- powershell: | - test/Cli.FunctionalTests/run-tests.ps1 -ci -ProdConManifestUrl $env:ProdConManifestUrl - condition: ne(variables['PB_SkipTests'], 'true') - displayName: Run E2E tests -- task: PublishTestResults@2 - displayName: Publish test results - condition: always() - inputs: - testRunner: vstest - testResultsFiles: 'artifacts/logs/**/*.trx' +phases: +- phase: Host_Windows + queue: + name: DotNetCore-Windows + parallel: 4 + matrix: + Portable: + Test.RuntimeIdentifier: none + SelfContainedWindows: + Test.RuntimeIdentifier: win-x64 + SelfContainedLinux: + Test.RuntimeIdentifier: linux-x64 + SelfContainedMacOs: + Test.RuntimeIdentifier: osx-x64 + steps: + - task: NodeTool@0 + displayName: Install Node 10.x + inputs: + versionSpec: 10.x + - powershell: | + test/Cli.FunctionalTests/run-tests.ps1 ` + -ci ` + -ProdConManifestUrl $env:ProdConManifestUrl ` + -TestRuntimeIdentifier $(Test.RuntimeIdentifier) + condition: ne(variables['PB_SkipTests'], 'true') + displayName: Run E2E tests + - task: PublishTestResults@2 + displayName: Publish test results + condition: always() + inputs: + testRunner: vstest + testResultsFiles: 'artifacts/logs/**/*.trx' +- phase: Host_macOS + queue: + name: Hosted macOS Preview + parallel: 4 + matrix: + Portable: + Test.RuntimeIdentifier: none + SelfContainedWindows: + Test.RuntimeIdentifier: win-x64 + SelfContainedLinux: + Test.RuntimeIdentifier: linux-x64 + SelfContainedMacOs: + Test.RuntimeIdentifier: osx-x64 + steps: + - task: NodeTool@0 + displayName: Install Node 10.x + inputs: + versionSpec: 10.x + - powershell: | + test/Cli.FunctionalTests/run-tests.ps1 \ + -ci \ + -ProdConManifestUrl $env:ProdConManifestUrl \ + -TestRuntimeIdentifier $(Test.RuntimeIdentifier) + condition: ne(variables['PB_SkipTests'], 'true') + displayName: Run E2E tests + - task: PublishTestResults@2 + displayName: Publish test results + condition: always() + inputs: + testRunner: vstest + testResultsFiles: 'artifacts/logs/**/*.trx' diff --git a/test/Cli.FunctionalTests/run-tests.ps1 b/test/Cli.FunctionalTests/run-tests.ps1 index 61197640c1..871946f15f 100644 --- a/test/Cli.FunctionalTests/run-tests.ps1 +++ b/test/Cli.FunctionalTests/run-tests.ps1 @@ -14,6 +14,16 @@ The blob feed for the .NET Core CLI. If not specified, it will determined automa .PARAMETER RestoreSources A list of additional NuGet feeds. If not specified, it will determined automatically if possible. +.PARAMETER TestRuntimeIdentifier +Filter the tests by which RID they publish for. If empty (default), tests are run for +* none (portable) +* osx-x64 +* linux-x64 +* win-x64 + +.PARAMETER HostRid +The RID of the platform running the tests. (Determined automatically if possible) + .PARAMETER ProdConManifestUrl The prodcon build.xml file @@ -26,6 +36,9 @@ param( $AssetRootUrl = $env:PB_AccessRootUrl, $AccessTokenSuffix = $env:PB_AccessTokenSuffix, $RestoreSources = $env:PB_RestoreSources, + [ValidateSet('none', 'osx-x64', 'linux-x64', 'win-x64')] + $TestRuntimeIdentifier, + $HostRid, $ProdConManifestUrl, $ProcConChannel = 'release/2.2' ) @@ -36,12 +49,40 @@ Set-StrictMode -Version 1 $repoRoot = Resolve-Path "$PSScriptRoot/../../" Import-Module "$repoRoot/scripts/common.psm1" -Scope Local -Force +if (-not $HostRid) { + if (Test-Path Variable:/IsCoreCLR) { + $HostRid = if ($IsWindows) { 'win-x64' } ` + elseif ($IsLinux) { 'linux-x64' } ` + elseif ($IsMacOS) { 'osx-x64' } + } + else { + $HostRid = 'win-x64' + } +} + +if (-not $HostRid) { + throw 'Could not determine which platform this script is running on. Add -HostRid $rid where $rid = the .NET Core SDK to install' +} + +switch ($HostRid) { + 'win-x64' { + $dotnetFileName = 'dotnet.exe' + $archiveExt = '.zip' + } + default { + $dotnetFileName = 'dotnet' + $archiveExt = '.tar.gz' + } +} + Push-Location $PSScriptRoot try { New-Item -Type Directory "$PSScriptRoot/obj/" -ErrorAction Ignore | Out-Null $sdkVersion = '' if (-not $ci -or $ProdConManifestUrl) { + # Workaround for pwsh 6 dumping progress info + $ProgressPreference = 'SilentlyContinue' if (-not $ProdConManifestUrl) { Write-Host -ForegroundColor Magenta "Running tests for the latest ProdCon build" @@ -76,14 +117,21 @@ try { @{ sdk = @{ version = $sdkVersion } } | ConvertTo-Json | Set-Content "$PSScriptRoot/global.json" $dotnetRoot = "$repoRoot/.dotnet" - $dotnet = "$dotnetRoot/dotnet.exe" + $dotnet = "$dotnetRoot/$dotnetFileName" if (-not (Test-Path "$dotnetRoot/sdk/$sdkVersion/dotnet.dll")) { Remove-Item -Recurse -Force $dotnetRoot -ErrorAction Ignore | Out-Null - $cliUrl = "$AssetRootUrl/Sdk/$sdkVersion/dotnet-sdk-$sdkVersion-win-x64.zip" + $cliUrl = "$AssetRootUrl/Sdk/$sdkVersion/dotnet-sdk-$sdkVersion-$HostRid$archiveExt" + $cliArchiveFile = "$PSScriptRoot/obj/dotnet$archiveExt" Write-Host "Downloading $cliUrl" - Invoke-WebRequest -UseBasicParsing "${cliUrl}${AccessTokenSuffix}" -OutFile "$PSScriptRoot/obj/dotnet.zip" - Expand-Archive "$PSScriptRoot/obj/dotnet.zip" -DestinationPath $dotnetRoot + Invoke-WebRequest -UseBasicParsing "${cliUrl}${AccessTokenSuffix}" -OutFile $cliArchiveFile + if ($archiveExt -eq '.zip') { + Expand-Archive $cliArchiveFile -DestinationPath $dotnetRoot + } + else { + New-Item -Type Directory $dotnetRoot -ErrorAction Ignore | Out-Null + Invoke-Block { & tar xzf $cliArchiveFile -C $dotnetRoot } + } } # Set a clean test environment @@ -96,11 +144,18 @@ try { # Required by the tests. It is assumed packages on this feed will end up on nuget.org $env:NUGET_PACKAGE_SOURCE = $RestoreSources + [string[]] $filterArgs = @() + + if ($TestRuntimeIdentifier) { + $filterArgs += '--filter',"rid: $TestRuntimeIdentifier" + } + Invoke-Block { & $dotnet test ` --logger "console;verbosity=detailed" ` --logger "trx;LogFileName=$repoRoot/artifacts/logs/e2etests.trx" ` "-p:DotNetRestoreSources=$RestoreSources" ` - "-bl:$repoRoot/artifacts/logs/e2etests.binlog" } + "-bl:$repoRoot/artifacts/logs/e2etests.binlog" ` + @filterArgs } } finally { Pop-Location From a22b715bf494fdf9d53544f8d04304910ca10894 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Fri, 31 Aug 2018 16:56:56 -0700 Subject: [PATCH 9/9] Update published files for 2.2-preview2 (#1370) - Also convert env vars to UPPER_CASE for compat with Mac and Linux --- .vsts/builds/e2e-tests.yml | 7 ++----- test/Cli.FunctionalTests/Cli.FunctionalTests.sln | 5 +++++ .../Templates/RazorApplicationBaseTemplate.cs | 7 +------ .../Templates/WebApiTemplate.cs | 10 ---------- test/Cli.FunctionalTests/Templates/WebTemplate.cs | 14 ++++++++++++++ test/Cli.FunctionalTests/run-tests.ps1 | 8 ++++---- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.vsts/builds/e2e-tests.yml b/.vsts/builds/e2e-tests.yml index d4f237a600..3db5a15233 100644 --- a/.vsts/builds/e2e-tests.yml +++ b/.vsts/builds/e2e-tests.yml @@ -21,7 +21,7 @@ phases: - powershell: | test/Cli.FunctionalTests/run-tests.ps1 ` -ci ` - -ProdConManifestUrl $env:ProdConManifestUrl ` + -ProdConManifestUrl $env:PRODCONMANIFESTURL ` -TestRuntimeIdentifier $(Test.RuntimeIdentifier) condition: ne(variables['PB_SkipTests'], 'true') displayName: Run E2E tests @@ -50,10 +50,7 @@ phases: inputs: versionSpec: 10.x - powershell: | - test/Cli.FunctionalTests/run-tests.ps1 \ - -ci \ - -ProdConManifestUrl $env:ProdConManifestUrl \ - -TestRuntimeIdentifier $(Test.RuntimeIdentifier) + test/Cli.FunctionalTests/run-tests.ps1 -ci -ProdConManifestUrl $env:PRODCONMANIFESTURL -TestRuntimeIdentifier $(Test.RuntimeIdentifier) condition: ne(variables['PB_SkipTests'], 'true') displayName: Run E2E tests - task: PublishTestResults@2 diff --git a/test/Cli.FunctionalTests/Cli.FunctionalTests.sln b/test/Cli.FunctionalTests/Cli.FunctionalTests.sln index 6aff0f5478..42f7f90f69 100644 --- a/test/Cli.FunctionalTests/Cli.FunctionalTests.sln +++ b/test/Cli.FunctionalTests/Cli.FunctionalTests.sln @@ -5,6 +5,11 @@ VisualStudioVersion = 15.0.28016.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cli.FunctionalTests", "Cli.FunctionalTests.csproj", "{D44EA496-EF83-4D47-8C45-4DAF5A1B0070}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0EC88B4E-B1F2-4183-9EBF-BF66C45D19D7}" + ProjectSection(SolutionItems) = preProject + ..\..\.vsts\builds\e2e-tests.yml = ..\..\.vsts\builds\e2e-tests.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/test/Cli.FunctionalTests/Templates/RazorApplicationBaseTemplate.cs b/test/Cli.FunctionalTests/Templates/RazorApplicationBaseTemplate.cs index f1dceecde4..a7ac0d7001 100644 --- a/test/Cli.FunctionalTests/Templates/RazorApplicationBaseTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/RazorApplicationBaseTemplate.cs @@ -51,11 +51,6 @@ namespace Cli.FunctionalTests.Templates public override IEnumerable ExpectedFilesAfterPublish => base.ExpectedFilesAfterPublish - .Concat(RazorUtil.GetExpectedFilesAfterPublish(this)) - .Concat(new[] - { - "appsettings.Development.json", - "appsettings.json", - }); + .Concat(RazorUtil.GetExpectedFilesAfterPublish(this)); } } diff --git a/test/Cli.FunctionalTests/Templates/WebApiTemplate.cs b/test/Cli.FunctionalTests/Templates/WebApiTemplate.cs index 4bb6fa3c48..5609063371 100644 --- a/test/Cli.FunctionalTests/Templates/WebApiTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/WebApiTemplate.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Collections.Generic; -using System.Linq; namespace Cli.FunctionalTests.Templates { @@ -13,13 +11,5 @@ namespace Cli.FunctionalTests.Templates public override string Name => "webapi"; public override string RelativeUrl => "/api/values"; - - public override IEnumerable ExpectedFilesAfterPublish => - base.ExpectedFilesAfterPublish - .Concat(new[] - { - "appsettings.Development.json", - "appsettings.json", - }); } } diff --git a/test/Cli.FunctionalTests/Templates/WebTemplate.cs b/test/Cli.FunctionalTests/Templates/WebTemplate.cs index a2e77925f6..3571ca6cfc 100644 --- a/test/Cli.FunctionalTests/Templates/WebTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/WebTemplate.cs @@ -220,15 +220,29 @@ namespace Cli.FunctionalTests.Templates }, { ("netcoreapp2.2", RuntimeIdentifier.None), () => _additionalFilesAfterPublish[("netcoreapp2.1", RuntimeIdentifier.None)]() + .Concat(new[] + { + "appsettings.Development.json", + "appsettings.json", + }) }, { ("netcoreapp2.2", RuntimeIdentifier.Linux_x64), () => _additionalFilesAfterPublish[("netcoreapp2.1", RuntimeIdentifier.Linux_x64)]() + .Except(new[] + { + "Microsoft.AspNetCore.Identity.UI.Views.dll", + }) .Concat(new[] { + "appsettings.Development.json", + "appsettings.json", "Microsoft.AspNetCore.Diagnostics.HealthChecks.dll", + "Microsoft.AspNetCore.Identity.UI.Views.V3.dll", + "Microsoft.AspNetCore.Identity.UI.Views.V4.dll", "Microsoft.AspNetCore.Server.IIS.dll", "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.dll", "Microsoft.Extensions.Diagnostics.HealthChecks.dll", + "Microsoft.Extensions.Options.DataAnnotations.dll", }) }, { ("netcoreapp2.2", RuntimeIdentifier.OSX_x64), () => diff --git a/test/Cli.FunctionalTests/run-tests.ps1 b/test/Cli.FunctionalTests/run-tests.ps1 index 871946f15f..5c04f369f9 100644 --- a/test/Cli.FunctionalTests/run-tests.ps1 +++ b/test/Cli.FunctionalTests/run-tests.ps1 @@ -33,9 +33,9 @@ The prodcon channel to use if a build.xml file isn't set. param( [switch]$ci, - $AssetRootUrl = $env:PB_AccessRootUrl, - $AccessTokenSuffix = $env:PB_AccessTokenSuffix, - $RestoreSources = $env:PB_RestoreSources, + $AssetRootUrl = $env:PB_ASSETROOTURL, + $AccessTokenSuffix = $env:PB_ACCESSTOKENSUFFIX, + $RestoreSources = $env:PB_RESTORESOURCES, [ValidateSet('none', 'osx-x64', 'linux-x64', 'win-x64')] $TestRuntimeIdentifier, $HostRid, @@ -138,7 +138,7 @@ try { $env:DOTNET_ROOT = $dotnetRoot $env:DOTNET_MULTILEVEL_LOOKUP = 0 $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 0 - $env:MSBuildSdksPath = '' + $env:MSBUILDSDKSPATH = '' $env:PATH = "$dotnetRoot;$env:PATH" # Required by the tests. It is assumed packages on this feed will end up on nuget.org