Skip to content

Commit

Permalink
fix squad analysis skipped_message issue (#3311)
Browse files Browse the repository at this point in the history
fixes: #3292

Signed-off-by: Daniel Horak <[email protected]>
  • Loading branch information
dahorak authored Nov 13, 2020
1 parent 652cdcd commit f847ae6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ocs_ci/utility/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f847ae6

Please sign in to comment.