Skip to content

Commit 3f6d529

Browse files
authored
Fix gallery functional tests now that CPM is enabled (#10080)
* Delete unused files * Use repo-level tools list * Use NuGet.Services.Configuration 2.94.0 to avoid assembly load issues The functional test runner does not support binding redirects in all cases (web UI tests). Therefore we need this version to pull in properly aligned dependencies.
1 parent a104050 commit 3f6d529

11 files changed

Lines changed: 11 additions & 94 deletions

.editorconfig

Whitespace-only changes.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ nuget.exe
409409

410410
# Functional test results
411411
tests/functionaltests.*.xml
412-
tests/Scripts/TestResults[*].trx
412+
*.trx
413+
*.g.txt
413414

414415
# The applicationhost.config is ignored, but already comitted on purpose
415416
# Reason: The localtest.me setting needs to be configured in the <sites>-section.

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
5-
<EnablePackageVersionOverride>false</EnablePackageVersionOverride>
5+
<EnablePackageVersionOverride>true</EnablePackageVersionOverride>
66

77
<NuGetClientPackageVersion>6.9.1</NuGetClientPackageVersion>
88
<ServerCommonPackageVersion>2.120.0</ServerCommonPackageVersion>

tests/.nuget/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<config>
4-
<add key="repositorypath" value="..\packages" />
5-
</config>
63
<packageSourceMapping>
74
<clear />
85
<!--

tests/NuGetGallery.FunctionalTests.Core/NuGetGallery.FunctionalTests.Core.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,10 @@
7474
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
7575
<PackageReference Include="Microsoft.Web.Xdt" />
7676
<PackageReference Include="NuGet.Core" />
77-
<PackageReference Include="NuGet.Services.Configuration" />
77+
<PackageReference Include="NuGet.Services.Configuration" VersionOverride="2.94.0" />
7878
<PackageReference Include="NuGet.Versioning" />
7979
<PackageReference Include="xunit" />
8080
<PackageReference Include="xunit.runner.visualstudio">
81-
<Version>2.8.2</Version>
8281
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
8382
<PrivateAssets>all</PrivateAssets>
8483
</PackageReference>

tests/Scripts/AutoDeploy.ps1

Lines changed: 0 additions & 58 deletions
This file was deleted.

tests/Scripts/BuildTests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ $msBuild = Join-Path $VsInstallationPath "MSBuild\Current\Bin\msbuild"
1414
$nuget = "$rootName\nuget.exe"
1515
& "$rootName\Scripts\DownloadLatestNuGetExeRelease.ps1" $rootName
1616

17+
Write-Host "Restoring solution tools"
18+
& $nuget install (Join-Path $PSScriptRoot "..\..\packages.config") -SolutionDirectory (Join-Path $PSScriptRoot "..\..") -NonInteractive -ExcludeVersion
19+
1720
# Restore packages
18-
Write-Host "Restoring packages"
21+
Write-Host "Restoring solution"
1922
$fullSolutionPath = "$rootName\$SolutionPath"
2023
& $nuget "restore" $fullSolutionPath "-NonInteractive"
2124
if ($LastExitCode) {

tests/Scripts/DownloadLatestNuGetExeRelease.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ if (Test-Path $targetNugetExePath) {
1010
return
1111
}
1212

13-
Write-Host "nuget.exe not found in $Directory"
14-
1513
$sourceNugetExeUrl = "https://dist.nuget.org/win-x86-commandline/v6.10.1/nuget.exe"
1614
Write-Host "Downloading nuget.exe from $sourceNugetExeUrl"
15+
$ProgressPreference = 'SilentlyContinue'
1716
Invoke-WebRequest $sourceNugetExeUrl -OutFile $targetNugetExePath
17+
$ProgressPreference = 'Continue'

tests/Scripts/RunTests.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ $rootName = $root.FullName
1010
$rootRootName = $root.parent.FullName
1111

1212
# Required tools
13-
$nuget = "$rootName\nuget.exe"
1413
$BuiltInVsWhereExe = "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
1514
$VsInstallationPath = & $BuiltInVsWhereExe -latest -prerelease -property installationPath
1615
$vsTest = Join-Path $VsInstallationPath "Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
17-
$xunit = "$rootRootName\packages\xunit.runner.console.2.3.1\tools\net452\xunit.console.exe"
16+
$xunit = "$rootRootName\packages\xunit.runner.console\tools\net472\xunit.console.exe"
1817

1918
# Test results files
2019
$functionalTestsResults = "$rootName/functionaltests.$TestCategory.xml"

0 commit comments

Comments
 (0)