From b463292991b6aecec1d2f267634cf69203d1b627 Mon Sep 17 00:00:00 2001 From: Divya Madala Date: Tue, 2 Jul 2024 18:11:35 -0700 Subject: [PATCH] Copy from test_executions in the docker container Signed-off-by: Divya Madala --- src/test_workflow/benchmark_test/benchmark_test_suite.py | 4 ++-- .../benchmark_test/test_benchmark_test_suite.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test_workflow/benchmark_test/benchmark_test_suite.py b/src/test_workflow/benchmark_test/benchmark_test_suite.py index 73a1db2eeb..c8dd834d69 100644 --- a/src/test_workflow/benchmark_test/benchmark_test_suite.py +++ b/src/test_workflow/benchmark_test/benchmark_test_suite.py @@ -90,8 +90,8 @@ def execute(self) -> None: def convert(self) -> None: with TemporaryDirectory() as work_dir: - subprocess.check_call(f"docker cp docker-container-{self.args.stack_suffix}:opensearch-benchmark/. {str(work_dir.path)}", cwd=os.getcwd(), shell=True) - file_path = glob.glob(os.path.join(str(work_dir.path), "test_executions", "*", "test_execution.json")) + subprocess.check_call(f"docker cp docker-container-{self.args.stack_suffix}:opensearch-benchmark/test_executions/. {str(work_dir.path)}", cwd=os.getcwd(), shell=True) + file_path = glob.glob(os.path.join(str(work_dir.path), "*", "test_execution.json")) shutil.copy(file_path[0], os.path.join(os.getcwd(), f"test_execution_{self.args.stack_suffix}.json")) with open(file_path[0]) as file: data = json.load(file) diff --git a/tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_suite.py b/tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_suite.py index c2cb7e890c..6606b685a3 100644 --- a/tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_suite.py +++ b/tests/tests_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_suite.py @@ -243,7 +243,7 @@ def test_convert(self, mock_check_call: Mock, mock_copy: Mock, mock_get_terminal test_suite.convert() mock_temp_directory.assert_called_once() mock_copy.assert_called_once() - mock_check_call.assert_called_with(f"docker cp docker-container-{test_suite.args.stack_suffix}:opensearch-benchmark/. /mock/temp/dir", cwd=os.getcwd(), shell=True) + mock_check_call.assert_called_with(f"docker cp docker-container-{test_suite.args.stack_suffix}:opensearch-benchmark/test_executions/. /mock/temp/dir", cwd=os.getcwd(), shell=True) mock_open.assert_called_once_with("/mock/test_execution.json") mock_json_load.assert_called_once() mock_json_normalize.assert_called_once()