From: Lovett, Trevor Date: Tue, 16 Apr 2019 14:09:06 +0000 (-0500) Subject: [VVP] Reports show test file and case now X-Git-Tag: 5.0.0~46 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=vvp%2Fvalidation-scripts.git;a=commitdiff_plain;h=0018ec512d41f3609394414420bbb39deaa0d7e4 [VVP] Reports show test file and case now Change-Id: I017c1830b61b186f52ba2fe29db03dd41cb68b26 Issue-ID: VVP-192 Signed-off-by: Lovett, Trevor (tl2972) --- diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py index 88dc6b3..07a66f2 100644 --- a/ice_validator/tests/conftest.py +++ b/ice_validator/tests/conftest.py @@ -195,6 +195,13 @@ class TestResult: """ return self.item.function.__module__.split(".")[-1] + @property + def test_id(self): + """ + :return: ID of the test (test_module + test_case) + """ + return "{}::{}".format(self.test_module, self.test_case) + @property def raw_output(self): """ @@ -525,7 +532,7 @@ def generate_csv_report(output_dir, categories, template_path, failures): rows.append( [ "\n".join(failure.files), - failure.test_module, + failure.test_id, failure.requirement_text(reqs), failure.resolution_steps(resolutions), failure.error_message, @@ -589,7 +596,7 @@ def generate_excel_report(output_dir, categories, template_path, failures): # table content for row, failure in enumerate(failures, start=start_error_table_row + 2): worksheet.write(row, 0, "\n".join(failure.files), normal) - worksheet.write(row, 1, failure.test_module, normal) + worksheet.write(row, 1, failure.test_id, normal) worksheet.write(row, 2, failure.requirement_text(reqs), normal) worksheet.write(row, 3, failure.resolution_steps(resolutions), normal) worksheet.write(row, 4, failure.error_message, normal) @@ -808,7 +815,7 @@ def generate_html_report(outpath, categories, template_path, failures): fail_data.append( { "file_links": make_href(failure.files), - "test_id": failure.test_module, + "test_id": failure.test_id, "error_message": failure.error_message, "raw_output": failure.raw_output, "requirements": docutils.core.publish_parts(