Skip to content

chore: prevent commit signing in tests #13222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_SYSTEM=/dev/null instead
Signed-off-by: Danny Kopping <danny@coder.com>
  • Loading branch information
dannykopping committed May 10, 2024
commit 02a2e8a829892a5839352ea0af6787010e8d8e4d
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ GO_SRC_FILES := $(shell find . $(FIND_EXCLUSIONS) -type f -name '*.go' -not -nam
# All the shell files in the repo, excluding ignored files.
SHELL_SRC_FILES := $(shell find . $(FIND_EXCLUSIONS) -type f -name '*.sh')

# Ensure we don't use the user's git configs which might cause side-effects
GIT_FLAGS = GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null

# All ${OS}_${ARCH} combos we build for. Windows binaries have the .exe suffix.
OS_ARCHES := \
linux_amd64 linux_arm64 linux_armv7 \
Expand Down Expand Up @@ -739,7 +742,7 @@ site/.eslintignore site/.prettierignore: .prettierignore Makefile
done < "$<"

test:
gotestsum --format standard-quiet -- -v -short -count=1 ./...
$(GIT_FLAGS) gotestsum --format standard-quiet -- -v -short -count=1 ./...
.PHONY: test

# sqlc-cloud-is-setup will fail if no SQLc auth token is set. Use this as a
Expand Down Expand Up @@ -775,7 +778,7 @@ sqlc-vet: test-postgres-docker
test-postgres: test-postgres-docker
# The postgres test is prone to failure, so we limit parallelism for
# more consistent execution.
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \
$(GIT_FLAGS) DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \
--junitfile="gotests.xml" \
--jsonfile="gotests.json" \
--packages="./..." -- \
Expand Down Expand Up @@ -824,7 +827,7 @@ test-postgres-docker:

# Make sure to keep this in sync with test-go-race from .github/workflows/ci.yaml.
test-race:
gotestsum --junitfile="gotests.xml" -- -race -count=1 ./...
$(GIT_FLAGS) gotestsum --junitfile="gotests.xml" -- -race -count=1 ./...
.PHONY: test-race

test-tailnet-integration:
Expand Down
14 changes: 7 additions & 7 deletions cli/dotfiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestDotfiles(t *testing.T) {
err = c.Run()
require.NoError(t, err)

c = exec.Command("git", "commit", "-m", `"add .bashrc"`, `--no-gpg-sign`)
c = exec.Command("git", "commit", "-m", `"add .bashrc"`)
c.Dir = testRepo
out, err := c.CombinedOutput()
require.NoError(t, err, string(out))
Expand All @@ -64,7 +64,7 @@ func TestDotfiles(t *testing.T) {
err = c.Run()
require.NoError(t, err)

c = exec.Command("git", "commit", "-m", `"add .bashrc"`, `--no-gpg-sign`)
c = exec.Command("git", "commit", "-m", `"add .bashrc"`)
c.Dir = testRepo
out, err := c.CombinedOutput()
require.NoError(t, err, string(out))
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestDotfiles(t *testing.T) {
err = c.Run()
require.NoError(t, err)

c = exec.Command("git", "commit", "-m", `"add .bashrc"`, `--no-gpg-sign`)
c = exec.Command("git", "commit", "-m", `"add .bashrc"`)
c.Dir = testRepo
out, err := c.CombinedOutput()
require.NoError(t, err, string(out))
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestDotfiles(t *testing.T) {
err = c.Run()
require.NoError(t, err)

c = exec.Command("git", "commit", "-m", `"add install.sh"`, `--no-gpg-sign`)
c = exec.Command("git", "commit", "-m", `"add install.sh"`)
c.Dir = testRepo
err = c.Run()
require.NoError(t, err)
Expand All @@ -151,7 +151,7 @@ func TestDotfiles(t *testing.T) {
testRepo := testGitRepo(t, root)

// We need an initial commit to start the `main` branch
c := exec.Command("git", "commit", "--allow-empty", "-m", `"initial commit"`, `--no-gpg-sign`)
c := exec.Command("git", "commit", "--allow-empty", "-m", `"initial commit"`)
c.Dir = testRepo
err := c.Run()
require.NoError(t, err)
Expand All @@ -170,7 +170,7 @@ func TestDotfiles(t *testing.T) {
err = c.Run()
require.NoError(t, err)

c = exec.Command("git", "commit", "-m", `"add install.sh"`, `--no-gpg-sign`)
c = exec.Command("git", "commit", "-m", `"add install.sh"`)
c.Dir = testRepo
err = c.Run()
require.NoError(t, err)
Expand Down Expand Up @@ -207,7 +207,7 @@ func TestDotfiles(t *testing.T) {
err = c.Run()
require.NoError(t, err)

c = exec.Command("git", "commit", "-m", `"add .bashrc"`, `--no-gpg-sign`)
c = exec.Command("git", "commit", "-m", `"add .bashrc"`)
c.Dir = testRepo
out, err := c.CombinedOutput()
require.NoError(t, err, string(out))
Expand Down
Loading