CI: Make the downstream enterprise test a check instead of comments (#59071)

This commit is contained in:
Kevin Minehart
2022-11-24 08:17:12 -06:00
committed by GitHub
parent 76372a240c
commit 45c759eb59
14 changed files with 681 additions and 8 deletions
+25
View File
@@ -0,0 +1,25 @@
package git_test
import (
"testing"
"github.com/grafana/grafana/pkg/build/git"
"github.com/stretchr/testify/assert"
)
func TestPRCheckRegexp(t *testing.T) {
var (
shouldMatch = []string{"pr-check-1/branch-name", "pr-check-111/branch/name", "pr-check-102930122/branch-name"}
shouldNotMatch = []string{"pr-check-a/branch", "km/test", "test", "pr-check", "pr-check/test", "price"}
)
regex := git.PRCheckRegexp()
for _, v := range shouldMatch {
assert.Truef(t, regex.MatchString(v), "regex should match %s", v)
}
for _, v := range shouldNotMatch {
assert.False(t, regex.MatchString(v), "regex should not match %s", v)
}
}