opensearch-project / opensearch-go

Go Client for OpenSearch
https://opensearch.org/docs/latest/clients/go/
Apache License 2.0
197 stars 102 forks source link

Adjust tests to work with secure cluster #488

Closed Jakob3xD closed 6 months ago

Jakob3xD commented 6 months ago

Description

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 57.26%. Comparing base (5631d3c) to head (88e2761).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #488 +/- ## ======================================= Coverage 57.26% 57.26% ======================================= Files 315 315 Lines 9823 9823 ======================================= Hits 5625 5625 Misses 2904 2904 Partials 1294 1294 ``` | [Flag](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `50.80% <ø> (ø)` | | | [unit](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `12.84% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [opensearchapi/api\_cat-indices.go](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-b3BlbnNlYXJjaGFwaS9hcGlfY2F0LWluZGljZXMuZ28=) | `100.00% <ø> (ø)` | | | [opensearchapi/api\_cluster-stats.go](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-b3BlbnNlYXJjaGFwaS9hcGlfY2x1c3Rlci1zdGF0cy5nbw==) | `100.00% <ø> (ø)` | | | [opensearchapi/api\_indices-segments.go](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-b3BlbnNlYXJjaGFwaS9hcGlfaW5kaWNlcy1zZWdtZW50cy5nbw==) | `100.00% <ø> (ø)` | | | [opensearchapi/api\_nodes-info.go](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/488?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-b3BlbnNlYXJjaGFwaS9hcGlfbm9kZXMtaW5mby5nbw==) | `100.00% <ø> (ø)` | |
Jakob3xD commented 6 months ago

Should be easier to review this MR commit by commit.

Jakob3xD commented 6 months ago

I think having SECURE_INTEGRATION being referenced as an environment variable in more than one place isn't great.

It is now only referenced in the IsSecure() function. It makes more sense this way.