-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests when git config uses gpg signing.
- some of the tests run git so if you're using gpg signing you need to disable that. - refactor test helpers to use tb.Helper() and make the error output red. This is useful because if another helper uses one of these helpers, when it calls .Helper() its output will also be up the stack.
- Loading branch information
Showing
2 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,7 @@ func TestPendingPlanFinder_FindPlanCheckedIn(t *testing.T) { | |
runCmd(t, repoDir, "git", "add", ".") | ||
runCmd(t, repoDir, "git", "config", "--local", "user.email", "[email protected]") | ||
runCmd(t, repoDir, "git", "config", "--local", "user.name", "atlantisbot") | ||
runCmd(t, repoDir, "git", "commit", "-m", "initial commit") | ||
runCmd(t, repoDir, "git", "commit", "--no-gpg-sign", "-m", "initial commit") | ||
|
||
pf := &events.PendingPlanFinder{} | ||
actPlans, err := pf.Find(tmpDir) | ||
|
@@ -193,6 +193,7 @@ func TestPendingPlanFinder_FindPlanCheckedIn(t *testing.T) { | |
} | ||
|
||
func runCmd(t *testing.T, dir string, name string, args ...string) string { | ||
t.Helper() | ||
cpCmd := exec.Command(name, args...) | ||
cpCmd.Dir = dir | ||
cpOut, err := cpCmd.CombinedOutput() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters