fix: Tests timing out locally due to GPG #722
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I see that the test suite finishes in about a minute on the CI. When I run the test suite locally, it takes almost 2 minutes and then it just fails with a lot of tests timed out. The test output formatting is messed up too.
I've done some digging and I found out it's caused by GPG signing (specifically
[tag] gpgSign = true
option). Basically the test suite runs a lot ofgit
commands, which in turn read from my~/.gitconfig
file which has personal git configurations including GPG signing enabled. I'm thinking that unit tests should not be affected by the user's git config, so we should disable this.Seems like there isn't any option for git to disable reading of
~/.gitconfig
, however settingHOME=/tmp
works, and all the tests succeed without any timeout on my computer.note that I also tried
HOME=
, but that caused npm to create a~
directory inside the project root as well as inside alltest/fixtures/files/*
dirs, and it wrote a lot of stuff inside them, which in turn causedpacked-files.js
tests to fail.Full failed test output: