Buildtest Command Reference

buildtest is a HPC testing framework for building and running tests.

usage: buildtest [options] [COMMANDS]

Named Arguments

-V, --version

show program’s version number and exit

-c, --config

Specify Path to Configuration File

-d, --debug

Print debug messages to screen

Default: False

--editor

Possible choices: vi, vim, emacs, nano

Select your preferred editor when opening files.

--view-log

Show content of last log

Default: False

--logpath

Print full path to last log file

Default: False

--print-log

Print content of last log without pagination

Default: False

--color

Print output of table with the selected color.

--no-color

Disable colored output

Default: False

--helpcolor

Print available color options in a table format.

Default: False

-r, --report

Specify path to test report file

COMMANDS

Possible choices: build, bd, buildspec, bc, config, cg, report, rt, inspect, it, path, history, hy, schema, cdash, unittests, test, stylecheck, style, cd, clean, docs, schemadocs, debugreport, debug, stats, info, help, h

Sub-commands

build (bd)

Build and Run test

buildtest build [-h] [-b BUILDSPEC] [-x EXCLUDE] [-e EXECUTOR] [-t TAGS]
                [--rerun] [-f FILTER] [--helpfilter] [-et {local,batch}]
                [--module-purge] [-m MODULES] [-u UNLOAD_MODULES]
                [--account ACCOUNT] [--disable-executor-check]
                [--remove-stagedir] [--maxpendtime MAXPENDTIME]
                [--pollinterval POLLINTERVAL] [--procs PROCS [PROCS ...]]
                [--nodes NODES [NODES ...]] [--rebuild REBUILD]
                [--retry RETRY] [-s {parse,build}] [--testdir TESTDIR]
                [--timeout TIMEOUT]

select

Select buildspec file to run based on file, tag, executor

-b, --buildspec

Specify a buildspec (file or directory) to build. A buildspec must end in ‘.yml’ extension.

-x, --exclude

Exclude one or more buildspecs (file or directory) from processing. A buildspec must end in ‘.yml’ extension.

-e, --executor

Discover buildspecs by executor name found in buildspec cache

-t, --tags

Discover buildspecs by tags found in buildspec cache

--rerun

Rerun last successful buildtest build command.

Default: False

filter

Filter tests after selection

-f, --filter

Filter buildspec based on tags, type, or maintainers. Usage: –filter key1=val1,key2=val2

--helpfilter

Show available filter fields used with –filter option

Default: False

-et, --executor-type

Possible choices: local, batch

Filter tests by executor type (local, batch)

module

Module Selection option

--module-purge

Run ‘module purge’ before running any test

Default: False

-m, --modules

Specify a list of modules to load during test execution, to specify multiple modules each one must be comma separated for instance if you want to load ‘gcc’ and ‘python’ module you can do ‘-m gcc,python’

-u, --unload-modules

Specify a list of modules to unload during test execution

batch

Batch Submission Options

--account

Specify project account used to charge batch jobs (applicable for batch jobs only)

--maxpendtime

Specify Maximum Pending Time (sec) for job before cancelling job. This only applies for batch job submission.

--pollinterval

Specify Poll Interval (sec) for polling batch jobs

--procs

Specify number of processes to run tests (only applicable with batch jobs). Multiple values can be specified comma separated.

--nodes

Specify number of nodes to run tests (only applicable with batch jobs). Multiple values can be specified comma separated.

extra

All extra options

--disable-executor-check

Disable executor check during configuration check. By default these checks are enforced for Local, Slurm, PBS, LSF, and Cobalt Executor.

Default: True

--remove-stagedir

Remove stage directory after job completion.

Default: False

--rebuild

Rebuild test X number of times. Must be a positive number between [1-50]

--retry

Retry failed jobs

Default: 1

-s, --stage

Possible choices: parse, build

Control behavior of buildtest build to stop execution after ‘parse’ or ‘build’ stage

--testdir

Specify a custom test directory where to write tests. This overrides configuration file and default location.

--timeout

Specify test timeout in number of seconds

buildspec (bc)

Buildspec Interface

buildtest buildspec [-h]  ...

subcommands

Buildspec Interface subcommands

Possible choices: edit-file, ef, edit-test, et, find, f, maintainers, m, show, s, show-fail, sf, summary, sm, validate, val

Sub-commands

edit-file (ef)

Edit buildspec file based on filename

buildtest buildspec edit-file [-h] [file [file ...]]
Positional Arguments
file

Edit buildspec file in editor

edit-test (et)

Edit buildspec file based on test name

buildtest buildspec edit-test [-h] [name [name ...]]
Positional Arguments
name

Show content of buildspec based on test name

find (f)

Query information from buildspecs cache

buildtest buildspec find [-h] [-b] [-e] [--group-by-tags]
                         [--group-by-executor] [-p] [-t] [--filter FILTER]
                         [--format FORMAT] [--helpfilter] [--helpformat]
                         [--filterfields] [--formatfields] [-n] [--terse]
                         [--count COUNT] [--pager] [-r] [--root ROOT] [-q]
                         ...
Positional Arguments

Possible choices: invalid

Named Arguments
--count

Limit number of entries queried in output

--pager

Enable PAGING when viewing result

Default: False

-r, --rebuild

Rebuild buildspec cache and find all buildspecs again

Default: False

--root

Specify root buildspecs (directory) path to load buildspecs into buildspec cache.

-q, --quiet

Don’t print output of buildspec cache when rebuilding cache

Default: False

filter and format

filter and format options

--filter

Filter buildspec cache with filter fields in format –filter key1=val1,key2=val2

--format

Format buildspec cache with format fields in format –format field1,field2,…

--helpfilter

Show Filter fields for –filter option for filtering buildspec cache output

Default: False

--helpformat

Show Format fields for –format option for formatting buildspec cache output

Default: False

--filterfields

Print raw Filter fields for –filter option for filtering builspec cache output

Default: False

--formatfields

Print raw Format fields for –format option for formatting builspec cache output

Default: False

terse

terse options

-n, --no-header

Print output without header in terse output

Default: False

--terse

Print output in machine readable format

Default: False

query

query options to retrieve from buildspec cache

-b, --buildspec

Get all buildspec files from cache

Default: False

-e, --executors

get all unique executors from buildspecs

Default: False

--group-by-tags

Group tests by tag name

Default: False

--group-by-executor

Group tests by executor name

Default: False

-p, --paths

print all root buildspec paths

Default: False

-t, --tags

List all available tags

Default: False

Sub-commands
invalid

Show invalid buildspecs

buildtest buildspec find invalid [-h] [-e]
Named Arguments
-e, --error

Show error messages

Default: False

maintainers (m)

Query maintainers from buildspecs cache

buildtest buildspec maintainers [-h] [-l] [-b] [--terse] [-n] {find} ...
Named Arguments
-l, --list

List all maintainers

Default: False

-b, --breakdown

Breakdown of buildspecs by maintainers

Default: False

--terse

Print output in machine readable format

Default: False

-n, --no-header

Print output without header in terse output

Default: False

Sub-commands
find

Find buildspecs based on maintainer name

buildtest buildspec maintainers find [-h] name
Positional Arguments
name

Find buildspec based on maintainer name

show (s)

Show content of buildspec file

buildtest buildspec show [-h] [-t Color Themes] [name [name ...]]
Positional Arguments
name

Show content of buildspec based on test name

Named Arguments
-t, --theme

Possible choices: default, emacs, friendly, friendly_grayscale, colorful, autumn, murphy, manni, material, monokai, perldoc, pastie, borland, trac, native, fruity, bw, vim, vs, tango, rrt, xcode, igor, paraiso-light, paraiso-dark, lovelace, algol, algol_nu, arduino, rainbow_dash, abap, solarized-dark, solarized-light, sas, staroffice, stata, stata-light, stata-dark, inkpot, zenburn, gruvbox-dark, gruvbox-light, dracula, one-dark, lilypond, nord, nord-darker, github-dark

Specify a color theme, Pygments style to use when displaying output. See https://pygments.org/docs/styles/#getting-a-list-of-available-styles for available themese

show-fail (sf)

Show content of buildspec file for all failed tests

buildtest buildspec show-fail [-h] [-t Color Themes] [name [name ...]]
Positional Arguments
name

Show content of buildspec based on failed test name

Named Arguments
-t, --theme

Possible choices: default, emacs, friendly, friendly_grayscale, colorful, autumn, murphy, manni, material, monokai, perldoc, pastie, borland, trac, native, fruity, bw, vim, vs, tango, rrt, xcode, igor, paraiso-light, paraiso-dark, lovelace, algol, algol_nu, arduino, rainbow_dash, abap, solarized-dark, solarized-light, sas, staroffice, stata, stata-light, stata-dark, inkpot, zenburn, gruvbox-dark, gruvbox-light, dracula, one-dark, lilypond, nord, nord-darker, github-dark

Specify a color theme, Pygments style to use when displaying output. See https://pygments.org/docs/styles/#getting-a-list-of-available-styles for available themes

summary (sm)

Print summary of buildspec cache

buildtest buildspec summary [-h] [-p]
Named Arguments
-p, --pager

Enable PAGING when viewing result

Default: False

validate (val)

Validate buildspecs with JSON Schema

buildtest buildspec validate [-h] [-b BUILDSPEC] [-x EXCLUDE] [-e EXECUTOR]
                             [-t TAG]
Named Arguments
-b, --buildspec

Specify path to buildspec (file, or directory) to validate

-x, --exclude

Specify path to buildspec to exclude (file or directory) during validation

-e, --executor

Specify buildspecs by executor name to validate

-t, --tag

Specify buildspecs by tag name to validate

config (cg)

Query buildtest configuration

buildtest config [-h]  ...

subcommands

Query information from buildtest configuration file

Possible choices: compilers, co, edit, e, executors, ex, path, p, systems, validate, view, v

Sub-commands

compilers (co)

Search compilers

buildtest config compilers [-h] [-j] [-y]  ...
Named Arguments
-j, --json

List compiler details in JSON format

Default: False

-y, --yaml

List compiler details in YAML format

Default: False

subcommands

Find new compilers and add them to detected compiler section

Possible choices: find, test

Sub-commands
find

Find compilers

buildtest config compilers find [-h] [-d] [-u]
                                [-m MODULEPATH [MODULEPATH ...]]
Named Arguments
-d, --detailed

Display detailed output when finding compilers

Default: False

-u, --update

Update configuration file with new compilers

Default: False

-m, --modulepath

Specify a list of directories to search for modules via MODULEPATH to detect compilers

test

Test each compiler instance by performing module load test

buildtest config compilers test [-h] [compiler_names [compiler_names ...]]
Positional Arguments
compiler_names

Specify compiler name to test

edit (e)

Open configuration file in editor

buildtest config edit [-h]
executors (ex)

Query executors from buildtest configuration

buildtest config executors [-h] [-j | -y | -d | -i]
Named Arguments
-j, --json

View executor in JSON format

Default: False

-y, --yaml

View executors in YAML format

Default: False

-d, --disabled

Show disabled executors

Default: False

-i, --invalid

Show invalid executors

Default: False

path (p)

Show path to configuration file

buildtest config path [-h]
systems

List all available systems

buildtest config systems [-h]
validate

Validate buildtest settings file with schema.

buildtest config validate [-h]
view (v)

View configuration file

buildtest config view [-h] [-t Color Themes] [-p]
Named Arguments
-t, --theme

Possible choices: default, emacs, friendly, friendly_grayscale, colorful, autumn, murphy, manni, material, monokai, perldoc, pastie, borland, trac, native, fruity, bw, vim, vs, tango, rrt, xcode, igor, paraiso-light, paraiso-dark, lovelace, algol, algol_nu, arduino, rainbow_dash, abap, solarized-dark, solarized-light, sas, staroffice, stata, stata-light, stata-dark, inkpot, zenburn, gruvbox-dark, gruvbox-light, dracula, one-dark, lilypond, nord, nord-darker, github-dark

Specify a color theme, Pygments style to use when displaying output. See https://pygments.org/docs/styles/#getting-a-list-of-available-styles for available themes

-p, --pager

Enable PAGING when viewing result

Default: False

report (rt)

Query test report

buildtest report [-h] [--filter FILTER] [--format FORMAT] [--helpfilter]
                 [--helpformat] [--filterfields] [--formatfields] [-f | -p]
                 [-s START] [-e END] [--latest] [--oldest] [-c COUNT] [-n]
                 [-t] [--row-count] [--pager]
                 ...

Named Arguments

--filter

Filter report by filter fields. The filter fields must be a key=value pair and multiple fields can be comma separated in the following format: –filter key1=val1,key2=val2 . For list of filter fields run: –helpfilter.

--format

format field for printing purposes. For more details see –helpformat for list of available fields. Fields must be separated by comma (usage: –format <field1>,<field2>,…)

--helpfilter

List available filter fields to be used with –filter option

Default: False

--helpformat

List of available format fields

Default: False

--filterfields

Print raw filter fields for –filter option to filter the report

Default: False

--formatfields

Print raw format fields for –format option to format the report

Default: False

-f, --fail

Retrieve all FAIL tests

Default: False

-p, --pass

Retrieve all PASS tests

Default: False

-s, --start

Retrieve tests by starttime

-e, --end

Retrieve tests by endtime

--latest

Retrieve latest record of particular test

Default: False

--oldest

Retrieve oldest record of particular test

Default: False

-c, --count

Retrieve limited number of rows that get printed

-n, --no-header

Don’t print headers column used with terse option (–terse).

Default: False

-t, --terse

Print output in machine readable format

Default: False

--row-count

Print total count of records from the table.

Default: False

--pager

Enable PAGING when viewing result

Default: False

subcommands

Fetch test results from report file and print them in table format

Possible choices: clear, c, list, l, path, p, summary, sm

Sub-commands

clear (c)

Remove all report file

buildtest report clear [-h]
list (l)

List all report files

buildtest report list [-h]
path (p)

Print full path to the report file being used

buildtest report path [-h]
summary (sm)

Summarize test report

buildtest report summary [-h] [--detailed]
Named Arguments
--detailed, -d

Enable a more detailed report

Default: False

inspect (it)

Inspect a test based on NAME or ID

buildtest inspect [-h]  ...

subcommands

Inspect Test result based on Test ID or Test Name

Possible choices: buildspec, b, name, n, query, q, list, l

Sub-commands

buildspec (b)

Inspect a test based on buildspec

buildtest inspect buildspec [-h] [-a] [buildspec [buildspec ...]]
Positional Arguments
buildspec

List of buildspecs to query

Named Arguments
-a, --all

Fetch all records for a given test

Default: False

name (n)

Specify name of test

buildtest inspect name [-h] [name [name ...]]
Positional Arguments
name

Name of test

query (q)

Query fields from record

buildtest inspect query [-h] [-b] [-be] [-e] [-o] [-t] [name [name ...]]
Positional Arguments
name

Name of builder to query in report file

Named Arguments
-b, --buildscript

Print build script

Default: False

-be, --buildenv

Print content of build env

Default: False

-e, --error

Print error file

Default: False

-o, --output

Print output file

Default: False

-t, --testpath

Print content of testpath

Default: False

list (l)

List all test names, ids, and corresponding buildspecs

buildtest inspect list [-h] [-n] [-t] [-b]
Named Arguments
-n, --no-header

Print output without header in terse format (–terse)

Default: False

-t, --terse

Print output in terse format

Default: False

-b, --builder

List test in builder format

Default: False

path

Show path attributes for a given test

buildtest path [-h] [-be | -t | -o | -e | -b | -s] name

Positional Arguments

name

Name of test

Named Arguments

-be, --buildenv

Show path to build environment

Default: False

-t, --testpath

Show path to test script

Default: False

-o, --outfile

Show path to output file

Default: False

-e, --errfile

Show path to error file

Default: False

-b, --buildscript

Show path to build script

Default: False

-s, --stagedir

Show path to stage directory

Default: False

history (hy)

Query build history

buildtest history [-h]  ...

subcommands

Query build history file

Possible choices: list, query

Sub-commands

list

List a summary of all builds

buildtest history list [-h] [-n] [-t] [--pager]
Named Arguments
-n, --no-header

Do not print header columns in terse output (–terse)

Default: False

-t, --terse

Print output in machine readable format

Default: False

--pager

Enabling PAGING when viewing result

Default: False

query

Query information for a particular build

buildtest history query [-h] [-l] [-o] id
Positional Arguments
id

Select a build ID

Named Arguments
-l, --log

Display logfile for corresponding build id

Default: False

-o, --output

view raw output from buildtest build command

Default: False

schema

List schema contents and examples

buildtest schema [-h] [-e] [-j] [-n Schema Name]

Named Arguments

-e, --example

Show schema examples

Default: False

-j, --json

Display json schema file

Default: False

-n, --name

Possible choices: global.schema.json, definitions.schema.json, settings.schema.json, compiler.schema.json, spack.schema.json, script.schema.json

show schema by name (e.g., script)

cdash

Upload test to CDASH server

buildtest cdash [-h]  ...

subcommands

buildtest CDASH integeration

Possible choices: view, upload

Sub-commands

view

Open CDASH project in webbrowser

buildtest cdash view [-h]
upload

Upload Test to CDASH server

buildtest cdash upload [-h] [--site SITE] [-o] buildname
Positional Arguments
buildname

Specify Build Name reported in CDASH

Named Arguments
--site

Specify site name reported in CDASH

-o, --open

Open CDASH report in browser

Default: False

unittests (test)

Run buildtest unit tests

buildtest unittests [-h] [-c] [-p PYTESTOPTS] [-s SOURCEFILES]

Named Arguments

-c, --coverage

Enable coverage when running regression test

Default: False

-p, --pytestopts

Specify option to pytest

-s, --sourcefiles

Specify path to file or directory when running regression test

stylecheck (style)

Run buildtest style checks

buildtest stylecheck [-h] [--no-black] [--no-isort] [--no-pyflakes] [-a]

Named Arguments

--no-black

Don’t run black style check

Default: False

--no-isort

Don’t run isort style check

Default: False

--no-pyflakes

Dont’ run pyflakes check

Default: False

-a, --apply

Apply style checks to codebase.

Default: False

cd

change directory to root of test given a test name

buildtest cd [-h] test

Positional Arguments

test

Change directory to root of test for last run of test.

clean

Remove all generate files from buildtest including test directory, log files, report file, buildspec cache, history files.

buildtest clean [-h] [-y]

Named Arguments

-y, --yes

Confirm yes for all prompts

Default: False

docs

Open buildtest docs in browser

buildtest docs [-h]

schemadocs

Open buildtest schema docs in browser

buildtest schemadocs [-h]

debugreport (debug)

Display system information and additional information for debugging purposes.

buildtest debugreport [-h]

stats

Show test statistics for given test

buildtest stats [-h] name

Positional Arguments

name

Name of test

info

Show details regarding current buildtest setup

buildtest info [-h]

help (h)

buildtest command guide

buildtest help [-h]
               {bd,build,bc,buildspec,cdash,cg,config,hy,history,it,inspect,path,rt,report,schema,style,stylecheck,test,unittests}

Positional Arguments

command

Possible choices: bd, build, bc, buildspec, cdash, cg, config, hy, history, it, inspect, path, rt, report, schema, style, stylecheck, test, unittests

Show help message for command

References

GitHub: https://github.com/buildtesters/buildtest Documentation: https://buildtest.readthedocs.io/en/latest/index.html Schema Documentation: https://buildtesters.github.io/buildtest/ Slack: http://hpcbuildtest.slack.com/

Please report issues at https://github.com/buildtesters/buildtest/issues

Copyright (c) 2021-2022, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy), Shahzeb Siddiqui, and Vanessa Sochat. All rights reserved.