tcms.issuetracker.types module

This module implements Kiwi TCMS interface to external issue tracking systems. tcms.issuetracker.types.IssueTrackerType provides the interface while the rest of the classes in this module implement it! Refer to each implementor class for integration specifics!

class tcms.issuetracker.types.Bugzilla(tracker)[source]

Bases: tcms.issuetracker.types.IssueTrackerType

Support for Bugzilla. Requires:

Api_url:
  • the XML-RPC URL for your Bugzilla instance
Api_username:
  • a username registered in Bugzilla
Api_password:
  • the password for this username

You can also provide the BUGZILLA_AUTH_CACHE_DIR setting (in product.py) to control where authentication cookies for Bugzilla will be saved. If this is not provided a temporary directory will be used each time we try to login into Bugzilla!

add_testcase_to_issue(testcases, issue)[source]

When adding issues to TestCase Run results there is a ‘Check to add test cases to Issue tracker’ checkbox. If selected this method is called to link the bug report to the test case which was used to discover the bug.

Usually this is implemented by adding a new comment pointing back to the test case via the internal RPC object.

Testcases:
  • list of TestCase objects
Issue:
  • Bug object

Used in testruns.views.get() aka run/report.html to produce a single URL which will open all reported issues into a single page in the Issue tracker. For example Bugzilla supports listing multiple bugs into a table. GitHub on the other hand doesn’t support this functionality.

Ids:
  • list of issues reported against test case runs
Returns:

  • None if not suported or string representing the URL

report_issue_from_testcase(caserun)[source]

When marking Test Case results inside a Test Run there is a ‘Report’ link. When the `Report’ link is clicked this method is called to help the user report an issue in the IT.

This is implemented by constructing an URL string which will pre-fill bug details like steps to reproduce, product, version, etc from the test case. Then we open this URL into another browser window!

Caserun:
  • TestCaseRun object
Returns:

  • string - URL

class tcms.issuetracker.types.GitHub(tracker)[source]

Bases: tcms.issuetracker.types.IssueTrackerType

Support for GitHub. Requires:

Base_url:
  • URL to a GitHub repository for which we’re going to report issues
Api_password:
  • GitHub API token.

Note

You can leave the api_url and api_username fields blank because the integration code doesn’t use them!

Note

GitHub does not support displaying multiple issues in a table format like Bugzilla and JIRA do. This means that in Test Case Run Report view you will see GitHub issues listed one by one and there will not be a link to open all of them inside GitHub’s interface!

add_testcase_to_issue(testcases, issue)[source]

When adding issues to TestCase Run results there is a ‘Check to add test cases to Issue tracker’ checkbox. If selected this method is called to link the bug report to the test case which was used to discover the bug.

Usually this is implemented by adding a new comment pointing back to the test case via the internal RPC object.

Testcases:
  • list of TestCase objects
Issue:
  • Bug object
is_adding_testcase_to_issue_disabled()[source]

When is linking a TC to a Bug report disabled? Usually when all the required credentials are provided.

Returns:
  • boolean
report_issue_from_testcase(caserun)[source]

GitHub only supports title and body parameters

class tcms.issuetracker.types.Gitlab(tracker)[source]

Bases: tcms.issuetracker.types.IssueTrackerType

Support for Gitlab. Requires:

Base_url:
  • URL to a Gitlab repository for which we’re going to report issues
Api_password:
  • Gitlab API token.
add_testcase_to_issue(testcases, issue)[source]

When adding issues to TestCase Run results there is a ‘Check to add test cases to Issue tracker’ checkbox. If selected this method is called to link the bug report to the test case which was used to discover the bug.

Usually this is implemented by adding a new comment pointing back to the test case via the internal RPC object.

Testcases:
  • list of TestCase objects
Issue:
  • Bug object
is_adding_testcase_to_issue_disabled()[source]

When is linking a TC to a Bug report disabled? Usually when all the required credentials are provided.

Returns:
  • boolean
report_issue_from_testcase(caserun)[source]

When marking Test Case results inside a Test Run there is a ‘Report’ link. When the `Report’ link is clicked this method is called to help the user report an issue in the IT.

This is implemented by constructing an URL string which will pre-fill bug details like steps to reproduce, product, version, etc from the test case. Then we open this URL into another browser window!

Caserun:
  • TestCaseRun object
Returns:

  • string - URL

class tcms.issuetracker.types.IssueTrackerType(tracker)[source]

Bases: object

Represents actions which can be performed with issue trackers. This is a common interface for all issue trackers that Kiwi TCMS supports!

add_testcase_to_issue(testcases, issue)[source]

When adding issues to TestCase Run results there is a ‘Check to add test cases to Issue tracker’ checkbox. If selected this method is called to link the bug report to the test case which was used to discover the bug.

Usually this is implemented by adding a new comment pointing back to the test case via the internal RPC object.

Testcases:
  • list of TestCase objects
Issue:
  • Bug object

Used in testruns.views.get() aka run/report.html to produce a single URL which will open all reported issues into a single page in the Issue tracker. For example Bugzilla supports listing multiple bugs into a table. GitHub on the other hand doesn’t support this functionality.

Ids:
  • list of issues reported against test case runs
Returns:

  • None if not suported or string representing the URL

classmethod from_name(name)[source]

Return the class which matches name if it exists inside this module or raise an exception.

is_adding_testcase_to_issue_disabled()[source]

When is linking a TC to a Bug report disabled? Usually when all the required credentials are provided.

Returns:
  • boolean
report_issue_from_testcase(caserun)[source]

When marking Test Case results inside a Test Run there is a ‘Report’ link. When the `Report’ link is clicked this method is called to help the user report an issue in the IT.

This is implemented by constructing an URL string which will pre-fill bug details like steps to reproduce, product, version, etc from the test case. Then we open this URL into another browser window!

Caserun:
  • TestCaseRun object
Returns:

  • string - URL

class tcms.issuetracker.types.JIRA(tracker)[source]

Bases: tcms.issuetracker.types.IssueTrackerType

Support for JIRA. Requires:

Api_url:
  • the API URL for your JIRA instance
Api_username:
  • a username registered in JIRA
Api_password:
  • the password for this username

Additional control can be applied via the JIRA_OPTIONS configuration setting (in product.py). By default this setting is not provided and the code uses jira.JIRA.DEFAULT_OPTIONS from the jira Python module!

add_testcase_to_issue(testcases, issue)[source]

When adding issues to TestCase Run results there is a ‘Check to add test cases to Issue tracker’ checkbox. If selected this method is called to link the bug report to the test case which was used to discover the bug.

Usually this is implemented by adding a new comment pointing back to the test case via the internal RPC object.

Testcases:
  • list of TestCase objects
Issue:
  • Bug object

Used in testruns.views.get() aka run/report.html to produce a single URL which will open all reported issues into a single page in the Issue tracker. For example Bugzilla supports listing multiple bugs into a table. GitHub on the other hand doesn’t support this functionality.

Ids:
  • list of issues reported against test case runs
Returns:

  • None if not suported or string representing the URL

report_issue_from_testcase(caserun)[source]

For the HTML API description see: https://confluence.atlassian.com/display/JIRA050/Creating+Issues+via+direct+HTML+links