Code Review
/
functest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Update Functest to OpenStack stable/pike"
[functest.git]
/
functest
/
ci
/
run_tests.py
diff --git
a/functest/ci/run_tests.py
b/functest/ci/run_tests.py
index
68d7473
..
d4acd9c
100644
(file)
--- a/
functest/ci/run_tests.py
+++ b/
functest/ci/run_tests.py
@@
-92,6
+92,8
@@
class Runner(object):
CONST.__setattr__('OS_TENANT_NAME', value)
elif key == 'OS_PASSWORD':
CONST.__setattr__('OS_PASSWORD', value)
CONST.__setattr__('OS_TENANT_NAME', value)
elif key == 'OS_PASSWORD':
CONST.__setattr__('OS_PASSWORD', value)
+ elif key == "OS_PROJECT_DOMAIN_NAME":
+ CONST.__setattr__('OS_PROJECT_DOMAIN_NAME', value)
@staticmethod
def get_run_dict(testname):
@staticmethod
def get_run_dict(testname):
@@
-122,16
+124,18
@@
class Runner(object):
self.executed_test_cases[test.get_name()] = test_case
if self.clean_flag:
if test_case.create_snapshot() != test_case.EX_OK:
self.executed_test_cases[test.get_name()] = test_case
if self.clean_flag:
if test_case.create_snapshot() != test_case.EX_OK:
- return
result
+ return
testcase.TestCase.EX_RUN_ERROR
try:
kwargs = run_dict['args']
try:
kwargs = run_dict['args']
-
result =
test_case.run(**kwargs)
+ test_case.run(**kwargs)
except KeyError:
except KeyError:
-
result =
test_case.run()
- if
result == testcase.TestCase.EX_OK
:
- if self.report_flag:
- test_case.push_to_db()
+ test_case.run()
+ if
self.report_flag
:
+ test_case.push_to_db()
+ if test.get_project() == "functest":
result = test_case.is_successful()
result = test_case.is_successful()
+ else:
+ result = testcase.TestCase.EX_OK
logger.info("Test result:\n\n%s\n", test_case)
if self.clean_flag:
test_case.clean()
logger.info("Test result:\n\n%s\n", test_case)
if self.clean_flag:
test_case.clean()
@@
-155,10
+159,12
@@
class Runner(object):
else:
logger.info("Running tier '%s'" % tier_name)
for test in tests:
else:
logger.info("Running tier '%s'" % tier_name)
for test in tests:
- result = self.run_test(test)
- if result != testcase.TestCase.EX_OK:
+ self.run_test(test)
+ test_case = self.executed_test_cases[test.get_name()]
+ if test_case.is_successful() != testcase.TestCase.EX_OK:
logger.error("The test case '%s' failed.", test.get_name())
logger.error("The test case '%s' failed.", test.get_name())
- self.overall_result = Result.EX_ERROR
+ if test.get_project() == "functest":
+ self.overall_result = Result.EX_ERROR
if test.is_blocking():
raise BlockingTestFailed(
"The test case {} failed and is blocking".format(
if test.is_blocking():
raise BlockingTestFailed(
"The test case {} failed and is blocking".format(
@@
-186,12
+192,12
@@
class Runner(object):
self.run_tier(tier)
def main(self, **kwargs):
self.run_tier(tier)
def main(self, **kwargs):
- if
kwargs['noclean']
:
- self.clean_flag =
False
- if
kwargs['report']
:
- self.report_flag =
True
+ if
'noclean' in kwargs
:
+ self.clean_flag =
not kwargs['noclean']
+ if
'report' in kwargs
:
+ self.report_flag =
kwargs['report']
try:
try:
- if
kwargs['test']
:
+ if
'test' in kwargs
:
self.source_rc_file()
logger.debug("Test args: %s", kwargs['test'])
if self._tiers.get_tier(kwargs['test']):
self.source_rc_file()
logger.debug("Test args: %s", kwargs['test'])
if self._tiers.get_tier(kwargs['test']):
@@
-262,6
+268,7
@@
class Runner(object):
def main():
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
def main():
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
+ logging.captureWarnings(True)
parser = RunTestsParser()
args = parser.parse_args(sys.argv[1:])
runner = Runner()
parser = RunTestsParser()
args = parser.parse_args(sys.argv[1:])
runner = Runner()