Repository navigation
Keep test runs out of the machine's NuGet global-packages folder - #15
Merged
Merged
Conversation
- tests/run.sh and the new tests/manager.sh set NUGET_PACKAGES to a folder under dist/ for the run and remove it at the end, unless the caller set one; the machine's folder is a read-only fallback - a probe package is packed and restored to show where a restore writes, and the check is run against a copy that leaks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test runs could write a package they build into the machine's global-packages folder, where every other build on the machine resolves it instead of the published one. Nothing does so today (measured below); the coming tests that build real kit packages would.
tests/run.shand the newtests/manager.shsetNUGET_PACKAGESto a folder underdist/for the run and remove it at the end, unless the caller set one.NUGET_FALLBACK_PACKAGES), so third-party packages are not downloaded again;--no-nuget-fallbackrestores everything into the run's folder.managerjob runstests/manager.sh; the self-test job gets the isolation fromtests/run.sh.CONTRIBUTING.mdand the changelog describe it.Evidence
What a run writes to the machine's folder today (
mainat 3c8a823, id/version list of the folder before and aftersh tests/run.sh, then build, test, pack anddotnet tool install --tool-pathof the manager): no locally built package and no new third-party package. Packs go todist/, and a tool installed into a tool path keeps its own store.Fallback folder is read-only (.NET SDK 10.0.401, a scratch project,
NUGET_PACKAGES= a scratch folder,NUGET_FALLBACK_PACKAGES= the machine's folder):Guard goes red: in a copy whose
nuget.configmakes a scratch directory the machine's folder, with the isolation removed,tests/run.shandtests/manager.sheach exit 1 namingdragoant.fixture.cacheprobe <version>; with the isolation kept,tests/manager.shpasses and the scratch directory stays empty.Run time on CI, this branch against the last three runs of
main(one sample of this branch):mainLocally the self-test took 38m 13s before and 37m 29s after on a Windows machine that was busy with other work the whole time, so the fallback costs nothing measurable there; the cost of
--no-nuget-fallbackcould not be separated from that load. The added checks pack one small project and restore it twice.