« Back to Search  |  Reader Mode  |  Switch to Full Retro Site View Links: Stay in Reader  |  Retro Mode: ON  |  Original »
GitHub · Extracted in 1630 ms

Git test environment consistency by elovelan · Pull Request #2152 · gitpython-developers/GitPython

Source: https://github.com/gitpython-developers/GitPython/pull/2152

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:

  1. By default, GitHub now forks only the default branch when forking a repo. One of the docs tests was relying on origin/master existing, which is unlikely in a fork scenario, since the common pattern is to set origin to the fork and upstream to the primary repo.
  2. I have a few "convenience" features in my configuration such as main as the default repo branch name and fetch.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.
elovelan added 2 commits May 12, 2026 16:53 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.
Let's make the changes that are needed on CI to make it more resilient. We just have to watch out that these alterations don't affect local runs.

elovelan marked this pull request as draft May 14, 2026 16:00

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

elovelan closed this May 18, 2026 Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

2 participants