You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 46ba8ff
Browse filesBrowse the repository at this point in the historyBrowse files
perf(tests): reduce Windows submodule process overhead
Windows process startup makes repeated Git version probes and missing-hook
checks costly in the submodule tests. A relative `git` executable also
prevents the existing minimum-version cache from being shared on Windows.
Resolve `git.exe` from `PATH` to an absolute `GIT_PYTHON_GIT_EXECUTABLE` for
Windows CI and the local runner, preserving explicit overrides. Use the
selected executable for the runner's direct Git commands. Pass
`skip_hooks=True` at 70 submodule fixture commit sites, preserving normal
`IndexFile.commit()` defaults and dedicated hook coverage.
Match CI's private configuration by appending the alias fixture directly
and retaining `core.autocrlf=true` on Windows. The previous `include.path`
forced Gix repository reloads during local measurements. Document the Git
Bash invocation and distinguish these local setup corrections from CI gains.
Validation also exposed a daemon-test deadline shorter than Windows' closed
loopback-port refusal delay: fresh closed ports returned `TimeoutError` at
two seconds and `ConnectionRefusedError` just after 2.02 seconds. Allow five
seconds for the post-shutdown check while retaining its strict refusal
assertion and restart coverage.
A controlled, serial 37-case Windows Gix sample with identical flat config,
profiling enabled and coverage disabled improved from 87.10s to 77.20s.
Git launches fell from 1,437 to 1,128: 132 fewer version probes and 177 fewer
hook checks. This is about 11% faster in the sample, not a full-suite estimate.
Validation used CPython 3.12.13, Git 2.55.0.windows.5 and `GixPython` 0.1.0:
- Both complete submodule modules and related checks ran with CI's coverage
options. CLI finished with 542 passed, 1 skipped, 1 xfailed and 3 xpassed.
- The initial Gix selection had 546 passed, 1 failed, 1 xfailed and 3 xpassed.
Its sole failure was the daemon deadline corrected here; that regression
passed on a targeted rerun and in the subsequent CLI run.
- Replaying the original submodule source from `c3a2832b` reproduced the CLI
`test_base_rw` file-lock skip, confirming it predates these changes.
- Pre-commit checks passed for all changed files. Git Bash checks covered
executable resolution, explicit overrides and the non-Windows branch;
changed Python files also parse with Python 3.8 syntax.
The macOS Python 3.9 through 3.13 CI jobs failed before pytest with
`conditional binary operator expected`: Apple's Bash 3.2 parses the complete
Windows setup condition and does not support `[[ -v VARIABLE ]]`, even when
the operating-system comparison is false. Use `${VARIABLE+x}` to test whether
`GIT_PYTHON_GIT_EXECUTABLE` is set, preserving explicitly empty values and
leaving Windows discovery limited to an unset executable override.
Validation: the six OS/unset/empty/value combinations passed under Apple's
Bash 3.2.57; the workflow's applicable pre-commit checks and `git diff --check`
passed. Hosted macOS validation follows the push.
Windows CI subsequently exposed a historical command-mock assumption in
`test_call_process_calls_execute`: after this workflow pins the executable,
`Git.version()` correctly passes its absolute path instead of the literal
`git`. Assert against `Git.GIT_PYTHON_GIT_EXECUTABLE` so the test retains its
command-dispatch happy path with either executable configuration. The
focused test passed with `GIT_PYTHON_GIT_EXECUTABLE=/usr/bin/git`.
0 commit comments