salmon-barista-63163
06/22/2021, 4:19 PMgit
. I am getting the following error:
fatal: not a git repository (or any of the parent directories): .git
I have found that this is because with pants 2 the root where the tests run is
/private/var/folders/89/r169_6497n15qnqm0bfhnjlr0000gp/T/process-executionzY6hQB
which does not include my “.git” config files.
With pants v1 all of these tests ran without issue and im assuming the root was the “build root”. I have tried adding a global resource
that includes the git
files necessary but that is not working. Is this as simple as changing the rootdir
of the global pants options? I would like to not have things running “inside” of my build root as it could cause other issues. Any other suggestions?enough-analyst-54434
06/22/2021, 5:58 PMhappy-kitchen-89482
06/22/2021, 6:00 PM.git
files checked in as resources should work, although there may be some futzing with the paths.enough-analyst-54434
06/22/2021, 6:04 PMenough-analyst-54434
06/22/2021, 6:05 PMenough-analyst-54434
06/22/2021, 6:13 PM$ git diff
diff --git a/pants.toml b/pants.toml
index 985d8734e..05febd0aa 100644
--- a/pants.toml
+++ b/pants.toml
@@ -163,6 +163,8 @@ extra_env_vars = [
"PATH",
# We'd always like complete backtraces in tests.
"RUST_BACKTRACE=1",
+ "GIT_DIR=%(buildroot)s/.git",
+ "GIT_WORK_TREE=%(buildroot)s",
]
[coverage-py]
hundreds-father-404
06/22/2021, 6:16 PMhundreds-father-404
06/22/2021, 6:18 PMenough-analyst-54434
06/22/2021, 6:29 PMhundreds-father-404
06/22/2021, 6:30 PMenough-analyst-54434
06/22/2021, 6:30 PMenough-analyst-54434
06/22/2021, 6:32 PMsalmon-barista-63163
06/22/2021, 8:23 PMsalmon-barista-63163
06/22/2021, 8:23 PMhappy-kitchen-89482
06/23/2021, 4:26 PM.git
but a test one that is checked into the repo under some resources direnough-analyst-54434
06/24/2021, 12:49 AMenough-analyst-54434
06/24/2021, 12:50 AMsalmon-barista-63163
06/24/2021, 9:16 PM