buildtest.cli

buildtest cli: include functions to build, get test configurations, and interact with a global configuration for buildtest.

Submodules

Package Contents

Classes

BuildTestParser

This class implements the buildtest command line interface. This class

Functions

build_filters_format(val)

This method is used as validate argument type for buildtest build --filter.

handle_kv_string(val)

This method is used as type field in --filter argument in buildtest buildspec find.

positive_number(value)

Checks if input is positive number and returns value as an int type.

supported_color(input_color)

Checks if input is a supported color and returns value as an Color type.

valid_time(value)

Checks if input is valid time and returns value as a str type.

get_parser()

This method is used to simply return the parser for sphinx-argparse.

Attributes

BUILDTEST_COPYRIGHT

BUILDTEST_VERSION

console

schema_table

buildtest.cli.BUILDTEST_VERSION
buildtest.cli.console
buildtest.cli.schema_table
buildtest.cli.build_filters_format(val)[source]

This method is used as validate argument type for buildtest build --filter. This method returns a dict of key, value pairs where input is in the format key1=val1,val2;key2=val3. The semicolon is used to separate the keys and multiple values can be specified via comma

Parameters:

val (str) – Input string in key1=value1,val2;key2=value3 format that is processed into a dictionary type

Returns:

A dict mapping of key=value pairs

Return type:

dict

buildtest.cli.handle_kv_string(val)[source]

This method is used as type field in –filter argument in buildtest buildspec find. This method returns a dict of key,value pair where input is in format key1=val1,key2=val2,key3=val3

Parameters:

val (str) – Input string in key1=value1,key2=value2 format that is processed into a dictionary type

Returns:

A dict mapping of key=value pairs

Return type:

dict

buildtest.cli.positive_number(value)[source]

Checks if input is positive number and returns value as an int type.

Parameters:

value (str or int) – Specify an input number

Returns:

Return value as int type

Return type:

int

Raises:

argparse.ArgumentTypeError will be raised if input is not positive number or input is not str or int type

>>> positive_number("1")
1
>>> positive_number(2)
2
buildtest.cli.supported_color(input_color)[source]

Checks if input is a supported color and returns value as an Color type.

Parameters:

input_color (str) – Specify an input color

Returns:

Return value as rich.color.Color type

Return type:

str

Raises:

argparse.ArgumentTypeError will be raised if input is not a supported color input or is not str type

>>> supported_color("red")
red
buildtest.cli.valid_time(value)[source]

Checks if input is valid time and returns value as a str type.

Parameters:

value (str) – Specify an input date in yyyy-mm-dd format

Returns:

Return value as str type in correct format

Return type:

int

Raises:

argparse.ArgumentTypeError will be raised if input is not str or input is not in desired format

>>> valid_time("2022-01-01")
"2022-01-01"
>>> valid_time("2022-01-13")
"2022-01-13"
buildtest.cli.get_parser()[source]

This method is used to simply return the parser for sphinx-argparse.

class buildtest.cli.BuildTestParser[source]

This class implements the buildtest command line interface. This class implements the following methods:

  • get_parser(): This method builds the command line interface for buildtest

  • parse(): This method parses arguments passed to buildtest command line interface

_github = 'https://github.com/buildtesters/buildtest'
_docs = 'https://buildtest.readthedocs.io/en/latest/index.html'
_slack = 'http://hpcbuildtest.slack.com/'
_issues = 'https://github.com/buildtesters/buildtest/issues'
_progname = 'buildtest'
_description = 'buildtest is a HPC testing framework for building and running tests.'
epilog_str
_buildtest_show_commands = ['bd', 'build', 'bc', 'buildspec', 'cdash', 'cg', 'config', 'hy', 'history', 'it', 'inspect',...
parse()[source]

This method parses arguments passed to buildtest command line interface.

get_subparsers()[source]
retrieve_main_options()[source]

This method retrieves all options for buildtest command line interface. This is invoked by buildtest --listopts command and useful when user wants to see all options.

_build_subparsers()[source]

This method builds subparsers for buildtest command line interface.

_build_options()[source]

This method builds the main options for buildtest command line interface.

get_subcommands()[source]

Return a list of buildtest commands. This is useful for buildtest commands command to show a list of buildtest commands

get_parent_parser()[source]
misc_menu()[source]

Build the command line menu for some miscellaneous commands

stylecheck_menu()[source]

This method will create command options for buildtest stylecheck

tutorial_menu()[source]
unittest_menu()[source]

This method builds the command line menu for buildtest unittests command

path_menu()[source]

This method builds the command line menu for buildtest path command

history_menu()[source]

This method builds the command line menu for buildtest history command

build_menu()[source]

This method implements command line menu for buildtest build command.

buildspec_menu()[source]

This method implements buildtest buildspec command

buildspec_find_menu(buildspec_find_parser)[source]
config_menu()[source]

This method adds argparse argument for buildtest config

report_menu()[source]

This method implements the buildtest report command options

inspect_menu()[source]

This method builds argument for buildtest inspect command

schema_menu()[source]

This method builds menu for buildtest schema

cdash_menu()[source]

This method builds arguments for buildtest cdash command.