diff --git a/CHANGELOG.md b/CHANGELOG.md index f62a9669..871d5101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Deprecated ### Removed ### Fixed +- Fixed test client initialization to ensure tests run locally ([879](https://github.com/opensearch-project/opensearch-py/pull/879)) ### Security ## [2.8.0] diff --git a/test_opensearchpy/run_tests.py b/test_opensearchpy/run_tests.py index a9f01b7b..c3b9e52d 100755 --- a/test_opensearchpy/run_tests.py +++ b/test_opensearchpy/run_tests.py @@ -68,7 +68,13 @@ def fetch_opensearch_repo() -> None: # find out the sha of the running client try: - client = get_client() + password = environ.get("OPENSEARCH_INITIAL_ADMIN_PASSWORD") + if password is None: + password = environ.get("OPENSEARCH_PASSWORD", "admin") + client = get_client( + verify_certs=False, + http_auth=("admin", password), + ) sha = client.info()["version"]["build_hash"] except (SkipTest, KeyError): print("No running opensearch >1.X server...")