Subject: bug#37679: closed (Re: bug#37679: Local git configuration interferes with testsuite)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 19 Apr 2020 11:29:04 +0000

Your bug report

#37679: Local git configuration interferes with testsuite

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
37679: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=37679
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#37679: Local git configuration interferes with testsuite
From: Ludovic Courtès <[email-masked]>
To: Gábor Boskovits <[email-masked]>
Cc: [email-masked]
Date: Sun, 19 Apr 2020 13:28:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Gábor,

Ludovic Courtès <[email-masked]> skribis:

> As discussed on IRC yesterday (?), we can arrange to move these
> variables directly in (guix tests git), which is the only place where
> ‘git’ is invoked.  That way, it can’t possibly interfere with other uses
> of HOME, etc.
>
> WDYT of something like the patch below?

I pushed it as 3c91f003416c9fb79af2dc8766a7f449aa03f839.

Ludo’.

Subject: Local git configuration interferes with testsuite
From: Gábor Boskovits <[email-masked]>
To: [email-masked]
Date: Wed, 9 Oct 2019 12:35:58 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

I noticed that the local git configuration interferes with the guix test
suite.

After discussion on IRC with nckx I came up with the attached patch.
Comments are welcome!

Best regards,
g_bor
-- 
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21
From abf20477ea139bfaf1f2e21f09c2420fe618c9ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <[email-masked]>
Date: Tue, 8 Oct 2019 22:41:20 +0200
Subject: [PATCH] tests: Isolate git from external configuration.

* Makefile.am(AM_TESTS_ENVIRONMENT): Add environment variables to
make git ignore the user and system configuration files.
* tests/fake-home/.gitconfig: New file. Provide minimal git
configuration for tests.
---
 Makefile.am                |  9 ++++++++-
 tests/fake-home/.gitconfig | 21 +++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 tests/fake-home/.gitconfig

diff --git a/Makefile.am b/Makefile.am
index 36767c2f47..e7bf819a6b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,6 +14,7 @@
 # Copyright © 2018 Oleg Pykhalov <[email-masked]>
 # Copyright © 2018 Alex Vong <[email-masked]>
 # Copyright © 2019 Efraim Flashner <[email-masked]>
+# Copyright © 2019 Gábor Boskovits <[email-masked]>
 #
 # This file is part of GNU Guix.
 #
@@ -472,7 +473,13 @@ SH_TESTS =					\
 
 TESTS = $(SCM_TESTS) $(SH_TESTS)
 
-AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
+AM_TESTS_ENVIRONMENT = 				\
+  abs_top_srcdir="$(abs_top_srcdir)" 		\
+  GUILE_AUTO_COMPILE=0				\
+  GIT_CONFIG_NOSYSTEM=1				\
+  GIT_ATTR_NOSYSTEM=1				\
+  HOME="$(abs_top_srcdir)/tests/fake-home"	\
+  XDG_CONFIG_HOME="$(abs_top_srcdir)/tests/fake-xgd-config-home"
 
 SCM_LOG_DRIVER =				\
   $(top_builddir)/test-env --quiet-stderr	\
diff --git a/tests/fake-home/.gitconfig b/tests/fake-home/.gitconfig
new file mode 100644
index 0000000000..079cbd0d30
--- /dev/null
+++ b/tests/fake-home/.gitconfig
@@ -0,0 +1,21 @@
+# GNU Guix --- Functional package management for GNU
+# Copyright © 2019 Gábor Boskovits <[email-masked]>
+#
+# This file is part of GNU Guix.
+#
+# GNU Guix is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# GNU Guix is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+[user]
+  email = [email-masked]
+  name = Usman
-- 
2.23.0