Copy the origin comment to the failed test result (for Won't Fix status only)
PRODX-36711
Change-Id: I4203937ca843cc7c16cbb441ef115d515fe8d016
diff --git a/testrail_bot/control/celery_tasks/testrail_pipeline.py b/testrail_bot/control/celery_tasks/testrail_pipeline.py
index 63f2ace..4d21342 100644
--- a/testrail_bot/control/celery_tasks/testrail_pipeline.py
+++ b/testrail_bot/control/celery_tasks/testrail_pipeline.py
@@ -208,10 +208,16 @@
f.flush()
return True
elif ratio > 0.9:
+ comment = f"Marked by TestRailBot because of similarity " \
+ f"with test {sim_result['test_id']} {per}%"
+ # Copy the original comment if it was not created by this bot
+ if str(sim_result["status_id"]) == StatusEnum.wont_fix \
+ and "Marked by TestRailBot" not in sim_result["comment"]:
+ comment = sim_result["comment"]
+
update_dict = {
"status_id": sim_result["status_id"],
- "comment": f"Marked by TestRailBot because of similarity "
- f"with test {sim_result['test_id']} {per}%",
+ "comment": comment,
"defects": sim_result["defects"]
}
f.write(f"Found similarity defect {prod_link} on the test "
@@ -255,7 +261,7 @@
break
else:
f.write("<b style='color:red;'> Automatic test processing failed. "
- "Please process test manualy "
+ "Please process test manually "
"<a href=https://mirantis.testrail.com/"
"index.php?/tests/view/{test_id}>{test_id}"
"</a></b>\n".format(test_id=test["id"]))