From 11ab4bd1961977a48effb644a223a3dc6bf6e111 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 2 May 2019 08:44:51 -0700 Subject: [PATCH 1/2] Fix aspnet e2e tests - add `-CliManifestName` option to run-tests.ps1 command - pass `-CliManifestName` and more from YAML to run-tests.ps1 - pass access token suffix --- .azure/pipelines/e2e-tests.yml | 6 +++--- test/Cli.FunctionalTests/run-tests.ps1 | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.azure/pipelines/e2e-tests.yml b/.azure/pipelines/e2e-tests.yml index 06e544cb49..89872313dc 100644 --- a/.azure/pipelines/e2e-tests.yml +++ b/.azure/pipelines/e2e-tests.yml @@ -37,7 +37,7 @@ jobs: inputs: versionSpec: $(Node.Version) - powershell: | - test/Cli.FunctionalTests/run-tests.ps1 -ci -ProdConManifestUrl $env:PRODCONMANIFESTURL -TestRuntimeIdentifier $(Test.RuntimeIdentifier) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES + test/Cli.FunctionalTests/run-tests.ps1 -ci -CliManifestName $(CliManifestName) -RestoreSources $(PB_RestoreSource) -AccessTokenSuffix '$(AccessTokenSuffix)' -AssetRootUrl $(PB_AssetRootUrl) -ProdConManifestUrl $env:PRODCONMANIFESTURL -TestRuntimeIdentifier $(Test.RuntimeIdentifier) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES condition: ne(variables['PB_SkipTests'], 'true') displayName: Run E2E tests @@ -73,7 +73,7 @@ jobs: inputs: versionSpec: $(Node.Version) - powershell: | - test/Cli.FunctionalTests/run-tests.ps1 -ci -ProdConManifestUrl $env:PRODCONMANIFESTURL -TestRuntimeIdentifier $(Test.RuntimeIdentifier) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES + test/Cli.FunctionalTests/run-tests.ps1 -ci -CliManifestName $(CliManifestName) -RestoreSources $(PB_RestoreSource) -AccessTokenSuffix '$(AccessTokenSuffix)' -AssetRootUrl $(PB_AssetRootUrl) -ProdConManifestUrl $env:PRODCONMANIFESTURL -TestRuntimeIdentifier $(Test.RuntimeIdentifier) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES condition: ne(variables['PB_SkipTests'], 'true') displayName: Run E2E tests @@ -119,7 +119,7 @@ jobs: inputs: versionSpec: $(Node.Version) - powershell: | - test/Cli.FunctionalTests/run-tests.ps1 -ci -ProdConManifestUrl $env:PRODCONMANIFESTURL -TestRuntimeIdentifier $(Test.RuntimeIdentifier) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES + test/Cli.FunctionalTests/run-tests.ps1 -ci -CliManifestName $(CliManifestName) -RestoreSources $(PB_RestoreSource) -AccessTokenSuffix '$(AccessTokenSuffix)' -AssetRootUrl $(PB_AssetRootUrl) -ProdConManifestUrl $env:PRODCONMANIFESTURL -TestRuntimeIdentifier $(Test.RuntimeIdentifier) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES condition: ne(variables['PB_SkipTests'], 'true') displayName: Run E2E tests diff --git a/test/Cli.FunctionalTests/run-tests.ps1 b/test/Cli.FunctionalTests/run-tests.ps1 index fe7e21eac5..d59a4feb33 100644 --- a/test/Cli.FunctionalTests/run-tests.ps1 +++ b/test/Cli.FunctionalTests/run-tests.ps1 @@ -44,6 +44,7 @@ param( $HostRid, $ProdConManifestUrl, $ProdConChannel = 'release/2.1', + $CliManifestName = "cli.xml", $AdditionalRestoreSources ) @@ -115,7 +116,7 @@ try { Write-Error "Missing required parameter: AssetRootUrl" } $AssetRootUrl = $AssetRootUrl.TrimEnd('/') - $cliMetadataUrl = "$AssetRootUrl/orchestration-metadata/manifests/cli.xml${AccessTokenSuffix}" + $cliMetadataUrl = "$AssetRootUrl/orchestration-metadata/manifests/${CliManifestName}${AccessTokenSuffix}" Write-Host "CliMetadataUrl: $cliMetadataUrl" [xml] $cli = Invoke-RestMethod $cliMetadataUrl $sdkVersion = $cli.Build.ProductVersion From 064dce2bef1852ab8674bb7ee539dc01d384e7a7 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 6 May 2019 15:30:00 -0700 Subject: [PATCH 2/2] Get e2e tests running - correct `--filter` syntax; perform `contains` match on `Name` and not `FullyQualifiedName` - `FullyQualifiedName` doesn't seem to include NUnit test case data - move to latest test package versions - support recent SDK versions Background: successful but no-op builds have been common lately - blocking real work on aspnet/AspNetCore-Internal#1843 --- test/Cli.FunctionalTests/Cli.FunctionalTests.csproj | 6 +++--- test/Cli.FunctionalTests/Util/DotNetUtil.cs | 4 ++-- test/Cli.FunctionalTests/run-tests.ps1 | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj b/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj index b2227fad1e..4632b9769c 100644 --- a/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj +++ b/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj @@ -10,11 +10,11 @@ - + - - + + diff --git a/test/Cli.FunctionalTests/Util/DotNetUtil.cs b/test/Cli.FunctionalTests/Util/DotNetUtil.cs index 5c6d2f51c8..3131e3fcbb 100644 --- a/test/Cli.FunctionalTests/Util/DotNetUtil.cs +++ b/test/Cli.FunctionalTests/Util/DotNetUtil.cs @@ -64,8 +64,8 @@ namespace Cli.FunctionalTests.Util var runtimeVersionString = Regex.Match(info, runtimeVersionPattern, RegexOptions.RightToLeft).Groups[1].Value; var runtimeVersion = SemanticVersion.Parse(runtimeVersionString); - // Supported version range is [2.1.300,2.2.100] (inclusive) - if (sdkVersion >= new SemanticVersion(2, 1, 300) && sdkVersion <= new SemanticVersion(2, 2, 100)) + // Supported version range is [2.1.300,2.2.210] (inclusive) + if (sdkVersion >= new SemanticVersion(2, 1, 300) && sdkVersion <= new SemanticVersion(2, 2, 210)) { return (sdkVersion, runtimeVersion); } diff --git a/test/Cli.FunctionalTests/run-tests.ps1 b/test/Cli.FunctionalTests/run-tests.ps1 index d59a4feb33..c41bf6c192 100644 --- a/test/Cli.FunctionalTests/run-tests.ps1 +++ b/test/Cli.FunctionalTests/run-tests.ps1 @@ -164,7 +164,7 @@ try { [string[]] $filterArgs = @() if ($TestRuntimeIdentifier) { - $filterArgs += '--filter',"rid: $TestRuntimeIdentifier" + $filterArgs += '--filter',"Name~rid: $TestRuntimeIdentifier" } Invoke-Block { & $dotnet test `