changeset 8988:511b20a6475d stable

tests: skip reading Git system and global configuration in test_vcs_operations The parent changeset reduced the dependency on global configuration and made it possible to run tests without any global git configuration. But it is still unfortunate to even look at the global configuration when running tests. Global configuration is already disabled for Mercurial by setting HGRCPATH. Now do something similar for Git. According to the git man page, GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM set to /dev/null will make Git skip reading the configuration files on all platforms. Note that the GIT_CONFIG variables were introduced in Git 2.32.0, so this will not work with all the Git versions supported by Kallithea.
author Manuel Jacob <me@manueljacob.de>
date Thu, 30 Mar 2023 03:22:35 +0200
parents d6d3cb5991e2
children e27ff6a90076
files kallithea/tests/other/test_vcs_operations.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/other/test_vcs_operations.py	Thu Apr 20 00:30:29 2023 +0200
+++ b/kallithea/tests/other/test_vcs_operations.py	Thu Mar 30 03:22:35 2023 +0200
@@ -150,6 +150,8 @@
         testenv['LANGUAGE'] = 'en_US:en'
         testenv['HGPLAIN'] = ''
         testenv['HGRCPATH'] = ''
+        testenv['GIT_CONFIG_SYSTEM'] = '/dev/null'
+        testenv['GIT_CONFIG_GLOBAL'] = '/dev/null'
         testenv['GIT_COMMITTER_NAME'] = base.TEST_USER_ADMIN_LOGIN
         testenv['GIT_COMMITTER_EMAIL'] = base.TEST_USER_ADMIN_EMAIL
         testenv['GIT_AUTHOR_NAME'] = base.TEST_USER_REGULAR_LOGIN