Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
erdembayar committed Jul 12, 2021
1 parent 6bbffe7 commit 1a74e36
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 147 deletions.
3 changes: 1 addition & 2 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
Expand All @@ -9,7 +9,6 @@
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
<add key="vside_vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
<add key="vside_vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
<add key="Devdiv" value="https://devdiv.pkgs.visualstudio.com/_packaging/vs-impl/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public int MaxDegreeOfParallelism

set
{
_maxDegreeOfParallelism = 1;// Math.Max(1, value);
_maxDegreeOfParallelism = Math.Max(1, value);
}
}

Expand All @@ -81,7 +81,6 @@ public static async Task<HashSet<SourcePackageDependencyInfo>> GatherAsync(

private async Task<HashSet<SourcePackageDependencyInfo>> GatherAsync(CancellationToken token)
{
Debugger.Launch();
// preserve start time of gather api
var stopWatch = new Stopwatch();
stopWatch.Start();
Expand Down
Binary file modified test/EndToEnd/API.Test.dll
Binary file not shown.
111 changes: 0 additions & 111 deletions test/EndToEnd/tests/PackageNameSpaceTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,117 +115,6 @@ function Test-PackageNamespaceRestore-WithMultipleFeedsWithIdenticalPackages-Res
}
}

function Test-PackageNamespaceInstall-WithSingleFeed
{
param($context)

# Arrange
$repoDirectory = $context.RepositoryRoot
$nugetConfigPath = Join-Path $OutputPath 'nuget.config'

$settingFileContent =@"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="ReadyPackages" value="{0}" />
</packageSources>
<packageNamespaces>
<packageSource key="ReadyPackages">
<namespace id="Soluti*" />
</packageSource>
</packageNamespaces>
</configuration>
"@

try {
# We have to create config file before creating solution, otherwise it's not effective for new solutions.
$settingFileContent -f $repoDirectory | Out-File -Encoding "UTF8" $nugetConfigPath

$p = New-ConsoleApplication

$projectDirectoryPath = $p.Properties.Item("FullPath").Value
$packagesConfigPath = Join-Path $projectDirectoryPath 'packages.config'
$projectDirectoryPath = $p.Properties.Item("FullPath").Value
$solutionDirectory = Split-Path -Path $projectDirectoryPath -Parent

# Act
$p | Install-Package SolutionLevelPkg -version 1.0.0

# Assert
$packagesFolder = Join-Path $solutionDirectory "packages"
$solutionLevelPkgNupkgFolder = Join-Path $packagesFolder "SolutionLevelPkg.1.0.0"
Assert-PathExists(Join-Path $solutionLevelPkgNupkgFolder "SolutionLevelPkg.1.0.0.nupkg")

$errorlist = Get-Errors
Assert-AreEqual 0 $errorlist.Count
}
finally {
Remove-Item $nugetConfigPath
}
}

function Test-PackageNamespaceRestore-WithMultipleFeedsWithIdenticalPackages-InstallCorrectPackage
{
param($context)

# Arrange
$repoDirectory = Join-Path $OutputPath "CustomPackages"
$opensourceRepo = Join-Path $repoDirectory "opensourceRepo"
$privateRepo = Join-Path $repoDirectory "privateRepo"
$nugetConfigPath = Join-Path $OutputPath 'nuget.config'

$settingFileContent =@"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="OpensourceRepository" value="{0}" />
<add key="PrivateRepository" value="{1}" />
</packageSources>
<packageNamespaces>
<packageSource key="PrivateRepository">
<namespace id="Contoso.MVC.*" />
</packageSource>
</packageNamespaces>
</configuration>
"@
try {
# We have to create config file before creating solution, otherwise it's not effective for new solutions.
$settingFileContent -f $opensourceRepo,$privateRepo | Out-File -Encoding "UTF8" $nugetConfigPath

$p = New-ConsoleApplication

$projectDirectoryPath = $p.Properties.Item("FullPath").Value
$packagesConfigPath = Join-Path $projectDirectoryPath 'packages.config'
$projectDirectoryPath = $p.Properties.Item("FullPath").Value
$solutionDirectory = Split-Path -Path $projectDirectoryPath -Parent

CreateCustomTestPackage "Contoso.MVC.ASP" "1.0.0" $privateRepo "Thisisfromprivaterepo.txt"
CreateCustomTestPackage "Contoso.MVC.ASP" "2.0.0" $privateRepo "Thisisfromprivaterepo2.txt"
CreateCustomTestPackage "Contoso.MVC.ASP" "1.0.0" $opensourceRepo "Thisisfromopensourcerepo.txt"
CreateCustomTestPackage "Contoso.MVC.ASP" "2.0.0" $opensourceRepo "Thisisfromopensourcerepo2.txt"

# Act
Install-Package "Contoso.MVC.ASP" -ProjectName $p.Name -version 1.0.0

# Assert
$packagesFolder = Join-Path $solutionDirectory "packages"
$contosoNupkgFolder = Join-Path $packagesFolder "Contoso.MVC.ASP.1.0.0"
Assert-PathExists(Join-Path $contosoNupkgFolder "Contoso.MVC.ASP.1.0.0.nupkg")
# Make sure name squatting package from public repo not restored.
$contentFolder = Join-Path $contosoNupkgFolder "content"
Assert-PathExists(Join-Path $contentFolder "Thisisfromprivaterepo.txt")

$errorlist = Get-Errors
Assert-AreEqual 0 $errorlist.Count
}
finally {
Remove-Item -Recurse -Force $repoDirectory
Remove-Item $nugetConfigPath
}
}

# Create a custom test package
function CreateCustomTestPackage {
param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(NuGetClientsSrcDirectory)NuGet.SolutionRestoreManager.Interop\NuGet.SolutionRestoreManager.Interop.csproj" />
<ProjectReference Include="$(NuGetClientsSrcDirectory)NuGet.VisualStudio\NuGet.VisualStudio.csproj" />
<ProjectReference Include="..\..\..\src\NuGet.Clients\NuGet.VisualStudio.Contracts\NuGet.VisualStudio.Contracts.csproj" />
<ProjectReference Include="..\..\TestUtilities\Test.Utility\Test.Utility.csproj" />
Expand Down
25 changes: 0 additions & 25 deletions test/NuGet.Tests.Apex/NuGet.Tests.Apex/NuGet.Tests.Apex.sln

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public void SearchPackageFromUI()
public void InstallPackageFromUI()
{
// Arrange
System.Diagnostics.Debugger.Launch();
EnsureVisualStudioHost();
var dte = VisualStudio.Dte;
var solutionService = VisualStudio.Get<SolutionService>();
Expand Down Expand Up @@ -165,7 +164,6 @@ public async Task InstallPackageFromUI_PackageNamespace_WithSingleFeed_Match_Suc
// Arrange
EnsureVisualStudioHost();
var solutionService = VisualStudio.Get<SolutionService>();
System.Diagnostics.Debugger.Launch();
string solutionDirectory = CommonUtility.CreateSolutionDirectory(Directory.GetCurrentDirectory());
solutionService.CreateEmptySolution("TestSolution", solutionDirectory);

Expand Down Expand Up @@ -213,7 +211,6 @@ public async Task InstallPackageFromUI_PackageNamespace_WithSingleFeed_NoMatch_S
// Arrange
EnsureVisualStudioHost();
var solutionService = VisualStudio.Get<SolutionService>();
System.Diagnostics.Debugger.Launch();
string solutionDirectory = CommonUtility.CreateSolutionDirectory(Directory.GetCurrentDirectory());
solutionService.CreateEmptySolution("TestSolution", solutionDirectory);

Expand Down Expand Up @@ -262,7 +259,6 @@ public async Task InstallPackageToProjectsFromUI_PackageNamespace_WithSingleFeed
// Arrange
EnsureVisualStudioHost();
var solutionService = VisualStudio.Get<SolutionService>();
System.Diagnostics.Debugger.Launch();
string solutionDirectory = CommonUtility.CreateSolutionDirectory(Directory.GetCurrentDirectory());
solutionService.CreateEmptySolution("TestSolution", solutionDirectory);

Expand Down Expand Up @@ -317,7 +313,6 @@ public async Task InstallPackageToProjectsFromUI_PackageNamespace_WithSingleFeed
// Arrange
EnsureVisualStudioHost();
var solutionService = VisualStudio.Get<SolutionService>();
System.Diagnostics.Debugger.Launch();
string solutionDirectory = CommonUtility.CreateSolutionDirectory(Directory.GetCurrentDirectory());
solutionService.CreateEmptySolution("TestSolution", solutionDirectory);

Expand Down Expand Up @@ -372,7 +367,6 @@ public async Task InstallPackageFromUI_PackageNamespace_WithMultiFeed_Fails()
// Arrange
EnsureVisualStudioHost();
var solutionService = VisualStudio.Get<SolutionService>();
System.Diagnostics.Debugger.Launch();
string solutionDirectory = CommonUtility.CreateSolutionDirectory(Directory.GetCurrentDirectory());
solutionService.CreateEmptySolution("TestSolution", solutionDirectory);

Expand Down Expand Up @@ -429,7 +423,6 @@ public async Task UpdatePackageFromUI_PackageNamespace_WithSingleFeed_Succeeds()
// Arrange
EnsureVisualStudioHost();
var solutionService = VisualStudio.Get<SolutionService>();
System.Diagnostics.Debugger.Launch();
string solutionDirectory = CommonUtility.CreateSolutionDirectory(Directory.GetCurrentDirectory());
solutionService.CreateEmptySolution("TestSolution", solutionDirectory);

Expand Down

0 comments on commit 1a74e36

Please sign in to comment.