tcms.issuetracker.types module

This module implements Kiwi TCMS interface to external issue tracking systems. Refer to each implementor class for integration specifics!

class tcms.issuetracker.types.GitHub(bug_system, request)[source]

Bases: tcms.issuetracker.base.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 - needs repo or public_repo

permissions.

Note

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

details(url)[source]

Use GitHub’s API instead of OpenGraph to return bug details b/c it will work for both public and private URLs.

is_adding_testcase_to_issue_disabled()[source]

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

Returns:True if bug system api url, username and password are provided
Return type:bool
it_class

alias of tcms.issuetracker.github_integration.GitHubThread

report_issue_from_testexecution(execution, user)[source]

GitHub only supports title and body parameters

class tcms.issuetracker.types.Gitlab(bug_system, request)[source]

Bases: tcms.issuetracker.base.IssueTrackerType

Support for Gitlab. Requires:

Base_url:URL to a GitLab repository for which we’re going to report issues
Api_url:URL to GitLab instance. Usually gitlab.com!
Api_password:GitLab API token.

Note

You can leave api_username field blank because the integration code doesn’t use it!

details(url)[source]

Use Gitlab API instead of OpenGraph to return bug details b/c it will work for both public and private URLs.

is_adding_testcase_to_issue_disabled()[source]

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

Returns:True if bug system api url, username and password are provided
Return type:bool
it_class

alias of tcms.issuetracker.gitlab_integration.GitlabThread

report_issue_from_testexecution(execution, user)[source]

When marking TestExecution 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!

Execution:TestExecution object
User:User object
Returns:
  • string - URL
class tcms.issuetracker.types.JIRA(bug_system, request)[source]

Bases: tcms.issuetracker.base.IssueTrackerType

Support for JIRA. Requires:

Base_url:
  • the URL of this 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!

classmethod bug_id_from_url(url)[source]

Jira IDs are the last group of chars at the end of the URL. For example https://issues.jenkins-ci.org/browse/JENKINS-31044

details(url)[source]

Returns bug details to be used later. By default this method returns OpenGraph metadata (dict) which is shown in the UI as tooltips. You can override this method to provide different information.

is_adding_testcase_to_issue_disabled()[source]

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

Returns:True if bug system api url, username and password are provided
Return type:bool
it_class

alias of tcms.issuetracker.jira_integration.JiraThread

report_issue_from_testexecution(execution, user)[source]

JIRA Project == Kiwi TCMS Product, otherwise defaults to the first found Issue Type == Bug or the first one found

If 1-click bug report doesn’t work then fall back to manual reporting!

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

class tcms.issuetracker.types.Redmine(bug_system, request)[source]

Bases: tcms.issuetracker.base.IssueTrackerType

Support for Redmine. Requires:

Base_url:
  • the URL for this Redmine instance
Api_username:
  • a username registered in Redmine
Api_password:
  • the password for this username
details(url)[source]

Returns bug details to be used later. By default this method returns OpenGraph metadata (dict) which is shown in the UI as tooltips. You can override this method to provide different information.

is_adding_testcase_to_issue_disabled()[source]

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

Returns:True if bug system api url, username and password are provided
Return type:bool
it_class

alias of tcms.issuetracker.redmine_integration.RedmineThread

redmine_priority_by_name(name)[source]
redmine_project_by_name(name)[source]

Return a Redmine project which matches the given product name. If there is no match then return the first project in Redmine!

static redmine_tracker_by_name(project, name)[source]

Return a Redmine tracker matching name (‘Bugs’). If there is no match then return the first one!

report_issue_from_testexecution(execution, user)[source]

When marking TestExecution 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!

Execution:TestExecution object
User:User object
Returns:
  • string - URL