Running Local Tests Setup #892
-
I initially was using my own shell for running the tests against development and quickly figured out that isn't the most ideal due to my personal git config setup. Is there a common approach among the maintainers? Or do you all just choose your own preference? This was my quick and dirty example # from your local cloned go-git repo
docker pull golang
docker container run -v $(pwd):/go/src -it --priviledged golang bash # in container
apt install -y libcrypt-openssl* libzlcore-* libzltext-* zlib1g-dev libcurl4-open* libexpat1*
export GIT_VERSON=v2.11.0
make build-dist
export GIT_DIST_PATH=$(pwd)/.git-dist
export GIT_EXEC_PATH=$GIT_DIST_PATH
export PATH=$GIT_EXEC_PATH:$PATH
touch ~/known-hosts
export SSH_KNOWN_HOSTS=/root/known-hosts
git --exec-path
git config --global user.email "gha@example.com"
git config --global user.name "GitHub Actions"
make test which got me far enough, # ...
----------------------------------------------------------------------
FAIL: worktree_test.go:649: WorktreeSuite.TestCheckoutIndexOS
worktree_test.go:674:
c.Assert(idx.Entries[0].UID, Not(Equals), uint32(0))
... obtained uint32 = 0x0
... expected uint32 = 0x0
2023/10/26 01:04:13 comparing mod time: 2023-10-26 01:04:13.497602748 +0000 UTC == 2023-10-26 01:04:13.497602748 +0000 UTC on linux (amd64)
OOPS: 291 passed, 1 FAILED but i'm wondering if there can be a common consensus for running tests locally that maybe i or someone can add to the repo? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @patgmiller, thanks for opening up this discussion. I personally try to align my environment (to some extent) with what is used for the CI tests. So that I can just run What are your thoughts here? Maybe creating a Makefile target to run all the tests inside a container? |
Beta Was this translation helpful? Give feedback.
Hey @patgmiller, thanks for opening up this discussion.
I personally try to align my environment (to some extent) with what is used for the CI tests. So that I can just run
make test
.What are your thoughts here? Maybe creating a Makefile target to run all the tests inside a container?