Skip to content

Commit a05a869

Browse files
authored
chore: call testhelper.RequireCommand one time for table-driven tests (#3493)
Any place that we were calling testhelper.RequireCommand multiple times in table-driven tests we should update it to instead only call 1x per test. Fixes #3480
1 parent 8372878 commit a05a869

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/librarian/release_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
func TestReleaseCommand(t *testing.T) {
3030
const testlib = "test-lib"
3131
const testlib2 = "test-lib2"
32+
testhelper.RequireCommand(t, "git")
3233

3334
for _, test := range []struct {
3435
name string
@@ -114,7 +115,6 @@ func TestReleaseCommand(t *testing.T) {
114115
},
115116
} {
116117
t.Run(test.name, func(t *testing.T) {
117-
testhelper.RequireCommand(t, "git")
118118
remoteDir := testhelper.SetupRepoWithChange(t, "v1.0.0")
119119
testhelper.CloneRepository(t, remoteDir)
120120

@@ -280,6 +280,7 @@ func TestRelease(t *testing.T) {
280280
}
281281

282282
func TestReleaseAll(t *testing.T) {
283+
testhelper.RequireCommand(t, "git")
283284

284285
for _, test := range []struct {
285286
name string
@@ -318,7 +319,6 @@ func TestReleaseAll(t *testing.T) {
318319
},
319320
} {
320321
t.Run(test.name, func(t *testing.T) {
321-
testhelper.RequireCommand(t, "git")
322322
tag := "v1.2.3"
323323
config := &config.Config{
324324
Language: languageFake,

0 commit comments

Comments
 (0)