From b72141d5a8303695d845acb36606e3a30a705d1d Mon Sep 17 00:00:00 2001 From: Yash Chauhan Date: Thu, 31 Aug 2023 05:02:58 +0530 Subject: [PATCH] fixed bug in RunPythonClient.bat --- tests/New_ATS/RunPythonClient.bat | 20 +++++++++++++------- tests/New_ATS/pylib/run_tests.py | 5 ++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/New_ATS/RunPythonClient.bat b/tests/New_ATS/RunPythonClient.bat index 02f53914..5db0a153 100644 --- a/tests/New_ATS/RunPythonClient.bat +++ b/tests/New_ATS/RunPythonClient.bat @@ -1,11 +1,17 @@ @echo off -set python_client_path=%1 -set test_name=%2 -set rpc_name=%3 +setlocal + +set "python_client_path=%~1" +set "test_name=%~2" +set "rpc_name=%~3" + pushd %~dp0 -set script_dir=%CD% +set "script_dir=%CD%" popd -if not exist "./logs" mkdir logs -if not exist "./logs/%test_name%" mkdir logs/%test_name% -call %script_dir%\venv\Scripts\python.exe -m pytest %python_client_path% --junitxml=%script_dir%/logs/%test_name%/%test_name%_%rpc_name%_test_results.xml -vv \ No newline at end of file +if not exist "%script_dir%\logs" mkdir "%script_dir%\logs" +if not exist "%script_dir%\logs\%test_name%" mkdir "%script_dir%\logs\%test_name%" + +call "%script_dir%\venv\Scripts\python.exe" -m pytest "%python_client_path%" --junitxml="%script_dir%\logs\%test_name%\%test_name%_%rpc_name%_test_results.xml" -vv + +endlocal \ No newline at end of file diff --git a/tests/New_ATS/pylib/run_tests.py b/tests/New_ATS/pylib/run_tests.py index 95c56143..461b50d5 100644 --- a/tests/New_ATS/pylib/run_tests.py +++ b/tests/New_ATS/pylib/run_tests.py @@ -20,8 +20,8 @@ def count_failed_testcases(test_summary): def run_command(command): output = subprocess.run(command, capture_output=True, text=True) if output.stderr: - # raise Exception(output.stderr) - print(output.stderr) + raise Exception(output.stderr) + # print(output.stderr) return output.stdout @@ -132,7 +132,6 @@ def run_test(test_config): rpc_name ]) print (f"Running python client for {rpc_name}") - print(run_client_command) output = run_command(run_client_command) print(output+'\n') FAILED += count_failed_testcases(output)