Commit cbea203
Add a test that required submodules are initialized
Adds `test_required_submodule_is_initialized` to
`test/test_fixture_health.py`. For each of the gitdb and smmap
submodule working trees -- present within the GitPython source tree
at `git/ext/gitdb` and `git/ext/gitdb/gitdb/ext/smmap` respectively
-- asserts that the working tree directory exists and contains a
`.git` marker (file or directory). Failure prints an actionable
message naming `init-tests-after-clone.sh` as the remedy.
This is a regression test for a different contract than the existing
`test_fixture_dir_is_trusted_by_git` in this module. That test
verifies git's willingness to operate in each fixture directory (the
`safe.directory` / dubious-ownership contract). The new test
verifies that the directories are populated at all (the
`init-tests-after-clone.sh` contract). A bug class along these
lines affected Arch Linux in gitpython-developers#1713 when `init-tests-after-clone.sh`
stopped running `git submodule update` on CI. When the source
tree's submodule directories are empty, this test fails with a
message naming `init-tests-after-clone.sh` as the remedy, instead
of leaving the issue to be diagnosed only after a cascade of test
failures elsewhere in the suite.
The test skips when the source tree is not a git clone (no `.git`
at `REPO_ROOT`). This is to accommodate setups that run pytest
from an extracted release tarball and prepare submodules in a
separately-pointed tree via `GIT_PYTHON_TEST_GIT_REPO_BASE` (e.g.
OpenIndiana's package build): in such setups, `git submodule update`
cannot operate on the source tree, and the submodule paths checked
here would never be populated there -- but the test suite still
works because `rorepo` points elsewhere.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 511212a commit cbea203
1 file changed
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
| |||
89 | 102 | | |
90 | 103 | | |
91 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments