File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
pkg/testcoverage/badgestorer Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments