Skip to content

Commit

Permalink
For Issue Tracker integration use Product/Version from execution.build
Browse files Browse the repository at this point in the history
similar to previous commits use Product/Version values based on the
Build a specific TestExecution status was recorded against instead
of using values coming from TestRun->TestPlan which can change in the
future.

NOTE: execution.build is initialized with run.build and then may change
its value if we're recording results against multiple builds inside the
same TestRun.

(For example mark some executions as PASS, others as FAIL;
then update TR to a newer Build; retest and mark the FAIL results as
PASS)
  • Loading branch information
atodorov committed Dec 1, 2023
1 parent 6e32f48 commit 513da9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions tcms/issuetracker/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,17 @@ def _report_comment(self, execution, user=None): # pylint: disable=no-self-use
{reporter}
**Product:**
{execution.run.plan.product.name}
{execution.build.version.product.name}
**Component(s):**
{self.get_case_components(execution.case)}
**Version:**
{execution.build.version.value}
**Version-Release number** (if applicable):
**Build:**
{execution.build.name}
**Component(s):**
{self.get_case_components(execution.case)}
**Steps to reproduce**:
{txt}
Expand Down
4 changes: 2 additions & 2 deletions tcms/issuetracker/bugzilla_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def _report_issue(self, execution, user):
to a URL with some of the values pre-defined as query parameters!
"""
args = {
"product": execution.run.plan.product.name,
"product": execution.build.version.product.name,
"component": self.get_case_components(execution.case),
"version": execution.run.plan.product_version.value,
"version": execution.build.version.value,
"short_desc": f"Test case failure: {execution.case.summary}",
"comment": self._report_comment(execution, user),
}
Expand Down
4 changes: 2 additions & 2 deletions tcms/issuetracker/kiwitcms.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def _report_issue(self, execution, user):
data = {
"reporter": user,
"summary": f"Failed test: {execution.case.summary}",
"product": execution.run.plan.product,
"version": execution.run.plan.product_version,
"product": execution.build.version.product,
"version": execution.build.version,
"build": execution.build,
"text": self._report_comment(execution, user),
"_execution": execution,
Expand Down

0 comments on commit 513da9e

Please sign in to comment.