diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-07-10 15:13:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 15:13:43 +0200 |
commit | 5ba1eb278560f54071b731394ecd00b4cc99d4f3 (patch) | |
tree | 12fe095660ec6b566a60011c728989ff412b0435 /scripts | |
parent | 057742d4af3c8e6f632663e8ca286b75c768492c (diff) | |
parent | d71f5d951eb7bb69cd894750347002bed8416998 (diff) |
Run integration tests with all supported git versions (#2754)
Run integration tests with various different git versions, more or less
randomly picked from our range of supported versions. Based on
@Ryooooooga's work in #2459, but also restructured a bit.
All tests pass for all git versions, but only after cherry-picking
#2747.
I decided to go with @Ryooooooga's approach and do it without using
docker. I also didn't use docker locally; to reproduce the various
failures that I had to fix, I simply installed the respective git
versions locally and used something like
`PATH=~/git-versions/2.25.1/bin:$PATH
./scripts/run_integration_tests.sh`.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/run_integration_tests.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh new file mode 100755 index 000000000..d09bd21e7 --- /dev/null +++ b/scripts/run_integration_tests.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# This is ugly, but older versions of git don't support the GIT_CONFIG_GLOBAL +# env var; the only way to run tests for these old versions is to copy our test +# config file to the actual global location. Move an existing file out of the +# way so that we can restore it at the end. +if test -f ~/.gitconfig; then + mv ~/.gitconfig ~/.gitconfig.lazygit.bak +fi + +cp test/global_git_config ~/.gitconfig + +go test pkg/integration/clients/*.go +EXITCODE=$? + +if test -f ~/.gitconfig.lazygit.bak; then + mv ~/.gitconfig.lazygit.bak ~/.gitconfig +fi + +exit $EXITCODE |