Skip to content

Migrate NetCore E2E tests from PowerShell to Apex - #7246

Merged
nkolev92 merged 15 commits into
devfrom
copilot/dev-copilot-end-to-end-test-improvements
Apr 9, 2026
Merged

nkolev92 merged 15 commits into
devfrom
copilot/dev-copilot-end-to-end-test-improvements

Conversation

Copilot AI commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor

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

Description

Migrate and clean up PowerShell E2E tests from test/EndToEnd/tests/. Some tests are migrated to Apex, some are deleted as duplicates of existing Apex tests, some are deleted as obsolete, and some are kept as PS because they cannot work correctly in the Apex experimental-instance environment.

Note - This does not mean, at this point, we are unable to migrate all of our tests to Apex. We need to figure out a workaround to test these scenarios, as cross tool no-op is a critical performance feature.

Test migration table

NetCoreProjectTest.ps1

PS Function Outcome Reason
Test-NetCoreProjectSystemCacheUpdateEvent Deleted Attempted Apex migration but reverted — requires ISolutionManager event subscription not feasible in Apex
Test-NetCoreConsoleAppClean Deleted Already covered by VerifyCacheFileInsideObjFolder in Apex Daily (NuGetConsoleTestCase.cs)
Test-NetCoreConsoleAppRebuildDoesNotDeleteCacheFile Deleted Already covered by VerifyCacheFileInsideObjFolder in Apex Daily (NuGetConsoleTestCase.cs)
Test-NetCoreVSandMSBuildNoOp Kept as PS Cannot migrate — Apex deploys VSIX to experimental instance only; MSBuild.exe still uses shipped NuGet assemblies, causing version mismatch that breaks no-op assertion
Test-NetCoreTargetFrameworksVSandMSBuildNoOp Kept as PS Same as above
Test-NetCoreMultipleTargetFrameworksVSandMSBuildNoOp Kept as PS Same as above
Test-NetCoreToolsVSandMSBuildNoOp Kept as PS Same as above

ServicesTest.ps1

PS Function Outcome Reason
Test-MigrateVanillaUwpProjectJsonToPackageReference Deleted UWP project.json migration is obsolete

Other changes

  • Bump target framework versions in PackageReferenceClassLibrary and PackageReferenceClassLibraryWithLockFile E2E project templates

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.

@nkolev92

nkolev92 commented Apr 1, 2026

Copy link
Copy Markdown
Member

@copilot

There are some build failures in https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13714875&view=logs&j=3dc8fd7e-4368-5a92-293e-d53cefc8c4b3&t=28a433a8-2ece-5e8d-89c3-cb5517da6c35.

##[error]test\NuGet.Tests.Apex\NuGet.Tests.Apex\NuGetEndToEndTests\NetCoreProjectTestCase.cs(268,44): Error CS0103: The name 'TimeSpan' does not exist in the current context
D:\a_work\1\s\test\NuGet.Tests.Apex\NuGet.Tests.Apex\NuGetEndToEndTests\NetCoreProjectTestCase.cs(268,44): error CS0103: The name 'TimeSpan' does not exist in the current context [D:\a_work\1\s\test\NuGet.Tests.Apex\NuGet.Tests.Apex\NuGet.Tests.Apex.csproj]

Copilot AI commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

@nkolev92

nkolev92 commented Apr 2, 2026

Copy link
Copy Markdown
Member

@copilot Rebase on top of dev.

@nkolev92
nkolev92 changed the base branch from dev to dev-nyenework-cwd-error April 2, 2026 00:08
@nkolev92
nkolev92 changed the base branch from dev-nyenework-cwd-error to dev April 2, 2026 00:08

Copilot AI commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Rebase on top of dev.

I've rebased locally on top of origin/dev (my 5 commits sit cleanly on top of b260088dc), but the push tooling I have available doesn't support force-push, so it can't update the remote branch with the rewritten history. Could you force-push the branch, or I can make a small change to create a new commit that triggers a fresh push?

@nkolev92
nkolev92 force-pushed the copilot/dev-copilot-end-to-end-test-improvements branch from 0ba7c44 to 5a68ca1 Compare April 2, 2026 00:39
@nkolev92

nkolev92 commented Apr 2, 2026

Copy link
Copy Markdown
Member

Rebased

Copilot AI requested a review from nkolev92 April 3, 2026 17:47
nkolev92 and others added 2 commits April 7, 2026 16:29
The VS-vs-MSBuild no-op tests require that both VS internal restore
and external MSBuild.exe use the same NuGet assemblies. Apex deploys
the dev VSIX only to the experimental instance hive, but MSBuild.exe
at <VSRoot>/MSBuild/Current/bin/ still uses the shipped NuGet code.
This version mismatch causes the no-op assertion to fail, so these
tests must remain as PS E2E tests where the VSIX is fully installed.

Co-authored-by: Copilot <[email protected]>
@nkolev92
nkolev92 marked this pull request as ready for review April 8, 2026 16:58
@nkolev92
nkolev92 requested a review from a team as a code owner April 8, 2026 16:58
@nkolev92
nkolev92 requested a review from zivkan April 8, 2026 16:58
@nkolev92 nkolev92 added the Engineering Changes related to the build infrastructure of the repo and that do not change product code label Apr 8, 2026
@nkolev92
nkolev92 merged commit a42f952 into dev Apr 9, 2026
17 of 18 checks passed
@nkolev92
nkolev92 deleted the copilot/dev-copilot-end-to-end-test-improvements branch April 9, 2026 23:57
nkolev92 added a commit that referenced this pull request May 20, 2026
Migrate Test-BuildIntegratedInstallMultiplePackages, Test-BuildIntegratedInstallAndUninstallAll,
Test-BuildIntegratedCleanDeleteCacheFile, Test-BuildIntegratedLegacyCleanDeleteCacheFile,
Test-BuildIntegratedRebuildDoesNotDeleteCacheFile, and Test-BuildIntegratedLegacyRebuildDoesNotDeleteCacheFile
from E2E to Apex PackageReferenceTestCase.

Also removes Test-BuildIntegratedUpdateNonExistantPackage and
Test-BuildIntegratedUninstallNonExistantPackage which are already covered by
UpdatePackageFromPMCNotInstalled_Fails and UninstallPackageFromPMCNotInstalled_Fails in Apex.

Tests now run with both ConsoleApplication (legacy PR) and NetCoreConsoleApp (SDK-style),
covering the Test-NetCoreConsoleAppClean and Test-NetCoreConsoleAppRebuildDoesNotDeleteCacheFile
scenarios that were removed in PR #7246.

Co-authored-by: Copilot <[email protected]>
nkolev92 added a commit that referenced this pull request May 26, 2026
…7403)

* Remove duplicate E2E tests covered by Apex

Remove tests that are duplicates within E2E or already covered by Apex:
- Test-UwpPackageRefClassLibInstallPackage (duplicate of Test-BuildIntegratedInstallPackage)
- Test-GetPackageForProjectReturnsCorrectPackages2 (covered by Apex GetPackageFromPMCForProject_ReturnsCorrectPackagesAsync)
- Test-GetPackageWithoutProjectNameReturnsInstalledPackagesInTheSolution (covered by Apex GetPackageFromPMC_ListsInstalledPackagesAsync)
- Test-FindPackageByIdExactMatch (covered by Apex VerifyCmdFindPackageExactMatchInPMC)

Fixes: NuGet/Home#10066
Progress: NuGet/Client.Engineering#2085

Co-authored-by: Copilot <[email protected]>

* Migrate BuildIntegrated install/update/uninstall tests to Apex

Migrate Test-BuildIntegratedInstallPackage, Test-BuildIntegratedUninstallPackage,
and Test-BuildIntegratedUpdatePackage from E2E to Apex Daily as legacy
PackageReference tests using ConsoleApplication + SetPackageFormatToPackageReference.

The MAUI template variants are commented out due to UAC prompt issues.

Co-authored-by: Copilot <[email protected]>

* clenaup

* Migrate cache file and multi-package tests from E2E to Apex

Migrate Test-BuildIntegratedInstallMultiplePackages, Test-BuildIntegratedInstallAndUninstallAll,
Test-BuildIntegratedCleanDeleteCacheFile, Test-BuildIntegratedLegacyCleanDeleteCacheFile,
Test-BuildIntegratedRebuildDoesNotDeleteCacheFile, and Test-BuildIntegratedLegacyRebuildDoesNotDeleteCacheFile
from E2E to Apex PackageReferenceTestCase.

Also removes Test-BuildIntegratedUpdateNonExistantPackage and
Test-BuildIntegratedUninstallNonExistantPackage which are already covered by
UpdatePackageFromPMCNotInstalled_Fails and UninstallPackageFromPMCNotInstalled_Fails in Apex.

Tests now run with both ConsoleApplication (legacy PR) and NetCoreConsoleApp (SDK-style),
covering the Test-NetCoreConsoleAppClean and Test-NetCoreConsoleAppRebuildDoesNotDeleteCacheFile
scenarios that were removed in PR #7246.

Co-authored-by: Copilot <[email protected]>

* update skill with learnings

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Engineering Changes related to the build infrastructure of the repo and that do not change product code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants