Skip to content

Commit f4454ee

Browse files
committed
Fix: skip if below test cases.
Signed-off-by: dblock <[email protected]>
1 parent ea08582 commit f4454ee

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

internal/test/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func SkipIfBelowVersion(t *testing.T, client *opensearchapi.Client, majorVersion
105105
t.Helper()
106106
major, patch, _, err := GetVersion(client)
107107
assert.Nil(t, err)
108-
if major <= majorVersion && patch <= patchVersion {
108+
if major < majorVersion || (major == majorVersion && patch < patchVersion) {
109109
t.Skipf("Skiping %s as version %d.%d.x does not support this endpoint", testName, major, patch)
110110
}
111111
}

opensearchapi/api_cat_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ func TestCatClient(t *testing.T) {
366366
for catType, value := range testCases {
367367
t.Run(catType, func(t *testing.T) {
368368
if catType == "ClusterManager" {
369-
ostest.SkipIfBelowVersion(t, client, 1, 3, catType)
369+
ostest.SkipIfBelowVersion(t, client, 2, 0, catType)
370370
}
371371
for _, testCase := range value {
372372
t.Run(testCase.Name, func(t *testing.T) {
@@ -399,7 +399,7 @@ func TestCatClient(t *testing.T) {
399399
ostest.CompareRawJSONwithParsedJSON(t, resp.Allocations, resp.Inspect().Response)
400400
})
401401
t.Run("ClusterManager", func(t *testing.T) {
402-
ostest.SkipIfBelowVersion(t, client, 1, 3, "ClusterManager")
402+
ostest.SkipIfBelowVersion(t, client, 2, 0, "ClusterManager")
403403
resp, err := client.Cat.ClusterManager(nil, nil)
404404
assert.Nil(t, err)
405405
assert.NotNil(t, resp)

opensearchapi/api_cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func TestClusterClient(t *testing.T) {
230230
for catType, value := range testCases {
231231
t.Run(catType, func(t *testing.T) {
232232
if strings.Contains(catType, "Decommission") {
233-
ostest.SkipIfBelowVersion(t, client, 2, 3, catType)
233+
ostest.SkipIfBelowVersion(t, client, 2, 4, catType)
234234
}
235235
for _, testCase := range value {
236236
t.Run(testCase.Name, func(t *testing.T) {

plugins/security/api_ssl_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestSSLClient(t *testing.T) {
3030
osAPIclient, err := ostest.NewClient()
3131
require.Nil(t, err)
3232

33-
ostest.SkipIfBelowVersion(t, osAPIclient, 1, 3, "SSLClient")
33+
ostest.SkipIfBelowVersion(t, osAPIclient, 2, 0, "SSLClient")
3434

3535
clientTLSCert, err := tls.LoadX509KeyPair("../../admin.pem", "../../admin.key")
3636
require.Nil(t, err)
@@ -114,7 +114,7 @@ func TestSSLClient(t *testing.T) {
114114
for _, testCase := range value.Tests {
115115
t.Run(testCase.Name, func(t *testing.T) {
116116
if strings.HasSuffix(value.Name, "Reload") && strings.Contains(testCase.Name, "request") {
117-
ostest.SkipIfBelowVersion(t, osAPIclient, 2, 7, value.Name)
117+
ostest.SkipIfBelowVersion(t, osAPIclient, 2, 8, value.Name)
118118
}
119119
res, err := testCase.Results()
120120
if testCase.Name == "inspect" {

0 commit comments

Comments
 (0)