Improve test result logging
Handle Enum correctly. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
parent
00c9634579
commit
9895c56984
@ -17,6 +17,7 @@ from configparser import ConfigParser
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from pytest import ExitCode
|
||||
|
||||
argparser = ArgumentParser()
|
||||
config = ConfigParser()
|
||||
@ -163,8 +164,10 @@ def runtests(payload, hosts):
|
||||
if not os.path.isfile(sshfile):
|
||||
vagrant_sshconfig(sshfile)
|
||||
testresult = pytest.main(['--verbose', '--hosts={}'.format(','.join(hosts)), '--ssh-config={}'.format(sshfile), payload])
|
||||
log.debug('Test result is {}'.format(str(testresult)))
|
||||
if not testresult:
|
||||
log.debug('Test result is {}'.format(str(testresult.value)))
|
||||
if testresult == ExitCode.OK:
|
||||
log.debug('Test succeeded')
|
||||
else:
|
||||
log.warning('Tests failed')
|
||||
return False
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user