perf(test): optimize git checkouts in pypi tests #5035
Merged
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.
Description
Optimizes the git PyPI update tests by replacing network-dependent GitHub clones with a local git fixture. The tests previously took 11-15 seconds each due to cloning from GitHub. Now they complete in ~4-5 seconds using a local fixture.
Changes:
GitRepoFixturehelper that creates temporary git repositories from versioned fixture directories (e.g.,001_v0.1.0/,002_v0.2.0/)tests/data/git-fixtures/minimal-pypi-package/without embedded.gitdirectoryno_installmode since these tests only verify lock file contents, not package installationurl::Url::from_directory_path()for Windows compatibilityBefore: ~39 seconds total (3 tests × ~13s each, hitting GitHub)
After: ~14 seconds total (3 tests × ~4.5s each, local only)
How Has This Been Tested?
All 3 tests pass:
test_update_conda_package_doesnt_update_git_pypi: 5.1stest_update_conda_package_doesnt_update_git_pypi_pinned: 4.3stest_update_git_pypi_when_requested: 4.7sAI Disclosure
Tools: Claude Code
Checklist: