CI: add a quick test, set enterprise2 when the enterprise2 flag is added (#59967)

* add a quick test, set enterprise2 when the enterprise2 flag is added

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
Kevin MinehartandDave Henderson authored and GitHub committed 2022-12-07 13:52:16 -05:00
1 parent ceb3d8d295
commit 69ffce4c42
2 files changed
+36 -6

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
package packaging_test
import (
"testing"
"github.com/grafana/grafana/pkg/build/config"
"github.com/grafana/grafana/pkg/build/packaging"
"github.com/stretchr/testify/assert"
)
func TestPackageRegexp(t *testing.T) {
t.Run("It should match enterprise2 packages", func(t *testing.T) {
rgx := packaging.PackageRegexp(config.EditionEnterprise2)
matches := []string{
"grafana-enterprise2-1.2.3-4567pre.linux-amd64.tar.gz",
"grafana-enterprise2-1.2.3-4567pre.linux-amd64.tar.gz.sha256",
}
for _, v := range matches {
assert.Truef(t, rgx.MatchString(v), "'%s' should match regex '%s'", v, rgx.String())
}
})
}