buildtest.cli.report

Module Contents

Classes

Report

Functions

is_int(val)

report_cmd(args)

Attributes

logger

class buildtest.cli.report.Report(report_file=None, filter_args=None, format_args=None, latest=None, oldest=None)
display_table
filter_fields = ['buildspec', 'name', 'executor', 'state', 'tags', 'returncode']
format_fields = ['buildspec', 'command', 'compiler', 'endtime', 'errfile', 'executor', 'full_id', 'hostname',...
_check_filter_fields(self)

This method will validate filter fields buildtest report --filter by checking if field is valid filter field. If one specifies an invalid filter field, we will raise an exception

_check_format_fields(self)

Check all format arguments (–format) are valid, the arguments are specified in format (–format key1=val1,key2=val2). We make sure each key is valid format field.

_filter_by_executor(self, test)
_filter_by_names(self, name)

Filter test by name of test. This method will return True if record should be processed, otherwise returns False

Parameters

name (str) – Name of test

_filter_by_returncode(self, test)
_filter_by_state(self, test)
_filter_by_tags(self, test)

This method will return a boolean (True/False) to check if test should be skipped from report. Given an input test, we check if test has ‘tags’ property in buildspec and if tagnames specified by --filter tags are found in the test. If there is a match we return False. A True indicates the test will be filtered out.

Parameters

test (dict) – test record

Returns

Return True if test is filtered out, otherwise return False

Return type

bool

filter_buildspecs_from_report(self)

This method filters the report table input filter --filter buildspec. If entry found in buildspec cache we add to list

get(self)

Return raw content of report file

get_ids(self)

Return a list of test ids from report file

get_names(self)

Return a list of test names from report file

load(self)

This method is responsible for loading report file. If file not found or report is empty dictionary we raise an error. The report file is loaded using json.loads and return value is a dictionary containing entire report of all tests.

print_filter_fields(self)

Implements command buildtest report --helpfilter

print_format_fields(self)

Implements command buildtest report --helpformat

print_report(self, terse=None)
process_report(self)
reportfile(self)

Return full path to report file

buildtest.cli.report.is_int(val)
buildtest.cli.report.logger
buildtest.cli.report.report_cmd(args)