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
Stream log messages to stdout
Default: False
- -l, --loglevel
Possible choices: DEBUG, INFO, WARNING, ERROR, CRITICAL
Filter log messages based on logging level
Default: “DEBUG”
- --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, tutorial-examples
Sub-commands¶
build (bd)¶
Build and Run test
buildtest build [-h] [-b BUILDSPEC] [-x EXCLUDE] [-e EXECUTOR]
[-xt EXCLUDE_TAGS] [-t TAGS] [--rerun] [-f FILTER]
[--helpfilter] [-et {local,batch}] [--module-purge]
[-m MODULES] [-u UNLOAD_MODULES] [--account ACCOUNT]
[--maxpendtime MAXPENDTIME] [--pollinterval POLLINTERVAL]
[--procs PROCS [PROCS ...]] [--nodes NODES [NODES ...]]
[--disable-executor-check] [--limit LIMIT] [--remove-stagedir]
[--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
- -xt, --exclude-tags
Exclude tests by one or more tagnames 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,val2;key2=val3;key3=val4,val5
- --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
- --limit
Limit number of tests that can be run.
- --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] [--pager] [--row-count] [-n] [-c COUNT] [-b]
[-e] [--group-by-tags] [--group-by-executor] [-p]
[-t] [--filter FILTER] [--format FORMAT]
[--helpfilter] [--helpformat] [--filterfields]
[--formatfields] [--terse] [-r] [--root ROOT] [-q]
...
Positional Arguments¶
Possible choices: invalid
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- --row-count
Display number of rows from query shown in table
Default: False
- -n, --no-header
Do not print header columns in terse output (–terse)
Default: False
- -c, --count
Retrieve limited number of rows that get printed
- -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
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
maintainers (m)¶
Query maintainers from buildspecs cache
buildtest buildspec maintainers [-h] [--row-count] [-t] [-n] [-b] {find} ...
Named Arguments¶
- --row-count
Display number of rows from query shown in table
Default: False
- -t, --terse
Print output in machine readable format
Default: False
- -n, --no-header
Do not print header columns in terse output (–terse)
Default: False
- -b, --breakdown
Breakdown of buildspecs by maintainers
Default: False
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 themese
summary (sm)¶
Print summary of buildspec cache
buildtest buildspec summary [-h] [--pager]
Named Arguments¶
- --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 compilers
buildtest config compilers find [-h] [--file FILE] [-d] [-u]
[-m MODULEPATH [MODULEPATH ...]]
- --file
Write configuration file to a new file
- -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
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
view (v)¶
View configuration file
buildtest config view [-h] [--pager] [-t Color Themes]
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- -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
report (rt)¶
Query test report
buildtest report [-h] [--pager] [--row-count] [-t] [-n] [-c COUNT]
[--filter FILTER] [--format FORMAT] [--helpfilter]
[--helpformat] [--filterfields] [--formatfields] [-f | -p]
[-s START] [-e END] [--latest] [--oldest]
...
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- --row-count
Display number of rows from query shown in table
Default: False
- -t, --terse
Print output in machine readable format
Default: False
- -n, --no-header
Do not print header columns in terse output (–terse)
Default: False
- -c, --count
Retrieve limited number of rows that get printed
- -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
subcommands¶
Fetch test results from report file and print them in table format
Possible choices: clear, c, list, l, path, p, summary, sm
filter¶
Filter and Format table
- --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
Sub-commands¶
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] [--pager] [-a] [buildspec [buildspec ...]]
Positional Arguments¶
- buildspec
List of buildspecs to query
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- -a, --all
Fetch all records for a given test
Default: False
name (n)¶
Specify name of test
buildtest inspect name [-h] [--pager] [name [name ...]]
Positional Arguments¶
- name
Name of test
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
query (q)¶
Query fields from record
buildtest inspect query [-h] [--pager] [-t Color Themes] [-b] [-be] [-e] [-o]
[--testpath]
[name [name ...]]
Positional Arguments¶
- name
Name of builder to query in report file
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- -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
- -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
- --testpath
Print content of testpath
Default: False
list (l)¶
List all test names, ids, and corresponding buildspecs
buildtest inspect list [-h] [--pager] [--row-count] [-t] [-n] [-b]
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- --row-count
Display number of rows from query shown in table
Default: False
- -t, --terse
Print output in machine readable format
Default: False
- -n, --no-header
Do not print header columns in terse output (–terse)
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] ...
Sub-commands¶
list¶
List a summary of all builds
buildtest history list [-h] [--pager] [--row-count] [-t] [-n]
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- --row-count
Display number of rows from query shown in table
Default: False
- -t, --terse
Print output in machine readable format
Default: False
- -n, --no-header
Do not print header columns in terse output (–terse)
Default: False
query¶
Query information for a particular build
buildtest history query [-h] [--pager] [-l] [-o] id
Positional Arguments¶
- id
Select a build ID
Named Arguments¶
- --pager
Enable PAGING when viewing result
Default: False
- -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)
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
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
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
tutorial-examples¶
Generate documentation examples for Buildtest Tutorial
buildtest tutorial-examples [-h]
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-2023, 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.