diff --git a/.azure/pipelines/e2e-tests.yml b/.azure/pipelines/e2e-tests.yml index 6019a47184b1b6d28d674c711ceb7916eb544c9d..528dfd6929f21f05447949f137b6677a561a90ad 100644 --- a/.azure/pipelines/e2e-tests.yml +++ b/.azure/pipelines/e2e-tests.yml @@ -19,7 +19,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) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES condition: ne(variables['PB_SkipTests'], 'true') displayName: Run E2E tests - task: PublishTestResults@2 @@ -47,7 +47,7 @@ phases: inputs: versionSpec: 8.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) -AdditionalRestoreSources $env:ADDITIONALRESTORESOURCES condition: ne(variables['PB_SkipTests'], 'true') displayName: Run E2E tests - task: PublishTestResults@2 diff --git a/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj b/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj index 385a9dde2a0a18fdcadc897196ecf6993a3aac90..b2227fad1e3509be6e4a81a0c6ed4fe606b4d423 100644 --- a/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj +++ b/test/Cli.FunctionalTests/Cli.FunctionalTests.csproj @@ -6,7 +6,6 @@ <LangVersion>latest</LangVersion> <RestoreSources> https://api.nuget.org/v3/index.json; - $(DotNetRestoreSources) </RestoreSources> </PropertyGroup> diff --git a/test/Cli.FunctionalTests/Cli.FunctionalTests.sln b/test/Cli.FunctionalTests/Cli.FunctionalTests.sln index 42f7f90f693c3ad055362ff8e43f1fffbfca813e..82d40614d1698dd31bd169c3b7491901299a94d8 100644 --- a/test/Cli.FunctionalTests/Cli.FunctionalTests.sln +++ b/test/Cli.FunctionalTests/Cli.FunctionalTests.sln @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cli.FunctionalTests", "Cli. 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 + ..\..\.azure\pipelines\e2e-tests.yml = ..\..\.azure\pipelines\e2e-tests.yml EndProjectSection EndProject Global diff --git a/test/Cli.FunctionalTests/NuGetPackageSource.cs b/test/Cli.FunctionalTests/NuGetPackageSource.cs index 30545f8ca55130351881835bb8c6a2ebd20b4e63..e1bbce195a337be1597b227e1b4f36d650fea51c 100644 --- a/test/Cli.FunctionalTests/NuGetPackageSource.cs +++ b/test/Cli.FunctionalTests/NuGetPackageSource.cs @@ -51,7 +51,10 @@ namespace Cli.FunctionalTests var sourceString = Environment.GetEnvironmentVariable("NUGET_PACKAGE_SOURCE") ?? throw new InvalidOperationException("Environment variable NUGET_PACKAGE_SOURCE is required but not set"); - return string.Join(" ", sourceString.Split(',').Select(s => $"--source {s}")); + // Split on pipe and remove blank entries + var sources = sourceString.Split('|').Where(s => !string.IsNullOrWhiteSpace(s)); + + return string.Join(" ", sources.Select(s => $"--source {s}")); } } } diff --git a/test/Cli.FunctionalTests/run-tests.ps1 b/test/Cli.FunctionalTests/run-tests.ps1 index 76fc8ec77bfa96b40d91ba14c7411ebfaa4c9efd..e21ee723344f38eea4a2c736d70f8b07096c8f13 100644 --- a/test/Cli.FunctionalTests/run-tests.ps1 +++ b/test/Cli.FunctionalTests/run-tests.ps1 @@ -29,6 +29,9 @@ The prodcon build.xml file .PARAMETER ProdConChannel The prodcon channel to use if a build.xml file isn't set. + +.PARAMETER AdditionalRestoreSources +A pipe-separated list of extra NuGet feeds. Required for builds which need to restore from multiple feeds. #> param( @@ -40,7 +43,8 @@ param( $TestRuntimeIdentifier, $HostRid, $ProdConManifestUrl, - $ProdConChannel = 'release/2.1' + $ProdConChannel = 'release/2.1', + $AdditionalRestoreSources ) $ErrorActionPreference = 'Stop' @@ -117,6 +121,10 @@ try { $sdkVersion = $cli.Build.ProductVersion } + if ($AdditionalRestoreSources) { + $RestoreSources += "|$AdditionalRestoreSources" + } + Write-Host "sdkVersion: $sdkVersion" Write-Host "AssetRootUrl: $AssetRootUrl" Write-Host "RestoreSources: $RestoreSources" @@ -160,7 +168,6 @@ try { 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" ` @filterArgs } }