Skip to content

Commit a51dde5

Browse files
committed
fix test
1 parent 347c80f commit a51dde5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pkg/testcoverage/badgestorer/github_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/google/go-github/v56/github"
99
"github.com/stretchr/testify/assert"
10+
"golang.org/x/exp/rand"
1011

1112
. "github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/badgestorer"
1213
)
@@ -51,7 +52,7 @@ func Test_Github(t *testing.T) {
5152
Owner: "vladopajic",
5253
Repository: "go-test-coverage",
5354
Branch: "badges-integration-test",
54-
FileName: "badge.svg",
55+
FileName: "badge-" + randString() + ".svg",
5556
}
5657
s := NewGithub(cfg)
5758

@@ -105,3 +106,14 @@ func deleteFile(t *testing.T, cfg Git) {
105106
)
106107
assert.NoError(t, err)
107108
}
109+
110+
func randString() string {
111+
letterRunes := []rune("abcdefghijklmnopqrstuvwxyz")
112+
113+
b := make([]rune, rand.Intn(10))
114+
for i := range b {
115+
b[i] = letterRunes[rand.Intn(len(letterRunes))]
116+
}
117+
118+
return string(b)
119+
}

0 commit comments

Comments
 (0)