Skip to content

Commit

Permalink
Fix osb test
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed Dec 13, 2024
1 parent 39d3ed9 commit 37e9e33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ def execute_benchmark_workload(self, workload: str,
raise NotImplementedError(f"Auth type {self.auth_type} is not currently support for executing "
f"benchmark workloads")
# Note -- we should censor the password when logging this command
workload_revision="440ce4b1fc8832b6b7673bdcec948cce3ee87e7e"
workload_revision = "440ce4b1fc8832b6b7673bdcec948cce3ee87e7e"
logger.info(f"Running opensearch-benchmark with '{workload}' workload and revision '{workload_revision}'")
command = (f"opensearch-benchmark execute-test --distribution-version=1.0.0 --target-host={self.endpoint} "
f"--workload={workload} --workload-revision={workload_revision} --pipeline=benchmark-only --test-mode --kill-running-processes "
f"--workload={workload} --workload-revision={workload_revision} --pipeline=benchmark-only "
"--test-mode --kill-running-processes "
f"--workload-params={workload_params} --client-options={client_options}")
# While a little wordier, this apprach prevents us from censoring the password if it appears in other contexts,
# e.g. username:admin,password:admin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,10 @@ def test_run_benchmark_executes_correctly_no_auth(mocker):
mock = mocker.patch("subprocess.run", autospec=True)
workload = "nyctaxis"
cluster.execute_benchmark_workload(workload=workload)
mock.assert_called_once_with("opensearch-benchmark execute-test --distribution-version=1.0.0 "
f"--target-host={cluster.endpoint} --workload={workload} --pipeline=benchmark-only"
mock.assert_called_once_with("opensearch-benchmark execute-test --distribution-version=1.0.0"
f" --target-host={cluster.endpoint} --workload={workload}"
f" --workload-revision=440ce4b1fc8832b6b7673bdcec948cce3ee87e7e"
" --pipeline=benchmark-only"
" --test-mode --kill-running-processes --workload-params=target_throughput:0.5,"
"bulk_size:10,bulk_indexing_clients:1,search_clients:1 "
"--client-options=verify_certs:false", shell=True)
Expand All @@ -412,7 +414,9 @@ def test_run_benchmark_executes_correctly_basic_auth_and_https(mocker):
workload = "nyctaxis"
cluster.execute_benchmark_workload(workload=workload)
mock.assert_called_once_with("opensearch-benchmark execute-test --distribution-version=1.0.0 "
f"--target-host={cluster.endpoint} --workload={workload} --pipeline=benchmark-only"
f" --target-host={cluster.endpoint} --workload={workload}"
f" --workload-revision=440ce4b1fc8832b6b7673bdcec948cce3ee87e7e"
" --pipeline=benchmark-only"
" --test-mode --kill-running-processes --workload-params=target_throughput:0.5,"
"bulk_size:10,bulk_indexing_clients:1,search_clients:1 "
"--client-options=verify_certs:false,use_ssl:true,"
Expand Down

0 comments on commit 37e9e33

Please sign in to comment.