diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-07-22 23:40:28 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-07-22 23:40:28 +0200 |
commit | 0f6c6171d514f6f7c3cb376bd40f20468a37bc41 (patch) | |
tree | 156bcf24ed335f966f717d213d4c61ef4d98dbb4 | |
parent | 17cce367746a8a750369be25cef50632ede91216 (diff) |
Add duration message after test execution
Change-Id: Ida68009ba02b2a5135dc4f3ae958fc77088389d7
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
-rwxr-xr-x | ci/run_tests.py | 6 | ||||
-rw-r--r-- | cli/cli_base.py | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ci/run_tests.py b/ci/run_tests.py index f252f81ae..0fb850130 100755 --- a/ci/run_tests.py +++ b/ci/run_tests.py @@ -9,6 +9,7 @@ # import argparse +import datetime import os import re import sys @@ -70,6 +71,7 @@ def cleanup(): def run_test(test): + start = datetime.datetime.now() test_name = test.get_name() logger.info("\n") # blank line print_separator("=") @@ -98,6 +100,10 @@ def run_test(test): if CLEAN_FLAG: cleanup() + end = datetime.datetime.now() + duration = (end - start).seconds + str = ("%02d:%02d" % divmod(duration, 60)) + logger.info("Test execution time: %s" % str) def run_tier(tier): diff --git a/cli/cli_base.py b/cli/cli_base.py index 45be1d001..827f8a4b6 100644 --- a/cli/cli_base.py +++ b/cli/cli_base.py @@ -117,7 +117,7 @@ def testcase_show(testname): @testcase.command('run', help="Executes a test case.") @click.argument('testname', type=click.STRING, required=True) -@click.option('-n', '--noclean', is_flag=True, default=False, +@click.option('-n', '--noclean', is_flag=True, default=False, help='The created openstack resources by the test' 'will not be cleaned after the execution.') def testcase_run(testname, noclean): @@ -143,7 +143,7 @@ def tier_gettests(tiername): @tier.command('run', help="Executes all the tests within a tier.") @click.argument('tiername', type=click.STRING, required=True) -@click.option('-n', '--noclean', is_flag=True, default=False, +@click.option('-n', '--noclean', is_flag=True, default=False, help='The created openstack resources by the tests' 'will not be cleaned after the execution.') def tier_run(tiername, noclean): |