From b16492cfcacf4ee2e165c09b818ce5a49e05eb7b Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Fri, 11 Aug 2017 05:28:21 +0000 Subject: Remove timestamp in the details for tempest Example: "success": ["2017-08-15 06:59:30.445 1180 INFO opnfv-tempest [-] {0} tempest.sce nario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops"] which is updated to: "success": ["tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_serv er_basic_ops"] Change-Id: Iad13e380b3a1fdc37b7742929512098bccc6d460 Signed-off-by: Linda Wang --- functest/opnfv_tests/openstack/refstack_client/refstack_client.py | 6 +++--- functest/opnfv_tests/openstack/tempest/tempest.py | 6 +++--- .../tests/unit/openstack/refstack_client/test_refstack_client.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'functest') diff --git a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py index 921d69b4d..86053ccf3 100644 --- a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py +++ b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py @@ -107,13 +107,13 @@ class RefstackClient(testcase.OSGCTestCase): num_failures = match[1] LOGGER.info("".join(match)) success_testcases = [] - for match in re.findall(r"\{0\}(.*?)[. ]*ok", output): + for match in re.findall(r"\{0\} (.*?)[. ]*ok", output): success_testcases.append(match) failed_testcases = [] - for match in re.findall(r"\{0\}(.*?)[. ]*FAILED", output): + for match in re.findall(r"\{0\} (.*?)[. ]*FAILED", output): failed_testcases.append(match) skipped_testcases = [] - for match in re.findall(r"\{0\}(.*?)[. ]*SKIPPED:", output): + for match in re.findall(r"\{0\} (.*?)[. ]*SKIPPED:", output): skipped_testcases.append(match) num_executed = int(num_tests) - int(num_skipped) diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index 4993c74a9..b00bc6af6 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -196,13 +196,13 @@ class TempestCommon(testcase.OSGCTestCase): output = logfile.read() success_testcases = [] - for match in re.findall('(.*?)[. ]*success ', output): + for match in re.findall('.*\{0\} (.*?)[. ]*success ', output): success_testcases.append(match) failed_testcases = [] - for match in re.findall('(.*?)[. ]*fail ', output): + for match in re.findall('.*\{0\} (.*?)[. ]*fail ', output): failed_testcases.append(match) skipped_testcases = [] - for match in re.findall('(.*?)[. ]*skip:', output): + for match in re.findall('.*\{0\} (.*?)[. ]*skip:', output): skipped_testcases.append(match) self.details = {"tests": int(num_tests), diff --git a/functest/tests/unit/openstack/refstack_client/test_refstack_client.py b/functest/tests/unit/openstack/refstack_client/test_refstack_client.py index e4e3364d6..c5601075e 100644 --- a/functest/tests/unit/openstack/refstack_client/test_refstack_client.py +++ b/functest/tests/unit/openstack/refstack_client/test_refstack_client.py @@ -79,9 +79,9 @@ class OSRefstackClientTesting(unittest.TestCase): ''') self.details = {"tests": 3, "failures": 1, - "success": [' tempest.api.compute [18.464988s]'], - "errors": [' tempest.api.volume [0.230334s]'], - "skipped": [' tempest.api.network [1.265828s]']} + "success": ['tempest.api.compute [18.464988s]'], + "errors": ['tempest.api.volume [0.230334s]'], + "skipped": ['tempest.api.network [1.265828s]']} with mock.patch('__builtin__.open', mock.mock_open(read_data=log_file)): self.refstackclient.parse_refstack_result() -- cgit 1.2.3-korg