Skip to content

Commit

Permalink
workflows: Skip json compare for integ test against unreleased opense…
Browse files Browse the repository at this point in the history
…arch

Signed-off-by: Jakob Hahn <[email protected]>
  • Loading branch information
Jakob3xD committed Nov 10, 2023
1 parent 749180f commit 1e47771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-integration-unreleased.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
- name: Integration test
working-directory: go-client
run: make test-integ race=true
env:
OPENSEARCH_GO_SKIP_JSON_COMPARE: true

- name: Save server logs
if: failure()
Expand Down
4 changes: 4 additions & 0 deletions opensearchapi/internal/test/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"io"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"

Expand Down Expand Up @@ -81,6 +82,9 @@ func SkipIfBelowVersion(t *testing.T, client *opensearchapi.Client, majorVersion
// this is helpful to detect missing fields in the go structs
func CompareRawJSONwithParsedJSON(t *testing.T, resp any, rawResp *opensearch.Response) {
t.Helper()
if _, ok := os.LookupEnv("OPENSEARCH_GO_SKIP_JSON_COMPARE"); ok {
return
}
require.NotNil(t, rawResp)

parsedBody, err := json.Marshal(resp)
Expand Down

0 comments on commit 1e47771

Please sign in to comment.