From f847ae6ed0d14343f911540b71eddb0681731ef0 Mon Sep 17 00:00:00 2001 From: dahorak Date: Fri, 13 Nov 2020 13:23:12 +0100 Subject: [PATCH] fix squad analysis skipped_message issue (#3311) fixes: https://github.com/red-hat-storage/ocs-ci/issues/3292 Signed-off-by: Daniel Horak --- ocs_ci/utility/utils.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ocs_ci/utility/utils.py b/ocs_ci/utility/utils.py index 8e41366b1ab..29adc3f527a 100644 --- a/ocs_ci/utility/utils.py +++ b/ocs_ci/utility/utils.py @@ -1004,7 +1004,10 @@ def add_squad_analysis_to_email(session, soup): if result.skipped: if squad not in skipped: skipped[squad] = [] - skipped_message = result.longrepr[2] + try: + skipped_message = result.longrepr[2][8:] + except TypeError: + skipped_message = "--unknown--" skipped[squad].append((result.nodeid, skipped_message)) unassigned = False if unassigned: @@ -1015,6 +1018,10 @@ def add_squad_analysis_to_email(session, soup): if result.skipped: if "UNASSIGNED" not in skipped: skipped["UNASSIGNED"] = [] + try: + skipped_message = result.longrepr[2][8:] + except TypeError: + skipped_message = "--unknown--" skipped["UNASSIGNED"].append((result.nodeid, skipped_message)) # no failed or skipped tests - exist the function @@ -1112,7 +1119,7 @@ def add_squad_analysis_to_email(session, soup): skips_li_tag.append(skips_test_span_tag) skips_li_tag.append(soup.new_tag("br")) skips_reason_em_tag = soup.new_tag("em") - skips_reason_em_tag.string = f"Reason: {test[1][8:]}" + skips_reason_em_tag.string = f"Reason: {test[1]}" skips_li_tag.append(skips_reason_em_tag) skips_ul_tag.append(skips_li_tag)