Git test environment consistency by elovelan · Pull Request #2152 · gitpython-developers/GitPython
Repository navigation
Git test environment consistency - #2152
Closed
elovelan wants to merge 2 commits into gitpython-developers:main from elovelan:test_hardening
Closed
Git test environment consistency #2152 elovelan wants to merge 2 commits into gitpython-developers:main from elovelan:test_hardening
Conversation
elovelan commented May 12, 2026 · edited Loading
Copy link Copy Markdown
Contributor
When implementing #2151 , I ran into a few issues running tests due to:
- By default, GitHub now forks only the default branch when forking a repo. One of the docs tests was relying on
origin/masterexisting, which is unlikely in a fork scenario, since the common pattern is to setoriginto the fork andupstreamto the primary repo. - I have a few "convenience" features in my configuration such as
mainas the default repo branch name andfetch.prune=true. These break some of the tests so it seemed like it might be a good idea to always use a consistent config file.
fix(tests): consistent config
d5d86e7
Since there are many ways to configure git, use a standard configuration file, so tests always run with consistent settings
fix(test_docs): deterministic remote test
38e0f99
The remote test relied on a full repo clone that included all branches, which isn't guaranteed, especially in CI environments and when using repo forks. Use the cloned repo instead, since it will still test the desired functionality but will always have the necessary upstream branch.
elovelan commented May 12, 2026
Copy link Copy Markdown
Contributor
Author
|
I'll spin up a Windows VM for testing! |
elovelan commented May 13, 2026
Copy link Copy Markdown
Contributor
Author
|
@Byron , this is actually a little bigger than I had anticipated since there's a bit of config manipulation in the Actions workflows. If you like this approach, I'm happy to bring those settings over but I wanted to check with you first! |
Byron commented May 13, 2026
Copy link Copy Markdown
Member
|
The test suite unfortunately has never been isolated, and this bites from time to time. |
elovelan commented May 18, 2026
Copy link Copy Markdown
Contributor
Author
|
Since I need to rethink this, I'm going to close this for now, so it's not noise in the PR list |