Skip to content

Migrate 11 PowerShell E2E tests to C# Apex tests - #7345

Merged
nkolev92 merged 7 commits into
devfrom
copilot/dev-copilot-migrate-e2e-to-apex
May 5, 2026
Merged

nkolev92 merged 7 commits into
devfrom
copilot/dev-copilot-migrate-e2e-to-apex

Conversation

Copilot AI commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Progress: https://github.com/NuGet/Client.Engineering/issues/2085

Description

Migrates PowerShell E2E tests to C# Apex tests in NuGetConsoleTestCase.cs and removes the migrated PS tests.

PowerShell Test (Removed) Source File C# Apex Test (Added)
Test-GetPackageListsInstalledPackages GetPackageTest.ps1 GetPackageFromPMC_ListsInstalledPackagesAsync
Test-GetPackageForProjectReturnsEmptyProjectIfItHasNoInstalledPackage GetPackageTest.ps1 (merged into GetPackageFromPMC_ListsInstalledPackagesAsync)
Test-GetPackageForProjectReturnsCorrectPackages GetPackageTest.ps1 GetPackageFromPMCForProject_ReturnsCorrectPackagesAsync
Test-GetPackageForProjectReturnsEmptyIfItHasNoInstalledPackage GetPackageTest.ps1 (removed; covered by GetPackageFromPMC_ListsInstalledPackagesAsync)
Test-GetPackageForProjectReturnsEmptyIfItHasNoInstalledPackage2 GetPackageTest.ps1 GetPackageFromPMCForProject_ReturnsEmptyForOtherProjectAsync
Test-GetInstalledPackageWithFilterReturnsCorrectPackage GetPackageTest.ps1 GetPackageFromPMCWithFilter_ReturnsMatchingPackageAsync
Test-GetPackageWhenSourceSwitchNotSpecified GetPackageTest.ps1 GetPackageFromPMCWithListAvailable_ReturnsAvailablePackagesAsync
Test-PipingMultipleProjectsToInstall InstallPackageTest.ps1 InstallPackageFromPMCToMultipleProjects_SucceedsAsync
Test-UpdatingPackageWhatIf UpdatePackageTest.ps1 UpdatePackageFromPMCWithWhatIf_DoesNotUpdateAsync
Test-UpdatePackageAcceptsSourceName UpdatePackageTest.ps1 UpdatePackageFromPMCToSpecificVersion_UpdatesCorrectlyAsync
Test-UpdateProjectLevelPackageNotInstalledInAnyProject UpdatePackageTest.ps1 (removed; covered by existing tests)

Additional improvements made during review:

  • GetPackageFromPMC_ListsInstalledPackagesAsync now asserts Get-Package returns empty before any install, then asserts both packages appear after — consolidating the "empty before install" coverage into a single test.
  • InstallPackageFromPMCToMultipleProjects_SucceedsAsync uses Get-Project -All | Install-Package piping syntax, matching the original PS1 behavior.
  • All Get-Package test assertions use a ParseGetPackageTableOutput helper that returns List<PmcPackageEntry> with Id, Versions, and ProjectName properties parsed from the PMC fixed-width table output.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

Copilot AI and others added 2 commits April 29, 2026 15:44
…ase.cs

Migrated tests from GetPackageTest.ps1, UpdatePackageTest.ps1, and InstallPackageTest.ps1:
- GetPackageFromPMC_ListsInstalledPackagesAsync
- GetPackageFromPMCForProject_ReturnsEmptyForNoInstalledPackages
- GetPackageFromPMCForProject_ReturnsCorrectPackagesAsync
- GetPackageFromPMCForProject_ReturnsEmptyForOtherProjectAsync
- GetPackageFromPMCWithFilter_ReturnsMatchingPackageAsync
- UpdatePackageFromPMCWithWhatIf_DoesNotUpdateAsync
- UpdatePackageFromPMCToSpecificVersion_UpdatesCorrectlyAsync
- InstallPackageFromPMCToMultipleProjects_SucceedsAsync
- InstallPackageFromPMCWithIgnoreDependencies_InstallsOnlySpecifiedPackageAsync
- UninstallPackageFromPMCWithForce_RemovesPackageEvenWithDependentsAsync
- UninstallPackageFromPMCWithRemoveDependencies_RemovesAllAsync
- GetPackageFromPMCWithNoSolution_Fails

Agent-Logs-Url: https://github.com/NuGet/NuGet.Client/sessions/725e5c3b-f932-4705-9629-4683d5d072c7

Co-authored-by: nkolev92 <[email protected]>
@nkolev92 nkolev92 changed the title Migrate 12 PowerShell E2E tests to C# Apex tests Migrate 11 PowerShell E2E tests to C# Apex tests Apr 30, 2026
@nkolev92
nkolev92 marked this pull request as ready for review April 30, 2026 17:48
@nkolev92
nkolev92 requested a review from a team as a code owner April 30, 2026 17:48
@nkolev92
nkolev92 requested a review from Nigusu-Allehu April 30, 2026 17:48

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • data.nuget.org
    • Triggering command: /usr/bin/dotnet dotnet msbuild test/NuGet.Tests.Apex/NuGet.Tests.Apex/NuGet.Tests.Apex.csproj -v:q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from nkolev92 May 4, 2026 20:32
Copilot AI requested a review from nkolev92 May 4, 2026 20:44
Copilot AI requested a review from nkolev92 May 4, 2026 20:54
Copilot AI requested a review from nkolev92 May 4, 2026 21:10
@nkolev92
nkolev92 enabled auto-merge (squash) May 5, 2026 16:18
@nkolev92
nkolev92 requested a review from Nigusu-Allehu May 5, 2026 16:22
@nkolev92
nkolev92 merged commit c938070 into dev May 5, 2026
17 of 18 checks passed
@nkolev92
nkolev92 deleted the copilot/dev-copilot-migrate-e2e-to-apex branch May 5, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants