buildtest.cli.report

Module Contents

Classes

Report

Functions

is_int(val)

report_cmd(args)

Attributes

logger

class buildtest.cli.report.Report(filter_args, format_args, latest, oldest, report_file=BUILD_REPORT)
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)
_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_report_file(self)
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_display_table(self)
print_filter_fields(self)

Implements command buildtest report --helpfilter

print_format_fields(self)

Implements command buildtest report --helpformat

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