tcms.issuetracker.base module

class tcms.issuetracker.base.IssueTrackerType(bug_system, request)[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_testexecution_to_issue(executions, issue_url)[source]

When linking defect URLs to Test Execution results there is a ‘Add comment to Issue tracker’ checkbox. If selected this method is called. It should ‘link’ the existing defect back to the TE/TR which reproduced it.

Usually this is implemented by adding a new comment pointing back to the TR/TE via the internal RPC object.

Executions:
  • iterable of TestExecution objects

Issue_url:
  • the URL of the existing defect

classmethod bug_id_from_url(url)[source]

Returns a unique identifier for reported defect. This is used by the underlying integration libraries. Usually that identifier is an integer number.

The default implementation is to leave the last group of numeric characters at the end of a string!

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.

static get_case_components(case)[source]

Returns a string that contains comma separated list of components bound to a given testcase

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

post_comment(execution, bug_id)[source]
Parameters:
post_process_new_issue(new_issue, execution, user)[source]

Perform any post-processing for newly created issues.

New_issue:

An object specific to the actual RPC implementation

Execution:

TestExecution object

User:

User object

Added in version 11.4.

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

property rpc

Returns an object which is used to communicate to the external system. This property is meant to be used by the rest of the integration code and provides caching b/c connecting to a remote system may be a slow operation.

rpc_cache = {}
property rpc_credentials

Returns an tuple of (api_username, api_token_or_password) meant for connecting to a 3rd party issue tracker system.

It can be overriden in order to provide more flexible integrations!

Added in version 12.6.

static text(execution)[source]

Returns the text that will be posted as a comment to the reported bug!

static truncate(in_str, max_length)[source]