perf(tests): share git-source fixture, drop pixi-run-git overhead#6033
Merged
baszalmstra merged 1 commit intoprefix-dev:mainfrom May 6, 2026
Merged
Conversation
Cuts test_git.py from 257.6s to 59.9s (-77%). - local_cpp_git_repo is now scope=session and uses system git instead of 'pixi run git', avoiding the per-test workspace env materialization. - test_git_path_build_has_absolutely_no_respect_to_lock_file gets its own local_cpp_git_repo_mutable fixture so the session-scoped repo stays read-only for the other 7 tests. - Setup time across 8 tests drops from 176s to 2.6s; the mutating test's call time drops from 24.6s to 12.1s.
1cc6798 to
3565ac3
Compare
Contributor
|
I do not have git on my system... but in the project environment that is active. As I read the code that is fine still, just wanted to double-check. |
hunger
approved these changes
May 6, 2026
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.
Description
Speeds up
tests/integration_python/pixi_build/test_specified_build_source/test_git.py.local_cpp_git_repois nowscope="session". 7 of the 8 tests don't mutate the repo, so they can share one initialization.gitinstead ofpixi run git, which previously had to materialize the workspace's pixi env on every invocation just to spawngitfromPATH.test_git_path_build_has_absolutely_no_respect_to_lock_file) now uses a separate function-scopedlocal_cpp_git_repo_mutablefixture so the shared repo stays read-only for everyone else.How Has This Been Tested?
CI Windows, slowest-durations entries for these tests:
test_git_path_lock_branch_records_branch_metadatatest_git_path_build_has_absolutely_no_respect_to_lock_filetest_git_path_buildtest_git_path_lock_consistent_across_platformstest_git_path_lock_tag_records_tag_metadatatest_git_path_lock_update_preserves_git_sourcetest_git_path_lock_rev_marks_explicit_revtest_git_path_lock_detects_manual_rev_changetest_git_path_buildtest_git_path_lock_branch_records_branch_metadatatest_git_path_build_has_absolutely_no_respect_to_lock_filetest_git_path_lock_tag_records_tag_metadata*the first test's call now absorbs the one-time session-fixture cost.
Net CI Windows saving on this file: ~243s, dominated by per-test setup elimination.
Local Windows (debug build), full file: 257.6s → 59.9s.
AI Disclosure
Tools: Claude Code (Opus 4.7).
Checklist: