Skip to content

Commit

Permalink
Copy from test_executions in the docker container
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <[email protected]>
  • Loading branch information
Divyaasm committed Jul 3, 2024
1 parent cdfa1fe commit b463292
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/test_workflow/benchmark_test/benchmark_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b463292

Please sign in to comment.