Skip to content

Commit

Permalink
fixed bug in RunPythonClient.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-ni committed Aug 30, 2023
1 parent df92ba0 commit b72141d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
20 changes: 13 additions & 7 deletions tests/New_ATS/RunPythonClient.bat
Original file line number Diff line number Diff line change
@@ -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
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
5 changes: 2 additions & 3 deletions tests/New_ATS/pylib/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b72141d

Please sign in to comment.