tcms.report.data module

class tcms.report.data.CustomDetailsReportData(form)[source]

Bases: tcms.report.data.CustomReportData

Data for custom details report

Inherits from CustomReportData is becuase details report also need the summary header data and the progress bar for being viewed test build. You may treat the latter one as a subset of custom report.

Besides above same data, details report also defines following methods to get specific data for detailed information to show to user.

static generate_status_matrix(build_ids)[source]
static get_case_runs(build_ids, status_ids)[source]

Get case runs according to builds and status

@param build_ids: IDs of builds @type build_ids: list or tuple @param status_ids: IDs of case run status @type status_ids: list or tuple @return: queried case runs @rtype: L{QuerySet}

static get_case_runs_bugs(build_ids, status_ids)[source]

Get case runs’ bugs according to builds and status

@param build_ids: IDs of builds @type build_ids: list or tuple @param status_ids: IDs of case run status @type status_ids: list or tuple @return: mapping between case run ID and its bugs @rtype: dict

static get_case_runs_comments(build_ids, status_ids)[source]

Get case runs’ bugs according to builds and status

@param build_ids: IDs of builds @type build_ids: list or tuple @param status_ids: IDs of case run status @type status_ids: list or tuple @return: mapping between case run ID and its comments @rtype: dict

report_criteria = {'build': ('build', <function model_to_pk at 0x7fdf98284b70>), 'build_run__plan__name__icontains': ('run__plan__name__icontains', <function do_nothing at 0x7fdf98284bf8>), 'category': ('case__category', <function model_to_pk at 0x7fdf98284b70>), 'component': ('case__component', <function model_to_pk at 0x7fdf98284b70>), 'product': ('build__product', <function model_to_pk at 0x7fdf98284b70>), 'version': ('run__plan__product_version', <function model_to_pk at 0x7fdf98284b70>)}
class tcms.report.data.CustomReportData(form)[source]

Bases: object

Data for custom report

In this data class, a major task is to construct INNER JOINS dynamically according to criteria selected by user.

INNER JOINS include must-exist joins for getting data, and other potential ones that should be added according to criteria user specifies.

One important thing is to ensure final INNER JOINS should be unique, so that no unnecessary table-join operation happens in database.

static automation_total(build_ids)[source]
Parameters:build_ids (list) – list of IDs of the builds, by which the TestCaseRuns are filtered
get_builds()[source]

Get builds statistics from valid search form.

@param form: the form containing valid data @type form: L{CustomSearchForm} @return: queried test builds @rtype: L{QuerySet}

report_criteria = {'build': ('build__in', <function models_to_pks at 0x7fdf98284ae8>), 'build_run__plan__name__icontains': ('run__plan__name__icontains', <function do_nothing at 0x7fdf98284bf8>), 'category': ('case__category', <function model_to_pk at 0x7fdf98284b70>), 'component': ('case__component', <function model_to_pk at 0x7fdf98284b70>), 'product': ('build__product', <function model_to_pk at 0x7fdf98284b70>), 'version': ('run__plan__product_version', <function model_to_pk at 0x7fdf98284b70>)}
static status_matrix(build_ids)[source]

Case run status matrix used to render progress bar

Parameters:build_ids (list) – list of IDs of the builds, by which the TestCaseRuns are filtered
class tcms.report.data.ProductBuildReportData[source]

Bases: object

Report data by builds of a Product

static caserun_status_subtotal(product_id, build_id)[source]
static caseruns_count(product_id, condition=None)[source]
failed_caseruns_count(product_id)[source]
finished_caseruns_count(product_id)[source]
finished_runs_count(product_id)[source]
static total_runs_count(product_id, finished=False)[source]
class tcms.report.data.ProductComponentReportData[source]

Bases: object

static case_runs_count(component_id)[source]
failed_case_runs_count(product_id)[source]
finished_case_runs_count(product_id)[source]
static total_cases(product_id, condition=None)[source]
Parameters:
  • product_id (number) – ID of the product
  • condition (dict) – additional conditions to be added to the query
class tcms.report.data.ProductVersionReportData[source]

Bases: object

Report data by versions of a Product

static case_runs_status_subtotal(product_id, version_id)[source]
static case_runs_subtotal(product_id, condition=None)[source]
Parameters:
  • product_id (number) – ID of the Product
  • condition (dict) – additional conditions to be added to the query
static cases_subtotal(product_id)[source]
Parameters:product_id (number) – ID of the Product
failed_case_runs_subtotal(product_id)[source]
finished_case_runs_subtotal(product_id)[source]
static plans_subtotal(product_id, condition=None)[source]
Parameters:
  • product_id (number) – ID of the Product
  • condition (dict) – additional conditions to be added to the query
static runs_subtotal(product_id, running=True)[source]
class tcms.report.data.TestingReportByCasePriorityData[source]

Bases: tcms.report.data.TestingReportBaseData

Data for testing report By Case Priority

runs_subtotal(form)[source]
status_matrix(form)[source]
class tcms.report.data.TestingReportByCaseRunTesterData[source]

Bases: tcms.report.data.TestingReportBaseData

Data for testing report of By Case Run Tester

runs_subtotal(form)[source]
runs_subtotal_groupby_builds(form)[source]
status_matrix(form)[source]
status_matrix_groupby_builds(form)[source]
class tcms.report.data.TestingReportByPlanBuildData[source]

Bases: tcms.report.data.TestingReportBaseData

Data of testing report By Plan Build

builds_subtotal(form)[source]
runs_subtotal(form)[source]
status_matrix(form)[source]
class tcms.report.data.TestingReportByPlanTagsData[source]

Bases: tcms.report.data.TestingReportBaseData

Data for testing report By Plan Tag

static get_tags_names(tag_ids)[source]

Get tags names from status matrix

passed_failed_case_runs_subtotal(form)[source]
plans_subtotal(form)[source]
runs_subtotal(form)[source]
class tcms.report.data.TestingReportByPlanTagsDetailData[source]

Bases: tcms.report.data.TestingReportByPlanTagsData

Detail data for testing report By Plan Tag

case_runs_total(form)[source]
status_matrix(form)[source]
static walk_status_matrix_rows(root_matrix)[source]

Walk status matrix row by row

class tcms.report.data.TestingReportCaseRunsData[source]

Bases: object

Data of case runs from testing report

Case runs will be search by following criteria,

  • criteria from testing report search form, r_product, r_build, r_created_since, r_created_before, and r_version.
  • run, the run in which the case is run
  • priority, case’ priority
  • tester, who is responsible for testing the case. For convenient, 0 means tester is None, and any other integers that is greater than 0 represents a valid user ID. If tester does not appear, it means no need to treat tester as a search criteria.
  • status, case run status
  • plan_tag
static case_runs_filter_criteria(form)[source]
get_case_runs(form)[source]
run_filter_criteria = {'build': ('run__build__in', <function models_to_pks at 0x7fdf98284ae8>), 'created_before': ('run__start_date__lte', <function do_nothing at 0x7fdf98284bf8>), 'created_since': ('run__start_date__gte', <function do_nothing at 0x7fdf98284bf8>), 'product': ('run__build__product', <function do_nothing at 0x7fdf98284bf8>), 'run': ('run__pk', <function do_nothing at 0x7fdf98284bf8>), 'version': ('run__product_version__in', <function models_to_pks at 0x7fdf98284ae8>)}
runs_filter_criteria(form)[source]