Skip to content

Commit

Permalink
[E2E][EMS] Enable E2E tests on EMS snapshot builds (elastic#5227)
Browse files Browse the repository at this point in the history
  • Loading branch information
barkbay authored and naemono committed Jan 13, 2022
1 parent 98586dc commit d9c7715
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
8 changes: 0 additions & 8 deletions test/e2e/test/maps/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,7 @@ func (b Builder) SkipTest() bool {
if test.Ctx().TestLicense == "" {
return true
}

ver := version.MustParse(b.EMS.Spec.Version)

// remove or adjust as snapshot builds of EMS become available
// https://github.com/elastic/cloud-on-k8s/issues/4479
if test.IsSnapshotVersion(ver) {
return true
}

return version.SupportedMapsVersions.WithinRange(ver) != nil
}

Expand Down
4 changes: 0 additions & 4 deletions test/e2e/test/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,3 @@ func isValidUpgrade(from string, to string) (bool, error) {
validMajorDigit := dstVer.Major == srcVer.Major || dstVer.Major == srcVer.Major+1
return validMajorDigit && !srcVer.GTE(dstVer), nil
}

func IsSnapshotVersion(v version.Version) bool {
return len(v.Pre) > 0
}
35 changes: 0 additions & 35 deletions test/e2e/test/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"testing"

"github.com/stretchr/testify/require"

"github.com/elastic/cloud-on-k8s/pkg/controller/common/version"
)

func TestIsValidUpgrade(t *testing.T) {
Expand Down Expand Up @@ -41,36 +39,3 @@ func TestIsValidUpgrade(t *testing.T) {
require.Equal(t, tt.isValid, isValid)
}
}

func Test_isSnapshot(t *testing.T) {
type args struct {
ver version.Version
}
tests := []struct {
name string
args args
want bool
}{
{
name: "stable",
args: args{
ver: version.MustParse("7.13.0"),
},
want: false,
},
{
name: "pre-release",
args: args{
ver: version.MustParse("7.13.0-SNAPSHOT"),
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := IsSnapshotVersion(tt.args.ver); got != tt.want {
t.Errorf("isSnapshot() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit d9c7715

Please sign in to comment.