Buildtest Command Line Tutorial

For this session, we assume you have installed buildtest on your system. You can check if buildtest command is available by running:

$ buildtest --help

If you receive an error please go back and re-install buildtest.

If you are new to buildtest you can review the quick start guide to learn the basics of buildtest.

Building Test

The buildtest build command is used for running a test on your system given a buildspec file (YAML). The most common way to build a test is specifying a file path via buildtest build -b <path>. To get started, let’s build our first test by running the following.

buildtest build -b $BUILDTEST_ROOT/tutorials/hello_world.yml
$ buildtest build -b $BUILDTEST_ROOT/tutorials/hello_world.yml
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-21511056-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/08/04 19:23:55                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.5                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.17                                                   │
│ Configuration File: /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Test Directory:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Report File:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/t… ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  1
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 1
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/tutorials/hello_world.yml: VALID
Total builder objects created: 1
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ hello_w… │ script │ generic… │ None     │ None  │ None  │ hello    │ /home/… │
│          │        │          │          │       │       │ world    │         │
│          │        │          │          │       │       │ example  │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
hello_world/7e56bb79: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/7e56bb79
hello_world/7e56bb79: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/7e56bb79/stage
hello_world/7e56bb79: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/7e56bb79/hello_world_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
hello_world/7e56bb79 does not have any dependencies adding test to queue
hello_world/7e56bb79: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/7e56bb79/stage
hello_world/7e56bb79: Running Test via command: bash --norc --noprofile -eo pipefail hello_world_build.sh
hello_world/7e56bb79: Test completed in 0.00551 seconds
hello_world/7e56bb79: Test completed with returncode: 0
hello_world/7e56bb79: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/7e56bb79/hello_world.out
hello_world/7e56bb79: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/7e56bb79/hello_world.err
In this iteration we are going to run the following tests: [hello_world/7e56bb79]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┓
┃               ┃              ┃        ┃ checks        ┃            ┃         ┃
┃               ┃              ┃        ┃ (ReturnCode,  ┃            ┃         ┃
┃               ┃              ┃        ┃ Regex,        ┃            ┃         ┃
┃ builder       ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━┩
│ hello_world/7 │ generic.loc… │ PASS   │ None None     │ 0          │ 0.00551 │
│ e56bb79       │              │        │ None          │            │         │
└───────────────┴──────────────┴────────┴───────────────┴────────────┴─────────┘



Passed Tests: 1/1 Percentage: 100.000%
Failed Tests: 0/1 Percentage: 0.000%


Adding 1 test results to /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/report.json
Writing Logfile to: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/logs/buildtest_phli0drg.log

The -b option can be specified multiple times and it can be used with directory path. buildtest will recursively search for all .yml extensions and attempt to build all tests.

Let’s try running the following command, where we will build by file and directory.

buildtest build -b $BUILDTEST_ROOT/tutorials/hello_world.yml -b $BUILDTEST_ROOT/general_tests/configuration
$ buildtest build -b $BUILDTEST_ROOT/tutorials/hello_world.yml -b $BUILDTEST_ROOT/general_tests/configuration
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-21511056-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/08/04 19:23:56                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.5                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.17                                                   │
│ Configuration File: /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Test Directory:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Report File:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/g… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/g… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/t… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/g… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/g… ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  5
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  5
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 5
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/general_tests/configuration/ulimits.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/general_tests/configuration/systemd-default-target.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/tutorials/hello_world.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/general_tests/configuration/disk_usage.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/general_tests/configuration/kernel_state.yml: VALID
Total builder objects created: 10
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ file     │         │
│          │        │          │          │       │       │ lock is  │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ unlimit… │         │
│          │        │          │          │       │       │ in       │         │
│          │        │          │          │       │       │ ulimits  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ cputime  │         │
│          │        │          │          │       │       │ is set   │         │
│          │        │          │          │       │       │ to       │         │
│          │        │          │          │       │       │ unlimit… │         │
│          │        │          │          │       │       │ in       │         │
│          │        │          │          │       │       │ ulimits  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ stack    │         │
│          │        │          │          │       │       │ size is  │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ unlimit… │         │
│          │        │          │          │       │       │ in       │         │
│          │        │          │          │       │       │ ulimits  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check    │ /home/… │
│          │        │          │          │       │       │ virtual  │         │
│          │        │          │          │       │       │ memory   │         │
│          │        │          │          │       │       │ size and │         │
│          │        │          │          │       │       │ check if │         │
│          │        │          │          │       │       │ its set  │         │
│          │        │          │          │       │       │ to       │         │
│          │        │          │          │       │       │ unlimit… │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ open     │         │
│          │        │          │          │       │       │ file     │         │
│          │        │          │          │       │       │ descrip… │         │
│          │        │          │          │       │       │ limit is │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ 4096     │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check    │ /home/… │
│          │        │          │          │       │       │ max      │         │
│          │        │          │          │       │       │ number   │         │
│          │        │          │          │       │       │ of user  │         │
│          │        │          │          │       │       │ process  │         │
│          │        │          │          │       │       │ limit is │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ 2048     │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ systemd… │ script │ generic… │ None     │ None  │ None  │ check if │ /home/… │
│          │        │          │          │       │       │ default  │         │
│          │        │          │          │       │       │ target   │         │
│          │        │          │          │       │       │ is       │         │
│          │        │          │          │       │       │ multi-u… │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ hello_w… │ script │ generic… │ None     │ None  │ None  │ hello    │ /home/… │
│          │        │          │          │       │       │ world    │         │
│          │        │          │          │       │       │ example  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ root_di… │ script │ generic… │ None     │ None  │ None  │ Check    │ /home/… │
│          │        │          │          │       │       │ root     │         │
│          │        │          │          │       │       │ disk     │         │
│          │        │          │          │       │       │ usage    │         │
│          │        │          │          │       │       │ and      │         │
│          │        │          │          │       │       │ report   │         │
│          │        │          │          │       │       │ if it    │         │
│          │        │          │          │       │       │ exceeds  │         │
│          │        │          │          │       │       │ thresho… │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ kernel_… │ script │ generic… │ None     │ None  │ None  │ Retrieve │ /home/… │
│          │        │          │          │       │       │ Kernel   │         │
│          │        │          │          │       │       │ Swap     │         │
│          │        │          │          │       │       │ Usage    │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
ulimit_filelock_unlimited/1f24f504: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1f24f504
ulimit_filelock_unlimited/1f24f504: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1f24f504/stage
ulimit_filelock_unlimited/1f24f504: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1f24f504/ulimit_filelock_unlimited_build.sh
ulimit_cputime_unlimited/b791c5f8: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/b791c5f8
ulimit_cputime_unlimited/b791c5f8: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/b791c5f8/stage
ulimit_cputime_unlimited/b791c5f8: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/b791c5f8/ulimit_cputime_unlimited_build.sh
ulimit_stacksize_unlimited/5e704cc6: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/5e704cc6
ulimit_stacksize_unlimited/5e704cc6: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/5e704cc6/stage
ulimit_stacksize_unlimited/5e704cc6: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/5e704cc6/ulimit_stacksize_unlimited_build.sh
ulimit_vmsize_unlimited/ad12f922: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/ad12f922
ulimit_vmsize_unlimited/ad12f922: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/ad12f922/stage
ulimit_vmsize_unlimited/ad12f922: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/ad12f922/ulimit_vmsize_unlimited_build.sh
ulimit_filedescriptor_4096/5bc08f90: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/5bc08f90
ulimit_filedescriptor_4096/5bc08f90: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/5bc08f90/stage
ulimit_filedescriptor_4096/5bc08f90: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/5bc08f90/ulimit_filedescriptor_4096_build.sh
ulimit_max_user_process_2048/f5437dca: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/f5437dca
ulimit_max_user_process_2048/f5437dca: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/f5437dca/stage
ulimit_max_user_process_2048/f5437dca: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/f5437dca/ulimit_max_user_process_2048_build.sh
systemd_default_target/d3b0cf36: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/d3b0cf36
systemd_default_target/d3b0cf36: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/d3b0cf36/stage
systemd_default_target/d3b0cf36: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/d3b0cf36/systemd_default_target_build.sh
hello_world/fef2396e: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e
hello_world/fef2396e: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/stage
hello_world/fef2396e: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/hello_world_build.sh
root_disk_usage/560f4448: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/disk_usage/root_disk_usage/560f4448
root_disk_usage/560f4448: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/disk_usage/root_disk_usage/560f4448/stage
root_disk_usage/560f4448: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/disk_usage/root_disk_usage/560f4448/root_disk_usage_build.sh
kernel_swapusage/36712e82: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/kernel_state/kernel_swapusage/36712e82
kernel_swapusage/36712e82: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/kernel_state/kernel_swapusage/36712e82/stage
kernel_swapusage/36712e82: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/kernel_state/kernel_swapusage/36712e82/kernel_swapusage_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
ulimit_filedescriptor_4096/5bc08f90 does not have any dependencies adding test to queue
ulimit_stacksize_unlimited/5e704cc6 does not have any dependencies adding test to queue
ulimit_cputime_unlimited/b791c5f8 does not have any dependencies adding test to queue
hello_world/fef2396e does not have any dependencies adding test to queue
kernel_swapusage/36712e82 does not have any dependencies adding test to queue
systemd_default_target/d3b0cf36 does not have any dependencies adding test to queue
root_disk_usage/560f4448 does not have any dependencies adding test to queue
ulimit_max_user_process_2048/f5437dca does not have any dependencies adding test to queue
ulimit_filelock_unlimited/1f24f504 does not have any dependencies adding test to queue
ulimit_vmsize_unlimited/ad12f922 does not have any dependencies adding test to queue
ulimit_filedescriptor_4096/5bc08f90: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/5bc08f90/stage
ulimit_filedescriptor_4096/5bc08f90: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_filedescriptor_4096_build.sh
ulimit_filedescriptor_4096/5bc08f90: Test completed in 0.005939 seconds
ulimit_filedescriptor_4096/5bc08f90: Test completed with returncode: 0
ulimit_filedescriptor_4096/5bc08f90: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/5bc08f90/ulimit_filedescriptor_4096.out
ulimit_filedescriptor_4096/5bc08f90: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/5bc08f90/ulimit_filedescriptor_4096.err
ulimit_filedescriptor_4096/5bc08f90: performing regular expression - '^4096$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/5bc08f90/ulimit_filedescriptor_4096.out
ulimit_filedescriptor_4096/5bc08f90: Regular Expression Match - Failed!
ulimit_stacksize_unlimited/5e704cc6: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/5e704cc6/stage
ulimit_stacksize_unlimited/5e704cc6: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_stacksize_unlimited_build.sh
ulimit_stacksize_unlimited/5e704cc6: Test completed in 0.005385 seconds
ulimit_stacksize_unlimited/5e704cc6: Test completed with returncode: 0
ulimit_stacksize_unlimited/5e704cc6: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/5e704cc6/ulimit_stacksize_unlimited.out
ulimit_stacksize_unlimited/5e704cc6: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/5e704cc6/ulimit_stacksize_unlimited.err
ulimit_stacksize_unlimited/5e704cc6: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/5e704cc6/ulimit_stacksize_unlimited.out
ulimit_stacksize_unlimited/5e704cc6: Regular Expression Match - Failed!
hello_world/fef2396e: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/stage
hello_world/fef2396e: Running Test via command: bash --norc --noprofile -eo pipefail hello_world_build.sh
hello_world/fef2396e: Test completed in 0.005253 seconds
hello_world/fef2396e: Test completed with returncode: 0
hello_world/fef2396e: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/hello_world.out
hello_world/fef2396e: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/hello_world.err
ulimit_vmsize_unlimited/ad12f922: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/ad12f922/stage
ulimit_vmsize_unlimited/ad12f922: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_vmsize_unlimited_build.sh
ulimit_vmsize_unlimited/ad12f922: Test completed in 0.005181 seconds
ulimit_vmsize_unlimited/ad12f922: Test completed with returncode: 0
ulimit_vmsize_unlimited/ad12f922: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/ad12f922/ulimit_vmsize_unlimited.out
ulimit_vmsize_unlimited/ad12f922: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/ad12f922/ulimit_vmsize_unlimited.err
ulimit_vmsize_unlimited/ad12f922: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/ad12f922/ulimit_vmsize_unlimited.out
ulimit_vmsize_unlimited/ad12f922: Regular Expression Match - Success!
kernel_swapusage/36712e82: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/kernel_state/kernel_swapusage/36712e82/stage
kernel_swapusage/36712e82: Running Test via command: bash --norc --noprofile -eo pipefail kernel_swapusage_build.sh
kernel_swapusage/36712e82 failed to submit job with returncode: 255 

sysctl: cannot stat /proc/sys/kernel/swapusage: No such file or directory

kernel_swapusage/36712e82: Detected failure in running test, will attempt to retry test: 1 times
kernel_swapusage/36712e82: Run - 1/1
kernel_swapusage/36712e82: Running Test via command: bash --norc --noprofile -eo pipefail kernel_swapusage_build.sh
kernel_swapusage/36712e82: failed to submit job with returncode: 255 
kernel_swapusage/36712e82: Test completed in 0.062409 seconds
kernel_swapusage/36712e82: Test completed with returncode: 255
kernel_swapusage/36712e82: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/kernel_state/kernel_swapusage/36712e82/kernel_swapusage.out
kernel_swapusage/36712e82: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/kernel_state/kernel_swapusage/36712e82/kernel_swapusage.err
systemd_default_target/d3b0cf36: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/d3b0cf36/stage
systemd_default_target/d3b0cf36: Running Test via command: bash --norc --noprofile -eo pipefail systemd_default_target_build.sh
systemd_default_target/d3b0cf36 failed to submit job with returncode: 1 


systemd_default_target/d3b0cf36: Detected failure in running test, will attempt to retry test: 1 times
systemd_default_target/d3b0cf36: Run - 1/1
systemd_default_target/d3b0cf36: Running Test via command: bash --norc --noprofile -eo pipefail systemd_default_target_build.sh
systemd_default_target/d3b0cf36: failed to submit job with returncode: 1 
systemd_default_target/d3b0cf36: Test completed in 0.183218 seconds
systemd_default_target/d3b0cf36: Test completed with returncode: 1
systemd_default_target/d3b0cf36: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/d3b0cf36/systemd_default_target.out
systemd_default_target/d3b0cf36: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/d3b0cf36/systemd_default_target.err
root_disk_usage/560f4448: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/disk_usage/root_disk_usage/560f4448/stage
root_disk_usage/560f4448: Running Test via command: bash --norc --noprofile -eo pipefail root_disk_usage_build.sh
root_disk_usage/560f4448: Test completed in 0.009321 seconds
root_disk_usage/560f4448: Test completed with returncode: 0
root_disk_usage/560f4448: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/disk_usage/root_disk_usage/560f4448/root_disk_usage.out
root_disk_usage/560f4448: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/disk_usage/root_disk_usage/560f4448/root_disk_usage.err
ulimit_max_user_process_2048/f5437dca: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/f5437dca/stage
ulimit_max_user_process_2048/f5437dca: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_max_user_process_2048_build.sh
ulimit_max_user_process_2048/f5437dca: Test completed in 0.007444 seconds
ulimit_max_user_process_2048/f5437dca: Test completed with returncode: 0
ulimit_max_user_process_2048/f5437dca: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/f5437dca/ulimit_max_user_process_2048.out
ulimit_max_user_process_2048/f5437dca: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/f5437dca/ulimit_max_user_process_2048.err
ulimit_max_user_process_2048/f5437dca: performing regular expression - '^2048$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/f5437dca/ulimit_max_user_process_2048.out
ulimit_max_user_process_2048/f5437dca: Regular Expression Match - Failed!
ulimit_filelock_unlimited/1f24f504: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1f24f504/stage
ulimit_filelock_unlimited/1f24f504: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_filelock_unlimited_build.sh
ulimit_filelock_unlimited/1f24f504: Test completed in 0.005907 seconds
ulimit_filelock_unlimited/1f24f504: Test completed with returncode: 0
ulimit_filelock_unlimited/1f24f504: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1f24f504/ulimit_filelock_unlimited.out
ulimit_filelock_unlimited/1f24f504: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1f24f504/ulimit_filelock_unlimited.err
ulimit_filelock_unlimited/1f24f504: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1f24f504/ulimit_filelock_unlimited.out
ulimit_filelock_unlimited/1f24f504: Regular Expression Match - Success!
ulimit_cputime_unlimited/b791c5f8: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/b791c5f8/stage
ulimit_cputime_unlimited/b791c5f8: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_cputime_unlimited_build.sh
ulimit_cputime_unlimited/b791c5f8: Test completed in 0.006161 seconds
ulimit_cputime_unlimited/b791c5f8: Test completed with returncode: 0
ulimit_cputime_unlimited/b791c5f8: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/b791c5f8/ulimit_cputime_unlimited.out
ulimit_cputime_unlimited/b791c5f8: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/b791c5f8/ulimit_cputime_unlimited.err
ulimit_cputime_unlimited/b791c5f8: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/b791c5f8/ulimit_cputime_unlimited.out
ulimit_cputime_unlimited/b791c5f8: Regular Expression Match - Success!
In this iteration we are going to run the following tests: [ulimit_filedescriptor_4096/5bc08f90, ulimit_stacksize_unlimited/5e704cc6, hello_world/fef2396e, ulimit_vmsize_unlimited/ad12f922, kernel_swapusage/36712e82, systemd_default_target/d3b0cf36, root_disk_usage/560f4448, ulimit_max_user_process_2048/f5437dca, ulimit_filelock_unlimited/1f24f504, ulimit_cputime_unlimited/b791c5f8]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ root_disk_us │ generic.loc… │ PASS   │ None None     │ 0          │ 0.009321 │
│ age/560f4448 │              │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ systemd_defa │ generic.loc… │ FAIL   │ None None     │ 1          │ 0.183218 │
│ ult_target/d │              │        │ None          │            │          │
│ 3b0cf36      │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_vmsiz │ generic.loc… │ PASS   │ None True     │ 0          │ 0.005181 │
│ e_unlimited/ │              │        │ None          │            │          │
│ ad12f922     │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_stack │ generic.loc… │ FAIL   │ None False    │ 0          │ 0.005385 │
│ size_unlimit │              │        │ None          │            │          │
│ ed/5e704cc6  │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ hello_world/ │ generic.loc… │ PASS   │ None None     │ 0          │ 0.005253 │
│ fef2396e     │              │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_max_u │ generic.loc… │ FAIL   │ None False    │ 0          │ 0.007444 │
│ ser_process_ │              │        │ None          │            │          │
│ 2048/f5437dc │              │        │               │            │          │
│ a            │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_filel │ generic.loc… │ PASS   │ None True     │ 0          │ 0.005907 │
│ ock_unlimite │              │        │ None          │            │          │
│ d/1f24f504   │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ kernel_swapu │ generic.loc… │ FAIL   │ None None     │ 255        │ 0.062409 │
│ sage/36712e8 │              │        │ None          │            │          │
│ 2            │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_filed │ generic.loc… │ FAIL   │ None False    │ 0          │ 0.005939 │
│ escriptor_40 │              │        │ None          │            │          │
│ 96/5bc08f90  │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_cputi │ generic.loc… │ PASS   │ None True     │ 0          │ 0.006161 │
│ me_unlimited │              │        │ None          │            │          │
│ /b791c5f8    │              │        │               │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



Passed Tests: 5/10 Percentage: 50.000%
Failed Tests: 5/10 Percentage: 50.000%


Adding 10 test results to /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/report.json
Writing Logfile to: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/logs/buildtest_igchadbd.log

The -x option can be used to exclude buildspecs which works similar to -b where it can be a file or directory path. In the next example try running the following commands:

buildtest build -b general_tests/configuration -x general_tests/configuration/ulimits.yml
buildtest build -b general_tests/configuration -x general_tests/configuration

You will notice in the second command when buildtest has no buildspecs to build it will terminate immediately.

Buildtest supports test timeout which can be used if you don’t want to wait indefinitely for test to complete. You can use --timeout option which will terminate test if it exceeds the timelimit. The timeout is in number of seconds. Let’s try running the following example and take note of how timeout affects the test status:

buildtest build -b tutorials/sleep.yml
buildtest build -b tutorials/sleep.yml --timeout=1
buildtest build -b tutorials/sleep.yml --timeout=5

Buildtest supports test discovery based on tags via buildtest build --tags or short option -t. Let’s try running the following test, take note of the output as buildtest will show discovered buildspecs based on tag names

buildtest build -t network
$ buildtest build -t network
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-21511056-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/08/04 19:23:58                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.5                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.17                                                   │
│ Configuration File: /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Test Directory:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Report File:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/t… ║
╚══════════════════════════════════════════════════════════════════════════════╝
                           Buildspecs By Tag=network                            
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/t… ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  1
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 1
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/tutorials/tags_example.yml: VALID
Total builder objects created: 2
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ string_… │ script │ generic… │ None     │ None  │ None  │ tags can │ /home/… │
│          │        │          │          │       │       │ be a     │         │
│          │        │          │          │       │       │ string   │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ list_of… │ script │ generic… │ None     │ None  │ None  │ tags can │ /home/… │
│          │        │          │          │       │       │ be a     │         │
│          │        │          │          │       │       │ list of  │         │
│          │        │          │          │       │       │ strings  │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
string_tag/4daa9b12: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/string_tag/4daa9b12
string_tag/4daa9b12: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/string_tag/4daa9b12/stage
string_tag/4daa9b12: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/string_tag/4daa9b12/string_tag_build.sh
list_of_strings_tags/a9cb47e1: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/list_of_strings_tags/a9cb47e1
list_of_strings_tags/a9cb47e1: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/list_of_strings_tags/a9cb47e1/stage
list_of_strings_tags/a9cb47e1: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/list_of_strings_tags/a9cb47e1/list_of_strings_tags_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
list_of_strings_tags/a9cb47e1 does not have any dependencies adding test to queue
string_tag/4daa9b12 does not have any dependencies adding test to queue
string_tag/4daa9b12: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/string_tag/4daa9b12/stage
string_tag/4daa9b12: Running Test via command: bash --norc --noprofile -eo pipefail string_tag_build.sh
string_tag/4daa9b12: Test completed in 0.006148 seconds
string_tag/4daa9b12: Test completed with returncode: 0
string_tag/4daa9b12: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/string_tag/4daa9b12/string_tag.out
string_tag/4daa9b12: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/string_tag/4daa9b12/string_tag.err
list_of_strings_tags/a9cb47e1: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/list_of_strings_tags/a9cb47e1/stage
list_of_strings_tags/a9cb47e1: Running Test via command: bash --norc --noprofile -eo pipefail list_of_strings_tags_build.sh
list_of_strings_tags/a9cb47e1: Test completed in 3.029706 seconds
list_of_strings_tags/a9cb47e1: Test completed with returncode: 0
list_of_strings_tags/a9cb47e1: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/list_of_strings_tags/a9cb47e1/list_of_strings_tags.out
list_of_strings_tags/a9cb47e1: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/tags_example/list_of_strings_tags/a9cb47e1/list_of_strings_tags.err
In this iteration we are going to run the following tests: [string_tag/4daa9b12, list_of_strings_tags/a9cb47e1]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ string_tag/4 │ generic.loc… │ PASS   │ None None     │ 0          │ 0.006148 │
│ daa9b12      │              │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ list_of_stri │ generic.loc… │ PASS   │ None None     │ 0          │ 3.029706 │
│ ngs_tags/a9c │              │        │ None          │            │          │
│ b47e1        │              │        │               │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



Passed Tests: 2/2 Percentage: 100.000%
Failed Tests: 0/2 Percentage: 0.000%


Adding 2 test results to /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/report.json
Writing Logfile to: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/logs/buildtest_bblvxvcy.log

To learn more about how to run tests, please refer to Building Test (buildtest build) guide.

Querying Test Report

Buildtest will keep track of all tests in a report file (JSON) that can be used to display content of all test runs and query metadata specific to test. To fetch all test runs you can use buildtest report command which will displays output in a table format.

You can fetch the path to report file by running:

buildtest report path

Buildtest can write test results to alternate report file if buildtest --report is used, you can list all report files by running:

buildtest report list

buildtest rt is an alias for buildtest report command for those that hate typing :-)

We can fetch all pass and failed tests via --fail and --pass. Let’s try running the following:

buildtest rt --fail
buildtest rt --pass

Now let’s assume you want to know total failed tests in report file, you can use --row-count option which displays total row count. Let’s run the following and see total fail count:

buildtest rt --fail --row-count

The buildtest rt summary can be useful if you want to summary of report file.

Buildtest supports paging support with buildtest rt which can be useful when you have lots of tests. To enable pagination you can run:

buildtest rt --pager

Finally we can filter test records and format table columns via --filter and --format option. Let’s try running the following command

buildtest rt --filter tags=network --format name,id,tags
$ buildtest rt --filter tags=network --format name,id,tags
Report File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/report.json
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                                ┃ id              ┃ tags                 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ string_tag                          │ 4daa9b12        │ network              │
├─────────────────────────────────────┼─────────────────┼──────────────────────┤
│ list_of_strings_tags                │ a9cb47e1        │ network ping         │
└─────────────────────────────────────┴─────────────────┴──────────────────────┘

The --format option are comma separated list of format fields while --filter option are key=value pair. To see list of available format and filter fields you can run:

buildtest rt --helpfilter
buildtest rt --helpformat

Inspecting Test

The buildtest inspect command can be used to query test details and display metadata for one or more test. First you will want to see all available test and their corresponding unique identifiers. Let’s run the following

buildtest it list
$ buildtest it list
                      Test Summary by id, name, buildspec                       
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ id                      ┃ name                     ┃ buildspec               ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ d6841bdb-323b-4757-a56… │ variables_bash           │ /home/docs/checkouts/r… │
│ 5a54ffd4-6a6e-4352-b5c… │ returncode_list_mismatch │ /home/docs/checkouts/r… │
│ 4f7bda80-6152-465e-bef… │ exit1_pass               │ /home/docs/checkouts/r… │
│ 137c3098-cbf7-4426-878… │ exit1_fail               │ /home/docs/checkouts/r… │
│ 0acd7443-c2ab-4172-9d2… │ returncode_int_match     │ /home/docs/checkouts/r… │
│ f3f38614-5f8d-4505-821… │ status_regex_stderr_pass │ /home/docs/checkouts/r… │
│ eeb356e4-ceb3-4a44-909… │ status_regex_stderr_fail │ /home/docs/checkouts/r… │
│ 3cf48963-ea9a-47a5-886… │ status_regex_stdout_pass │ /home/docs/checkouts/r… │
│ 30fce5a8-3e9c-4c46-b97… │ status_regex_stdout_fail │ /home/docs/checkouts/r… │
│ 1420c935-2dd0-42c6-8b0… │ regex_on_directory_not_… │ /home/docs/checkouts/r… │
│ 76a3c3dd-e55a-4615-873… │ regex_on_multiple_files  │ /home/docs/checkouts/r… │
│ 9c268cb5-aa1b-49d5-aa5… │ file_expansion_supported │ /home/docs/checkouts/r… │
│ 30d5a961-e5cf-4ff5-857… │ timelimit_min            │ /home/docs/checkouts/r… │
│ 5f64b2cc-e5a4-4412-98b… │ timelimit_min_fail       │ /home/docs/checkouts/r… │
│ c609b965-2e5d-454e-a6c… │ timelimit_max_fail       │ /home/docs/checkouts/r… │
│ 40c349e6-9cbc-452f-86c… │ timelimit_max            │ /home/docs/checkouts/r… │
│ 0aed6186-f10e-489e-b3f… │ timelimit_min_max        │ /home/docs/checkouts/r… │
│ b17dc48e-0ebd-4206-b3d… │ always_fail              │ /home/docs/checkouts/r… │
│ fd172c43-d720-4465-9c2… │ test_fail_returncode_ma… │ /home/docs/checkouts/r… │
│ a1793978-8f36-4b38-b05… │ test_pass_returncode_mi… │ /home/docs/checkouts/r… │
│ 9d093d72-8eb8-4fde-a57… │ always_pass              │ /home/docs/checkouts/r… │
│ e2633e5a-daf3-40db-858… │ status_exists            │ /home/docs/checkouts/r… │
│ dda48a38-d73f-453f-923… │ status_exists_failure    │ /home/docs/checkouts/r… │
│ 93f851a9-4c08-46bf-bc0… │ file_exists_pass         │ /home/docs/checkouts/r… │
│ f98f976b-4829-49a9-a00… │ file_and_dir_checks      │ /home/docs/checkouts/r… │
│ 694a6de2-e5a1-460f-b82… │ combined_file_and_dir_c… │ /home/docs/checkouts/r… │
│ ee0b91fb-7ed5-48df-8bc… │ symlink_test             │ /home/docs/checkouts/r… │
│ 887ec684-30c7-4202-bce… │ file_count_by_extension  │ /home/docs/checkouts/r… │
│ dbf93718-a402-4d63-802… │ file_count_on_directory  │ /home/docs/checkouts/r… │
│ 06c162a5-2250-453d-97c… │ file_extension_and_file… │ /home/docs/checkouts/r… │
│ c1482ae2-18be-486a-b1f… │ file_count_by_expression │ /home/docs/checkouts/r… │
│ 5cdd8fdc-65de-48fd-8ad… │ file_count_by_filetype   │ /home/docs/checkouts/r… │
│ 6e71b98a-f81e-4b36-978… │ file_traverse_limit      │ /home/docs/checkouts/r… │
│ df300bdd-f799-429e-adb… │ status_logical_or        │ /home/docs/checkouts/r… │
│ 4f6de28e-648f-4081-b13… │ status_logical_and       │ /home/docs/checkouts/r… │
│ 805087a1-c044-4239-a01… │ unskipped                │ /home/docs/checkouts/r… │
│ 7e56bb79-a198-451c-8ba… │ hello_world              │ /home/docs/checkouts/r… │
│ fef2396e-de43-4d0e-bc1… │ hello_world              │ /home/docs/checkouts/r… │
│ 560f4448-c901-42a2-abf… │ root_disk_usage          │ /home/docs/checkouts/r… │
│ d3b0cf36-21c9-40e5-8a2… │ systemd_default_target   │ /home/docs/checkouts/r… │
│ ad12f922-7161-433d-985… │ ulimit_vmsize_unlimited  │ /home/docs/checkouts/r… │
│ 5e704cc6-571e-425b-98a… │ ulimit_stacksize_unlimi… │ /home/docs/checkouts/r… │
│ f5437dca-14e6-44a9-9c6… │ ulimit_max_user_process… │ /home/docs/checkouts/r… │
│ 1f24f504-04ac-458e-ae7… │ ulimit_filelock_unlimit… │ /home/docs/checkouts/r… │
│ 5bc08f90-4231-4468-a2f… │ ulimit_filedescriptor_4… │ /home/docs/checkouts/r… │
│ b791c5f8-9145-4b5f-b08… │ ulimit_cputime_unlimited │ /home/docs/checkouts/r… │
│ 36712e82-89c6-478b-8df… │ kernel_swapusage         │ /home/docs/checkouts/r… │
│ 4daa9b12-e615-42e3-891… │ string_tag               │ /home/docs/checkouts/r… │
│ a9cb47e1-6b6c-4e79-930… │ list_of_strings_tags     │ /home/docs/checkouts/r… │
└─────────────────────────┴──────────────────────────┴─────────────────────────┘

In buildtest, test are referred as builders which is in format <name>/<ID> where each test has a unique identifier separated by backslash / character. To see all builders you can run:

buildtest it list -b

Note, we will be using the builder notation when querying test via buildtest it name and buildtest it query. The command buildtest it name will display raw JSON record from the report file for a given test. The test names can be positional arguments so you can query multiple tests simulataneously. Let’s run the following:

buildtest it name hello_world circle_area

The buildtest it query is used to query test records in human readable format. This command is useful once you run test via buildtest build and you want to inspect test result. buildtest can display test content, output and error file and support multiple test queries including regular expression!!

Let’s try running the following

buildtest it query -o -e --testpath hello_world
$ buildtest it query -o -e --testpath hello_world
─────────────── hello_world/fef2396e-de43-4d0e-bc1f-df8b2589b0a3 ───────────────
Executor: generic.local.bash
Description: hello world example
State: PASS
Returncode: 0
Runtime: 0.005253 sec
Starttime: 2023/08/04 19:23:56
Endtime: 2023/08/04 19:23:56
Command: bash --norc --noprofile -eo pipefail hello_world_build.sh
Test Script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/hello_world.sh
Build Script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/hello_world_build.sh
Output File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/hello_world.out
Error File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/tests/generic.local.bash/hello_world/hello_world/fef2396e/hello_world.err
Log File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/var/logs/buildtest_igchadbd.log
─ Output File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/che… ─
hello world!                                                                    
                                                                                
─ Error File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/chec… ─
                                                                                
─ Test File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/check… ─
#!/usr/bin/bash                                                                 
# Content of run section                                                        
echo "hello world!"

You can retrieve paths to given test via buildtest path that can be useful if you want to navigate to directory or list contents. By default buildtest path will retrieve root directory of test. You can retrieve output and error via buildtest path -o and buildtest path -e. Let’s try running:

buildtest path hello_world
buildtest path -o hello_world
buildtest path -e hello_world

We encourage you review Query Test Report for a detailed guide on how to query test in buildtest.

Interacting with Buildspecs

Buildtest supports several ways to interact with buildspecs, such as querying buildspec cache, validating buildspecs, showing content of buildspecs, and editing buildspecs in editor. The buildtest buildspec command contains several subcommands that we will discuss in this session. To learn more we encourage you see Buildspecs Interface for detailed guide.

The buildtest show command can be used to provide a brief help message for each subcommand. Let’s run the following command since there are lots of commands that can be used to query buildspec.

buildtest show buildspec
$ buildtest show buildspec
                               Finding Buildspecs                               
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Command                               ┃ Description                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ buildtest buildspec find              │ Discover and validate all buildspecs │
│                                       │ and load all validated buildspecs in │
│                                       │ cache                                │
│ buildtest buildspec find --rebuild    │ Rebuild cache file                   │
│ buildtest buildspec find --pager      │ Paginate output of buildspec cache   │
│ buildtest buildspec find --root /tmp  │ Discover buildspecs in /tmp and      │
│ --rebuild                             │ rebuild buildspec cache              │
│ buildtest buildspec find --quiet      │ Rebuild cache file but don't display │
│ --rebuild                             │ output of cache                      │
│ buildtest buildspec find --paths      │ Print all root directories for       │
│                                       │ buildspecs                           │
│ buildtest buildspec find --buildspec  │ List all available buildspecs from   │
│                                       │ cache                                │
│ buildtest buildspec find --executors  │ List all unique executors from cache │
│ buildtest buildspec find --filter     │ Filter buildspec cache based on      │
│ type=script,tags=pass                 │ type=script and  tags='pass'         │
│ buildtest buildspec find --filter     │ Filter cache by buildspec file       │
│ buildspec=<path>                      │                                      │
│ buildtest buildspec find --format     │ Format table columns by field:       │
│ name,description                      │ 'name', and 'description'            │
│ buildtest buildspec find              │ Group tests by tag name              │
│ --group-by-tags                       │                                      │
│ buildtest buildspec find              │ Group tests by executor name         │
│ --group-by-executor                   │                                      │
│ buildtest buildspec find --helpfilter │ Show all filter fields               │
│ buildtest buildspec find --helpformat │ Show all format fields               │
│ buildtest buildspec find --terse      │ Display output in terse format       │
│ buildtest buildspec find --row-count  │ Print total count of records from    │
│                                       │ the table                            │
│ buildtest buildspec find --count=5    │ Limit output of buildspec cache to 5 │
│                                       │ elements                             │
│ buildtest buildspec find invalid      │ Show invalid buildspecs              │
│ buildtest buildspec find invalid      │ Show invalid buildspecs with error   │
│ --error                               │ messages                             │
│ buildtest buildspec find invalid      │ Print total count of records from    │
│ --row-count                           │ the table                            │
└───────────────────────────────────────┴──────────────────────────────────────┘
                             Validating Buildspecs                              
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Command                               ┃ Description                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ buildtest buildspec validate -b       │ Validate a buildspec with JSON       │
│ <file>                                │ Schema                               │
│ buildtest buildspec validate -b /tmp/ │ Validate all buildspecs in directory │
│ -x /tmp/network                       │ /tmp but exclude /tmp/network        │
│ buildtest buildspec validate -t       │ Validate all buildspecs for tagname  │
│ python -t mac                         │ 'python' and 'mac'                   │
│ buildtest buildspec validate -e       │ Validate all buildspecs for executor │
│ generic.local.bash                    │ 'generic.local.bash'                 │
└───────────────────────────────────────┴──────────────────────────────────────┘
                       Additional Features of Buildspecs                        
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Command                               ┃ Description                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ buildtest buildspec summary           │ Show summary of buildspec cache file │
│ buildtest buildspec summary --pager   │ Paginate the output of summary for   │
│                                       │ buildspec cache                      │
│ buildtest buildspec show python_hello │ Show content of buildspec based on   │
│                                       │ test name 'python_hello'             │
│ buildtest buildspec show python_hello │ Use color theme 'emacs' for showing  │
│ --theme emacs                         │ content of test                      │
│ buildtest buildspec show-fail         │ Show content of buildspec on all     │
│                                       │ failed tests                         │
│ buildtest buildspec show-fail         │ Show content of test 'exit1_fail'    │
│ exit1_fail                            │                                      │
│ buildtest buildspec edit-test         │ Open test 'python_hello' in editor   │
│ python_hello                          │ and validate file upon closing       │
│ buildtest buildspec edit-file         │ Open file                            │
│ $BUILDTEST_ROOT/tutorials/sleep.yml   │ $BUILDTEST_ROOT/tutorials/sleep.yml  │
│                                       │ in editor and validate file upon     │
│                                       │ closing                              │
│ buildtest buildspec maintainers find  │ Find buildspec with maintainer name  │
│ johndoe                               │ 'johndoe'                            │
│ buildtest buildspec maintainers       │ List all maintainers from buildspec  │
│                                       │ cache                                │
│ buildtest buildspec maintainers       │ Print total count of records from    │
│ --row-count                           │ the table                            │
│ buildtest buildspec maintainers       │ List all maintainers in machine      │
│ --terse --no-header                   │ readable format without header       │
│ buildtest buildspec maintainers       │ Show breakdown of maintainers by     │
│ --breakdown                           │ buildspecs                           │
└───────────────────────────────────────┴──────────────────────────────────────┘

To build the buildspec cache you will need to run the following:

buildtest buildspec find --rebuild -q

The --rebuild option will rebuild the cache and -q will supress output. If you want to see all valid buildspecs in cache you can run:

buildtest buildspec find

To retrieve all tags you can run:

buildtest buildspec find --tags

We can filter tests via --filter option which expects a key=value pair. Let’s filter by tagname python by running:

buildtest buildspec find --filter tags=python

We can format the columns using --format option where each field is comma separated. Let’s format by fields name, tags, description

buildtest buildspec find --filter tags=python --format name,tags,description

To see all filter and format fields you can use --helpfilter and --helpformat to list all fields and their description.

If you want to see a summary of the buildspec cache you can run:

buildtest buildspec summary

Buildtest has an alias buildtest bc for buildtest buildspec command so let’s use this going forward.

To validate a buildspec you can use buildtest bc validate command there are several options analogous to buildtest build for discovering buildspecs such as -b, -x, -t, -e. For instance let’s validate the following buildspecs:

buildtest bc validate -b tutorials/hello_world.yml -b general_tests/configuration
buildtest bc validate -t python

Let’s try validating an invalid buildspec so you can see what happens

buildtest bc validate -b tutorials/invalid_executor.yml
$ buildtest bc validate -b tutorials/invalid_executor.yml
─ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/t… ─
"[/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/tutorials/invalid_executor.yml]: Unable to find executor: badexecutor in ['generic.local.bash', 'generic.local.sh', 'generic.local.csh', 'generic.local.zsh']"


1 buildspecs failed to validate

To see content of buildspec you can use buildtest bc show which expects name of test. Note tab completion is supported.

Let’s run the following:

buildtest bc show sleep hello_world

Buildtest uses rich python library for coloring which is used extensively throughout the buildtest output. Rich supports several built-in themes that can be used for your preference. The buildtest bc show --theme <THEME> can be used select a color theme.

Currently, buildtest supports the following themes, feel free to tab complete:

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

Let’s try running the same example with emacs theme:

buildtest bc show --theme emacs sleep

If you want to see list of invalid buildspecs you can run:

buildtest bc find invalid

Note, if you fix your invalid buildspec, buildtest will have no way of knowing if buildspec is valid until you rebuild the buildspec cache buildtest bc find --rebuild.

Query Details from Buildtest Configuration

In order to use buildtest, you need to configure buildtest. We will not discuss how to configure buildtest in this tutorial, but show how you can interact with configuration file via command line.

Buildtest provides a default configuration file that is sufficient to get started. To view path to configuration file you can run:

buildtest config path

We have an alias buildtest cg for buildtest config command. If you want to view content of configuration file you can run

buildtest cg view
$ buildtest cg view
─ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.5/b… ─
   1 system:
   2   generic:
   3     # specify list of hostnames where buildtest can run for given system record
   4     hostnames: [".*"]
   5 
   6     # system description
   7     description: Generic System
   8     # specify module system used at your site (environment-modules, lmod)
   9     moduletool: N/A
  10 
  11     # specify test timeout duration in number of seconds
  12     # timeout: 60
  13 
  14     # pool size for parallel processing using multiprocessing.Pool. Pool Size must be 1 or higher. The pool size is calculated as follows: poolsize = min(poolsize, os.cpu_count())
  15     poolsize: 1
  16 
  17     # determine whether to enable pagination
  18     pager: False
  19 
  20     buildspecs:
  21       # whether to rebuild cache file automatically when running `buildtest buildspec find`
  22       rebuild: False
  23       # limit number of records to display when running `buildtest buildspec find`
  24       count: 15
  25       # format fields to display when running `buildtest buildspec find`, By default we will show name,description
  26       format: "name,description"
  27       # enable terse mode
  28       terse: False
  29       # specify list of directories to search for buildspecs when building cache
  30       #root: [ $BUILDTEST_ROOT/examples, /tmp/buildspecs ]
  31     report:
  32       count: 25
  33       #enable terse mode for report
  34       terse: False
  35       format: "name,id,state,runtime,returncode"
  36       # show the latest for every test
  37       latest: True
  38       # show the oldest for every test
  39       oldest: False
  40 
  41     executors:
  42       # define local executors for running jobs locally
  43       local:
  44         bash:
  45           description: submit jobs on local machine using bash shell
  46           shell: bash
  47         sh:
  48           description: submit jobs on local machine using sh shell
  49           shell: sh
  50         csh:
  51           description: submit jobs on local machine using csh shell
  52           shell: csh
  53         zsh:
  54           description: submit jobs on local machine using zsh shell
  55           shell: zsh
  56     # compiler block
  57     compilers:
  58       # a list of directories to search for modules
  59       # modulepath: ['/tmp', '/var/']
  60 
  61       # regular expression to search for compilers based on module pattern. Used with 'buildtest config compilers find' to generate compiler instance
  62       # find:
  63       #  gcc: "^(gcc)"
  64       #  intel: "^(intel)"
  65       #  cray: "^(craype)"
  66       #  pgi: "^(pgi)"
  67       #  cuda: ^(cuda)"
  68       #  clang: "^(clang)"
  69 
  70       # declare compiler instance which can be site-specific. You can let 'buildtest config compilers find' generate compiler section
  71       compiler:
  72         gcc:
  73           builtin_gcc:
  74             cc: gcc
  75             fc: gfortran
  76             cxx: g++
  77 
  78     # location of log directory
  79     # logdir: /tmp/
  80 
  81     # specify location where buildtest will write tests
  82     # testdir: /tmp
  83 
  84     # specify one or more directory where buildtest should load buildspecs
  85     # buildspec_roots: []
  86 
  87     cdash:
  88       url: https://my.cdash.org/
  89       project: buildtest
  90       site: generic
  91       buildname: tutorials
  92

We also support color themes (buildtest cg view --theme <theme>) when showing content of buildtest configuration.

Buildtest configuration file defines one or more executors that are used when writing test. Every test must be run by an executor. To retrieve all executors in a flat-listing you can run the following

buildtest cg executors
$ buildtest cg executors
generic.local.bash
generic.local.sh
generic.local.csh
generic.local.zsh

Buildtest can show executor details in JSON and YAML format, you can fetch the details by running the following

buildtest cg executors --json
$ buildtest cg executors --json
{
  "executors": {
    "local": {
      "bash": {
        "description": "submit jobs on local machine using bash shell",
        "shell": "bash"
      },
      "sh": {
        "description": "submit jobs on local machine using sh shell",
        "shell": "sh"
      },
      "csh": {
        "description": "submit jobs on local machine using csh shell",
        "shell": "csh"
      },
      "zsh": {
        "description": "submit jobs on local machine using zsh shell",
        "shell": "zsh"
      }
    }
  }
}
buildtest cg executors --yaml
$ buildtest cg executors --yaml
executors:
  local:
    bash:
      description: submit jobs on local machine using bash shell
      shell: bash
    csh:
      description: submit jobs on local machine using csh shell
      shell: csh
    sh:
      description: submit jobs on local machine using sh shell
      shell: sh
    zsh:
      description: submit jobs on local machine using zsh shell
      shell: zsh