buildtest.menu.build

This module contains all the methods related to “buildtest build” which is used for building test scripts from a Buildspec

Module Contents

Functions

discover_buildspecs(buildspec)

Given a buildspec file specified by the user with buildtest build --buildspec,

discover_buildspecs_by_tags(input_tag)

This method discovers buildspecs by tags, using --tags option

func_build_subcmd(args, config_opts)

Entry point for buildtest build sub-command. This method will discover

buildtest.menu.build.discover_buildspecs(buildspec)

Given a buildspec file specified by the user with buildtest build --buildspec, discover one or more files and return a list for buildtest to parse. Examples of intended functionality are documented here. For all of the below, test config root refers to $HOME/.buildtest/site

# A relative path to a file in the PWD (outside of test config root, returns single) buildtest build –buildspec relative-folder/hello.sh.yml

# A relative path to a file in build test root (returns single) buildtest build –buildspec github.com/buildtesters/tutorials/hello-world/hello.sh.yml

# relative directory path (returns multiple) buildtest build –buildspec hello-world

# relative directory path in build test root (returns multiple) buildtest build –buildspec github.com/buildtesters/tutorials/hello-world/

buildtest.menu.build.discover_buildspecs_by_tags(input_tag)

This method discovers buildspecs by tags, using --tags option from buildtest build command. This method will read BUILDSPEC_CACHE_FILE and search for tags key in buildspec recipe and match with input tag. Since tags field is a list, we check if input tag is in list and if so we add the entire buildspec into a list. The return is a list of buildspec files to process.

Parameters

input_tag (string) – Input tags from command line argument buildtest build --tags <tags>

Returns

a list of buildspec files that match tag name

Return type

list

buildtest.menu.build.func_build_subcmd(args, config_opts)

Entry point for buildtest build sub-command. This method will discover Buildspecs in method discover_buildspecs. If there is an exclusion list this will be checked, once buildtest knows all Buildspecs to process it will begin validation by calling BuildspecParser and followed by an executor instance by invoking BuildExecutor that is responsible for executing the test based on the executor type. A report of all builds, along with test summary will be displayed to screen.

Parameters:

Parameters

args (dict, required) – arguments passed from command line

Return type

None

buildtest.menu.build.logger