Skip to content

Migrate legacy-only tests to net10.0 ahead of the tool-only 12.0 - #4450

Merged
fpellet merged 20 commits into
masterfrom
test/migrate-legacy-tests
Oct 10, 2026
Merged

fpellet merged 20 commits into
masterfrom
test/migrate-legacy-tests

Conversation

@fpellet

@fpellet fpellet commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Paket 12.0 drops paket.exe, the bootstrapper, Mono and the net461 target framework (see #4300). Some tests only did their real work on net461 today, sometimes in no CI job at all, while the code they cover is shared with the .NET tool. This PR moves them to net10.0 before anything is removed, so the CI still compares both frameworks while they migrate. The removal itself comes in a follow-up PR.

Bug found on the way: no_proxy was ignored by the .NET tool

The netstandard build replaced WebProxy with a hand-written IWebProxy:

  • its IsBypassed compared the whole URL with the regex patterns built from no_proxy, so no entry ever matched;
  • its default proxy ignored the system settings, unlike paket.exe.

The tests that would have caught it skipped exactly these assertions on net10.0 (//TODO readd check). WebProxy and WebRequest.GetSystemWebProxy are part of netstandard2.0, so both targets now use them. This is the only change outside the tests, with a release note.

What the .NET tool now does with no_proxy depends on where the proxy comes from:

  • HTTP_PROXY / HTTPS_PROXY: Paket builds the proxy and applies no_proxy itself, as curl does. An entry matches the host and its subdomains, * alone matches every host, and a matching host is reached directly.
  • ALL_PROXY only: Paket hands the request to the .NET system proxy, which reads ALL_PROXY and applies its own no_proxy rules. An entry matches that exact host, a leading . matches its subdomains, and * is not supported.

Tests now running on net10.0

New coverage: how Paket.Restore.targets finds the .NET tool

Every integration test pointed Paket.Restore.targets to the build output through PaketExePath. As a result, the branches that find a real installation had no coverage, and they are the only ones left in 12.0. DotnetToolSpecs installs the package the build packs and restores a project without PaketExePath, with paket installed in each of these ways:

  • as a local tool of the manifest;
  • with --tool-path .paket;
  • in a folder on the PATH, the way a global tool is.

How it stays isolated:

  • The install only uses temp/ and a packages folder of the scenario, because the global one may hold the nuget.org package of the same version.
  • The scenario gets its own empty tool manifest, so dotnet never walks up to the repository's manifest.

The NuGet build target now runs before the integration tests. The tests are ignored on a local dotnet test when no package was packed, and fail on CI, where the package is expected.

Not migrated

Everything in Paket.Bootstrapper.Tests is bootstrapper-only. Its proxy tests were the only overlap, and UtilsSpecs covers the same cases.

Issue: #4300

NUnit 3.12 supports TimeoutAttribute on netstandard2.0, so the
NO_UNIT_TIMEOUTATTRIBUTE workaround only hid the timeout and
cancellation tests there. PlatformAttribute still breaks the discovery
of the whole module on net10.0, so NO_UNIT_PLATFORMATTRIBUTE stays.
Outside Windows Crypto.encrypt uses AES, not ProtectedData, so the
ignore was stale and Linux coverage only came from the net461 pass
under Mono.
The netstandard build replaced WebProxy with a hand-written IWebProxy
whose IsBypassed compared the whole url with the regex patterns built
from no_proxy, so no entry ever matched, and whose default proxy
ignored the system settings. WebProxy and GetSystemWebProxy are part of
netstandard2.0, so use them on every target.

The proxy address and bypass assertions only ran on net461; they now
run on net10.0 as well.
PlatformAttribute hides the whole module on net10.0, so these tests
were ignored there and some ran in no CI job at all. Check the OS at
run time instead:
- #183 outdated flags and #1190 now run outside Windows on net10.0
- #3410 readonly obj files runs on Windows on net10.0
- #1174 Ninject conflict runs everywhere
- #1743 gets its own scenario instead of the bootstrapper one

Add a net10.0 test for the init command, which only had coverage
through the bootstrapper test, and drop the dead
TESTSUITE_KNOWN_FAILURE_DOTNETCORE_3005 and FAKE_NETSTANDARD_API
defines.
Every integration test pointed Paket.Restore.targets to the build
output through PaketExePath, so the branches that find a real
installation had no coverage. DotnetToolSpecs installs the package the
build packs and restores without PaketExePath, with paket as:
- a local tool of the manifest
- a tool installed with --tool-path .paket
- a tool on the PATH, as a global tool is

The install only uses temp/ and a packages folder of the scenario,
since the global one may hold the nuget.org package of the same
version. The NuGet target now runs before the integration tests; the
tests are ignored locally when no package was packed, and fail on CI.
They were marked flaky on .NET Core when the suite first ran there, so
once net461 is gone they would only run in the flaky job. They pass
reliably on net10.0, alone and in the full suite.
@fpellet
fpellet marked this pull request as ready for review October 10, 2026 16:26
@fpellet
fpellet merged commit 8f523f2 into master Oct 10, 2026
4 checks passed
@fpellet
fpellet deleted the test/migrate-legacy-tests branch October 10, 2026 16:26
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.

1 participant