Commit c611935d authored by Alexander's avatar Alexander

test script installing pip requirements during execution

parent 8843dcb6
......@@ -17,8 +17,11 @@ for (dirname, dirs, files) in os.walk(ROOT):
and not(f"{TESTS_FOLDER_NAME}/" in str(dirname)) \
and not("venv" in str(dirname)):
try:
print(f"Executing tests in {dirname}")
os.chdir(os.path.normpath(dirname))
exit_val = os.system("python3.7 -m unittest discover")
# TODO do this during docker image setup
exit_val = os.system("python3.7 -m pip install -r ../requirements.txt") # install pip dependencies
exit_val = os.system("python3.7 -m unittest discover") # execute the tests
resultCodeList.append(exit_val) #once per folder i.e if 3 tests are in a folder and crash, there will be just one exit val
except Exception as e:
print(e)
......@@ -36,4 +39,4 @@ while i < len(resultCodeList):
if(firstError<0): #no errors found
sys.exit(0)
else:
sys.exit(resultCodeList[firstError]) #return the error code of the first error
\ No newline at end of file
sys.exit(1) #return code>0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment