Skip to content

ci: speed up the tests on Windows - #227

Merged
thorsten-klein merged 5 commits into
mainfrom
ci/windows-test-speed
Nov 14, 2026
Merged

thorsten-klein merged 5 commits into
mainfrom
ci/windows-test-speed

Conversation

@thorsten-klein

@thorsten-klein thorsten-klein commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Windows test jobs took 13–20 min. Linux took about 2 min.

The tests start many git processes. On Windows each one costs about 46 ms.

  • Turn off Defender scanning on Windows.
  • Put TEMP on a Dev Drive on Windows. The test repos live there.
  • Build the upstream test repos once per session. Each test copies them.
  • Make fewer git calls in git-nested. Ref names are checked in Python. The git version and some repo facts are asked only once.
  • PRs test only Python 3.10 and 3.14. main still tests all versions. The ruleset for main now requires only these checks.

Git calls in a full local test run: 54.8k before, 39.5k after.

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3a1b0aa) to head (1994aa5).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #227   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        50           
  Lines         2863      2874   +11     
=========================================
+ Hits          2863      2874   +11     
Files with missing lines Coverage Δ
src/git_nested/checks.py 100.00% <100.00%> (ø)
src/git_nested/cli/setup.py 100.00% <100.00%> (ø)
src/git_nested/commands/clean.py 100.00% <100.00%> (ø)
src/git_nested/commands/clone.py 100.00% <100.00%> (ø)
src/git_nested/commands/pull.py 100.00% <100.00%> (ø)
src/git_nested/commands/status.py 100.00% <100.00%> (ø)
src/git_nested/content.py 100.00% <100.00%> (ø)
src/git_nested/git.py 100.00% <100.00%> (ø)
src/git_nested/refs.py 100.00% <100.00%> (ø)

@thorsten-klein thorsten-klein changed the title ci: speed up Windows tests ci: speed up the tests on Windows Nov 14, 2026
The tests start many git processes and write many small files.
Defender scans each one.
Each test copies them. It no longer builds them again.
The fixtures also make fewer git calls. This makes the tests
much faster on Windows, where each git call is slow.
- Check ref names in Python instead of with git check-ref-format.
- Ask for the git version only once per git binary.
- Ask for --git-dir and --is-inside-work-tree in one call.
- Ask for the worktree suffix only once per command.
main still tests all Python versions.
The test repos in tmp_path then live on a fast ReFS drive.
@sonarqubecloud

Copy link
Copy Markdown

@thorsten-klein
thorsten-klein merged commit b1fecf8 into main Nov 14, 2026
15 checks passed
@thorsten-klein
thorsten-klein deleted the ci/windows-test-speed branch November 14, 2026 08:04
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