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-22064509-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/09/28 19:49:48                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.6                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.17                                                   │
│ Configuration File: /tmp/tmpy0ox5_tj/config.yml                              │
│ Test Directory:     /tmp/tmpy0ox5_tj/var/tests                               │
│ Report File:        /tmp/tmpy0ox5_tj/var/report.json                         │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/tu ║
║ torials/hello_world.yml                                                      ║
╚══════════════════════════════════════════════════════════════════════════════╝


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.6/tutorials/hello_world.yml: VALID
Total builder objects created: 1
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃          ┃        ┃          ┃          ┃       ┃       ┃ descript ┃ buildsp ┃
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ ion      ┃ ecs     ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ hello_wo │ script │ generic. │ None     │ None  │ None  │ hello    │ /home/d │
│ rld/ee3d │        │ local.ba │          │       │       │ world    │ ocs/che │
│ 9fcf     │        │ sh       │          │       │       │ example  │ ckouts/ │
│          │        │          │          │       │       │          │ readthe │
│          │        │          │          │       │       │          │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ hello_w │
│          │        │          │          │       │       │          │ orld.ym │
│          │        │          │          │       │       │          │ l       │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
hello_world/ee3d9fcf: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/ee3d9fcf
hello_world/ee3d9fcf: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/ee3d9fcf/stage
hello_world/ee3d9fcf: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/ee3d9fcf/hello_world_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
hello_world/ee3d9fcf does not have any dependencies adding test to queue
Builders Eligible to Run
┏━━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder              ┃
┡━━━━━━━━━━━━━━━━━━━━━━┩
│ hello_world/ee3d9fcf │
└──────────────────────┘
hello_world/ee3d9fcf: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/ee3d9fcf/stage
hello_world/ee3d9fcf: Running Test via command: bash --norc --noprofile -eo pipefail hello_world_build.sh
hello_world/ee3d9fcf: Test completed in 0.005942 seconds
hello_world/ee3d9fcf: Test completed with returncode: 0
hello_world/ee3d9fcf: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/ee3d9fcf/hello_world.out
hello_world/ee3d9fcf: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/ee3d9fcf/hello_world.err
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ hello_world/ │ generic.loca │ PASS   │ None None     │ 0          │ 0.005942 │
│ ee3d9fcf     │ l.bash       │        │ None          │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 1 test results to /tmp/tmpy0ox5_tj/var/report.json
Writing Logfile to: /tmp/tmpy0ox5_tj/var/logs/buildtest_x4w5wtum.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-22064509-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/09/28 19:49:49                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.6                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.17                                                   │
│ Configuration File: /tmp/tmpy0ox5_tj/config.yml                              │
│ Test Directory:     /tmp/tmpy0ox5_tj/var/tests                               │
│ Report File:        /tmp/tmpy0ox5_tj/var/report.json                         │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/ge ║
║ neral_tests/configuration/kernel_state.yml                                   ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/ge ║
║ neral_tests/configuration/ulimits.yml                                        ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/tu ║
║ torials/hello_world.yml                                                      ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/ge ║
║ neral_tests/configuration/systemd-default-target.yml                         ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/ge ║
║ neral_tests/configuration/disk_usage.yml                                     ║
╚══════════════════════════════════════════════════════════════════════════════╝


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.6/general_tests/configuration/kernel_state.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/general_tests/configuration/ulimits.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/tutorials/hello_world.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/general_tests/configuration/systemd-default-target.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/general_tests/configuration/disk_usage.yml: VALID
Total builder objects created: 10
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃          ┃        ┃          ┃          ┃       ┃       ┃ descript ┃ buildsp ┃
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ ion      ┃ ecs     ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ kernel_s │ script │ generic. │ None     │ None  │ None  │ Retrieve │ /home/d │
│ wapusage │        │ local.ba │          │       │       │ Kernel   │ ocs/che │
│ /beac1ee │        │ sh       │          │       │       │ Swap     │ ckouts/ │
│ 8        │        │          │          │       │       │ Usage    │ readthe │
│          │        │          │          │       │       │          │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/ker │
│          │        │          │          │       │       │          │ nel_sta │
│          │        │          │          │       │       │          │ te.yml  │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_f │ script │ generic. │ None     │ None  │ None  │ Check if │ /home/d │
│ ilelock_ │        │ local.ba │          │       │       │ file     │ ocs/che │
│ unlimite │        │ sh       │          │       │       │ lock is  │ ckouts/ │
│ d/5f2b88 │        │          │          │       │       │ set to   │ readthe │
│ ad       │        │          │          │       │       │ unlimite │ docs.or │
│          │        │          │          │       │       │ d in     │ g/user_ │
│          │        │          │          │       │       │ ulimits  │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/uli │
│          │        │          │          │       │       │          │ mits.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_c │ script │ generic. │ None     │ None  │ None  │ Check if │ /home/d │
│ putime_u │        │ local.ba │          │       │       │ cputime  │ ocs/che │
│ nlimited │        │ sh       │          │       │       │ is set   │ ckouts/ │
│ /f9335bb │        │          │          │       │       │ to       │ readthe │
│ 3        │        │          │          │       │       │ unlimite │ docs.or │
│          │        │          │          │       │       │ d in     │ g/user_ │
│          │        │          │          │       │       │ ulimits  │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/uli │
│          │        │          │          │       │       │          │ mits.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_s │ script │ generic. │ None     │ None  │ None  │ Check if │ /home/d │
│ tacksize │        │ local.ba │          │       │       │ stack    │ ocs/che │
│ _unlimit │        │ sh       │          │       │       │ size is  │ ckouts/ │
│ ed/f42f0 │        │          │          │       │       │ set to   │ readthe │
│ d6d      │        │          │          │       │       │ unlimite │ docs.or │
│          │        │          │          │       │       │ d in     │ g/user_ │
│          │        │          │          │       │       │ ulimits  │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/uli │
│          │        │          │          │       │       │          │ mits.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_v │ script │ generic. │ None     │ None  │ None  │ Check    │ /home/d │
│ msize_un │        │ local.ba │          │       │       │ virtual  │ ocs/che │
│ limited/ │        │ sh       │          │       │       │ memory   │ ckouts/ │
│ c30d85f7 │        │          │          │       │       │ size and │ readthe │
│          │        │          │          │       │       │ check if │ docs.or │
│          │        │          │          │       │       │ its set  │ g/user_ │
│          │        │          │          │       │       │ to       │ builds/ │
│          │        │          │          │       │       │ unlimite │ buildte │
│          │        │          │          │       │       │ d        │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/uli │
│          │        │          │          │       │       │          │ mits.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_f │ script │ generic. │ None     │ None  │ None  │ Check if │ /home/d │
│ iledescr │        │ local.ba │          │       │       │ open     │ ocs/che │
│ iptor_40 │        │ sh       │          │       │       │ file     │ ckouts/ │
│ 96/874b6 │        │          │          │       │       │ descript │ readthe │
│ f21      │        │          │          │       │       │ ors      │ docs.or │
│          │        │          │          │       │       │ limit is │ g/user_ │
│          │        │          │          │       │       │ set to   │ builds/ │
│          │        │          │          │       │       │ 4096     │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/uli │
│          │        │          │          │       │       │          │ mits.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_m │ script │ generic. │ None     │ None  │ None  │ Check    │ /home/d │
│ ax_user_ │        │ local.ba │          │       │       │ max      │ ocs/che │
│ process_ │        │ sh       │          │       │       │ number   │ ckouts/ │
│ 2048/e11 │        │          │          │       │       │ of user  │ readthe │
│ eccd3    │        │          │          │       │       │ process  │ docs.or │
│          │        │          │          │       │       │ limit is │ g/user_ │
│          │        │          │          │       │       │ set to   │ builds/ │
│          │        │          │          │       │       │ 2048     │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/uli │
│          │        │          │          │       │       │          │ mits.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ hello_wo │ script │ generic. │ None     │ None  │ None  │ hello    │ /home/d │
│ rld/8788 │        │ local.ba │          │       │       │ world    │ ocs/che │
│ 1b8a     │        │ sh       │          │       │       │ example  │ ckouts/ │
│          │        │          │          │       │       │          │ readthe │
│          │        │          │          │       │       │          │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ hello_w │
│          │        │          │          │       │       │          │ orld.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ systemd_ │ script │ generic. │ None     │ None  │ None  │ check if │ /home/d │
│ default_ │        │ local.ba │          │       │       │ default  │ ocs/che │
│ target/0 │        │ sh       │          │       │       │ target   │ ckouts/ │
│ c6e0c8e  │        │          │          │       │       │ is       │ readthe │
│          │        │          │          │       │       │ multi-us │ docs.or │
│          │        │          │          │       │       │ er.targe │ g/user_ │
│          │        │          │          │       │       │ t        │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/sys │
│          │        │          │          │       │       │          │ temd-de │
│          │        │          │          │       │       │          │ fault-t │
│          │        │          │          │       │       │          │ arget.y │
│          │        │          │          │       │       │          │ ml      │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ root_dis │ script │ generic. │ None     │ None  │ None  │ Check    │ /home/d │
│ k_usage/ │        │ local.ba │          │       │       │ root     │ ocs/che │
│ 087e4fd4 │        │ sh       │          │       │       │ disk     │ ckouts/ │
│          │        │          │          │       │       │ usage    │ readthe │
│          │        │          │          │       │       │ and      │ docs.or │
│          │        │          │          │       │       │ report   │ g/user_ │
│          │        │          │          │       │       │ if it    │ builds/ │
│          │        │          │          │       │       │ exceeds  │ buildte │
│          │        │          │          │       │       │ threshol │ st/chec │
│          │        │          │          │       │       │ d        │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/gen │
│          │        │          │          │       │       │          │ eral_te │
│          │        │          │          │       │       │          │ sts/con │
│          │        │          │          │       │       │          │ figurat │
│          │        │          │          │       │       │          │ ion/dis │
│          │        │          │          │       │       │          │ k_usage │
│          │        │          │          │       │       │          │ .yml    │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
kernel_swapusage/beac1ee8: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/kernel_state/kernel_swapusage/beac1ee8
kernel_swapusage/beac1ee8: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/kernel_state/kernel_swapusage/beac1ee8/stage
kernel_swapusage/beac1ee8: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/kernel_state/kernel_swapusage/beac1ee8/kernel_swapusage_build.sh
ulimit_filelock_unlimited/5f2b88ad: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/5f2b88ad
ulimit_filelock_unlimited/5f2b88ad: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/5f2b88ad/stage
ulimit_filelock_unlimited/5f2b88ad: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/5f2b88ad/ulimit_filelock_unlimited_build.sh
ulimit_cputime_unlimited/f9335bb3: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/f9335bb3
ulimit_cputime_unlimited/f9335bb3: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/f9335bb3/stage
ulimit_cputime_unlimited/f9335bb3: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/f9335bb3/ulimit_cputime_unlimited_build.sh
ulimit_stacksize_unlimited/f42f0d6d: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/f42f0d6d
ulimit_stacksize_unlimited/f42f0d6d: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/f42f0d6d/stage
ulimit_stacksize_unlimited/f42f0d6d: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/f42f0d6d/ulimit_stacksize_unlimited_build.sh
ulimit_vmsize_unlimited/c30d85f7: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/c30d85f7
ulimit_vmsize_unlimited/c30d85f7: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/c30d85f7/stage
ulimit_vmsize_unlimited/c30d85f7: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/c30d85f7/ulimit_vmsize_unlimited_build.sh
ulimit_filedescriptor_4096/874b6f21: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/874b6f21
ulimit_filedescriptor_4096/874b6f21: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/874b6f21/stage
ulimit_filedescriptor_4096/874b6f21: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/874b6f21/ulimit_filedescriptor_4096_build.sh
ulimit_max_user_process_2048/e11eccd3: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/e11eccd3
ulimit_max_user_process_2048/e11eccd3: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/e11eccd3/stage
ulimit_max_user_process_2048/e11eccd3: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/e11eccd3/ulimit_max_user_process_2048_build.sh
hello_world/87881b8a: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a
hello_world/87881b8a: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/stage
hello_world/87881b8a: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/hello_world_build.sh
systemd_default_target/0c6e0c8e: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/0c6e0c8e
systemd_default_target/0c6e0c8e: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/0c6e0c8e/stage
systemd_default_target/0c6e0c8e: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/0c6e0c8e/systemd_default_target_build.sh
root_disk_usage/087e4fd4: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/disk_usage/root_disk_usage/087e4fd4
root_disk_usage/087e4fd4: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/disk_usage/root_disk_usage/087e4fd4/stage
root_disk_usage/087e4fd4: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/disk_usage/root_disk_usage/087e4fd4/root_disk_usage_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
ulimit_vmsize_unlimited/c30d85f7 does not have any dependencies adding test to queue
ulimit_filedescriptor_4096/874b6f21 does not have any dependencies adding test to queue
ulimit_stacksize_unlimited/f42f0d6d does not have any dependencies adding test to queue
ulimit_filelock_unlimited/5f2b88ad does not have any dependencies adding test to queue
root_disk_usage/087e4fd4 does not have any dependencies adding test to queue
systemd_default_target/0c6e0c8e does not have any dependencies adding test to queue
ulimit_cputime_unlimited/f9335bb3 does not have any dependencies adding test to queue
hello_world/87881b8a does not have any dependencies adding test to queue
kernel_swapusage/beac1ee8 does not have any dependencies adding test to queue
ulimit_max_user_process_2048/e11eccd3 does not have any dependencies adding test to queue
        Builders Eligible to Run         
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder                               ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ulimit_vmsize_unlimited/c30d85f7      │
│ ulimit_filedescriptor_4096/874b6f21   │
│ ulimit_stacksize_unlimited/f42f0d6d   │
│ ulimit_filelock_unlimited/5f2b88ad    │
│ root_disk_usage/087e4fd4              │
│ systemd_default_target/0c6e0c8e       │
│ ulimit_cputime_unlimited/f9335bb3     │
│ hello_world/87881b8a                  │
│ kernel_swapusage/beac1ee8             │
│ ulimit_max_user_process_2048/e11eccd3 │
└───────────────────────────────────────┘
ulimit_vmsize_unlimited/c30d85f7: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/c30d85f7/stage
ulimit_vmsize_unlimited/c30d85f7: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_vmsize_unlimited_build.sh
ulimit_vmsize_unlimited/c30d85f7: Test completed in 0.006018 seconds
ulimit_vmsize_unlimited/c30d85f7: Test completed with returncode: 0
ulimit_vmsize_unlimited/c30d85f7: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/c30d85f7/ulimit_vmsize_unlimited.out
ulimit_vmsize_unlimited/c30d85f7: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/c30d85f7/ulimit_vmsize_unlimited.err
ulimit_vmsize_unlimited/c30d85f7: performing regular expression - '^unlimited$' on file: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/c30d85f7/ulimit_vmsize_unlimited.out
ulimit_vmsize_unlimited/c30d85f7: Regular Expression Match - Success!
ulimit_filedescriptor_4096/874b6f21: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/874b6f21/stage
ulimit_filedescriptor_4096/874b6f21: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_filedescriptor_4096_build.sh
ulimit_filedescriptor_4096/874b6f21: Test completed in 0.005517 seconds
ulimit_filedescriptor_4096/874b6f21: Test completed with returncode: 0
ulimit_filedescriptor_4096/874b6f21: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/874b6f21/ulimit_filedescriptor_4096.out
ulimit_filedescriptor_4096/874b6f21: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/874b6f21/ulimit_filedescriptor_4096.err
ulimit_filedescriptor_4096/874b6f21: performing regular expression - '^4096$' on file: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/874b6f21/ulimit_filedescriptor_4096.out
ulimit_filedescriptor_4096/874b6f21: Regular Expression Match - Failed!
ulimit_stacksize_unlimited/f42f0d6d: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/f42f0d6d/stage
ulimit_stacksize_unlimited/f42f0d6d: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_stacksize_unlimited_build.sh
ulimit_stacksize_unlimited/f42f0d6d: Test completed in 0.005449 seconds
ulimit_stacksize_unlimited/f42f0d6d: Test completed with returncode: 0
ulimit_stacksize_unlimited/f42f0d6d: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/f42f0d6d/ulimit_stacksize_unlimited.out
ulimit_stacksize_unlimited/f42f0d6d: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/f42f0d6d/ulimit_stacksize_unlimited.err
ulimit_stacksize_unlimited/f42f0d6d: performing regular expression - '^unlimited$' on file: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/f42f0d6d/ulimit_stacksize_unlimited.out
ulimit_stacksize_unlimited/f42f0d6d: Regular Expression Match - Failed!
ulimit_filelock_unlimited/5f2b88ad: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/5f2b88ad/stage
ulimit_filelock_unlimited/5f2b88ad: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_filelock_unlimited_build.sh
ulimit_filelock_unlimited/5f2b88ad: Test completed in 0.005445 seconds
ulimit_filelock_unlimited/5f2b88ad: Test completed with returncode: 0
ulimit_filelock_unlimited/5f2b88ad: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/5f2b88ad/ulimit_filelock_unlimited.out
ulimit_filelock_unlimited/5f2b88ad: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/5f2b88ad/ulimit_filelock_unlimited.err
ulimit_filelock_unlimited/5f2b88ad: performing regular expression - '^unlimited$' on file: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/5f2b88ad/ulimit_filelock_unlimited.out
ulimit_filelock_unlimited/5f2b88ad: Regular Expression Match - Success!
root_disk_usage/087e4fd4: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/disk_usage/root_disk_usage/087e4fd4/stage
root_disk_usage/087e4fd4: Running Test via command: bash --norc --noprofile -eo pipefail root_disk_usage_build.sh
root_disk_usage/087e4fd4: Test completed in 0.010396 seconds
root_disk_usage/087e4fd4: Test completed with returncode: 0
root_disk_usage/087e4fd4: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/disk_usage/root_disk_usage/087e4fd4/root_disk_usage.out
root_disk_usage/087e4fd4: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/disk_usage/root_disk_usage/087e4fd4/root_disk_usage.err
systemd_default_target/0c6e0c8e: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/0c6e0c8e/stage
systemd_default_target/0c6e0c8e: Running Test via command: bash --norc --noprofile -eo pipefail systemd_default_target_build.sh
systemd_default_target/0c6e0c8e failed to submit job with returncode: 1 


systemd_default_target/0c6e0c8e: Detected failure in running test, will attempt to retry test: 1 times
systemd_default_target/0c6e0c8e: Run - 1/1
systemd_default_target/0c6e0c8e: Running Test via command: bash --norc --noprofile -eo pipefail systemd_default_target_build.sh
systemd_default_target/0c6e0c8e: failed to submit job with returncode: 1 
systemd_default_target/0c6e0c8e: Test completed in 0.217704 seconds
systemd_default_target/0c6e0c8e: Test completed with returncode: 1
systemd_default_target/0c6e0c8e: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/0c6e0c8e/systemd_default_target.out
systemd_default_target/0c6e0c8e: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/0c6e0c8e/systemd_default_target.err
ulimit_cputime_unlimited/f9335bb3: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/f9335bb3/stage
ulimit_cputime_unlimited/f9335bb3: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_cputime_unlimited_build.sh
ulimit_cputime_unlimited/f9335bb3: Test completed in 0.005781 seconds
ulimit_cputime_unlimited/f9335bb3: Test completed with returncode: 0
ulimit_cputime_unlimited/f9335bb3: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/f9335bb3/ulimit_cputime_unlimited.out
ulimit_cputime_unlimited/f9335bb3: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/f9335bb3/ulimit_cputime_unlimited.err
ulimit_cputime_unlimited/f9335bb3: performing regular expression - '^unlimited$' on file: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/f9335bb3/ulimit_cputime_unlimited.out
ulimit_cputime_unlimited/f9335bb3: Regular Expression Match - Success!
hello_world/87881b8a: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/stage
hello_world/87881b8a: Running Test via command: bash --norc --noprofile -eo pipefail hello_world_build.sh
hello_world/87881b8a: Test completed in 0.006442 seconds
hello_world/87881b8a: Test completed with returncode: 0
hello_world/87881b8a: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/hello_world.out
hello_world/87881b8a: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/hello_world.err
kernel_swapusage/beac1ee8: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/kernel_state/kernel_swapusage/beac1ee8/stage
kernel_swapusage/beac1ee8: Running Test via command: bash --norc --noprofile -eo pipefail kernel_swapusage_build.sh
kernel_swapusage/beac1ee8 failed to submit job with returncode: 255 

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

kernel_swapusage/beac1ee8: Detected failure in running test, will attempt to retry test: 1 times
kernel_swapusage/beac1ee8: Run - 1/1
kernel_swapusage/beac1ee8: Running Test via command: bash --norc --noprofile -eo pipefail kernel_swapusage_build.sh
kernel_swapusage/beac1ee8: failed to submit job with returncode: 255 
kernel_swapusage/beac1ee8: Test completed in 0.126859 seconds
kernel_swapusage/beac1ee8: Test completed with returncode: 255
kernel_swapusage/beac1ee8: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/kernel_state/kernel_swapusage/beac1ee8/kernel_swapusage.out
kernel_swapusage/beac1ee8: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/kernel_state/kernel_swapusage/beac1ee8/kernel_swapusage.err
ulimit_max_user_process_2048/e11eccd3: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/e11eccd3/stage
ulimit_max_user_process_2048/e11eccd3: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_max_user_process_2048_build.sh
ulimit_max_user_process_2048/e11eccd3: Test completed in 0.007624 seconds
ulimit_max_user_process_2048/e11eccd3: Test completed with returncode: 0
ulimit_max_user_process_2048/e11eccd3: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/e11eccd3/ulimit_max_user_process_2048.out
ulimit_max_user_process_2048/e11eccd3: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/e11eccd3/ulimit_max_user_process_2048.err
ulimit_max_user_process_2048/e11eccd3: performing regular expression - '^2048$' on file: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/e11eccd3/ulimit_max_user_process_2048.out
ulimit_max_user_process_2048/e11eccd3: Regular Expression Match - Failed!
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ ulimit_filed │ generic.loca │ FAIL   │ None False    │ 0          │ 0.005517 │
│ escriptor_40 │ l.bash       │        │ None          │            │          │
│ 96/874b6f21  │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_vmsiz │ generic.loca │ PASS   │ None True     │ 0          │ 0.006018 │
│ e_unlimited/ │ l.bash       │        │ None          │            │          │
│ c30d85f7     │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_filel │ generic.loca │ PASS   │ None True     │ 0          │ 0.005445 │
│ ock_unlimite │ l.bash       │        │ None          │            │          │
│ d/5f2b88ad   │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ kernel_swapu │ generic.loca │ FAIL   │ None None     │ 255        │ 0.126859 │
│ sage/beac1ee │ l.bash       │        │ None          │            │          │
│ 8            │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_max_u │ generic.loca │ FAIL   │ None False    │ 0          │ 0.007624 │
│ ser_process_ │ l.bash       │        │ None          │            │          │
│ 2048/e11eccd │              │        │               │            │          │
│ 3            │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_stack │ generic.loca │ FAIL   │ None False    │ 0          │ 0.005449 │
│ size_unlimit │ l.bash       │        │ None          │            │          │
│ ed/f42f0d6d  │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ hello_world/ │ generic.loca │ PASS   │ None None     │ 0          │ 0.006442 │
│ 87881b8a     │ l.bash       │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ root_disk_us │ generic.loca │ PASS   │ None None     │ 0          │ 0.010396 │
│ age/087e4fd4 │ l.bash       │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_cputi │ generic.loca │ PASS   │ None True     │ 0          │ 0.005781 │
│ me_unlimited │ l.bash       │        │ None          │            │          │
│ /f9335bb3    │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ systemd_defa │ generic.loca │ FAIL   │ None None     │ 1          │ 0.217704 │
│ ult_target/0 │ l.bash       │        │ None          │            │          │
│ c6e0c8e      │              │        │               │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 10 test results to /tmp/tmpy0ox5_tj/var/report.json
Writing Logfile to: /tmp/tmpy0ox5_tj/var/logs/buildtest_l2drk4md.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-22064509-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/09/28 19:49:51                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.6                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.17                                                   │
│ Configuration File: /tmp/tmpy0ox5_tj/config.yml                              │
│ Test Directory:     /tmp/tmpy0ox5_tj/var/tests                               │
│ Report File:        /tmp/tmpy0ox5_tj/var/report.json                         │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/tu ║
║ torials/tags_example.yml                                                     ║
╚══════════════════════════════════════════════════════════════════════════════╝
                           Buildspecs By Tag=network                            
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/tu ║
║ torials/tags_example.yml                                                     ║
╚══════════════════════════════════════════════════════════════════════════════╝


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.6/tutorials/tags_example.yml: VALID
Total builder objects created: 2
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃          ┃        ┃          ┃          ┃       ┃       ┃ descript ┃ buildsp ┃
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ ion      ┃ ecs     ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ string_t │ script │ generic. │ None     │ None  │ None  │ tags can │ /home/d │
│ ag/f994b │        │ local.ba │          │       │       │ be a     │ ocs/che │
│ d20      │        │ sh       │          │       │       │ string   │ ckouts/ │
│          │        │          │          │       │       │          │ readthe │
│          │        │          │          │       │       │          │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ tags_ex │
│          │        │          │          │       │       │          │ ample.y │
│          │        │          │          │       │       │          │ ml      │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ list_of_ │ script │ generic. │ None     │ None  │ None  │ tags can │ /home/d │
│ strings_ │        │ local.ba │          │       │       │ be a     │ ocs/che │
│ tags/8c2 │        │ sh       │          │       │       │ list of  │ ckouts/ │
│ 2be9e    │        │          │          │       │       │ strings  │ readthe │
│          │        │          │          │       │       │          │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.6/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ tags_ex │
│          │        │          │          │       │       │          │ ample.y │
│          │        │          │          │       │       │          │ ml      │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
string_tag/f994bd20: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/string_tag/f994bd20
string_tag/f994bd20: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/string_tag/f994bd20/stage
string_tag/f994bd20: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/string_tag/f994bd20/string_tag_build.sh
list_of_strings_tags/8c22be9e: Creating test directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/list_of_strings_tags/8c22be9e
list_of_strings_tags/8c22be9e: Creating the stage directory: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/list_of_strings_tags/8c22be9e/stage
list_of_strings_tags/8c22be9e: Writing build script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/list_of_strings_tags/8c22be9e/list_of_strings_tags_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
string_tag/f994bd20 does not have any dependencies adding test to queue
list_of_strings_tags/8c22be9e does not have any dependencies adding test to queue
    Builders Eligible to Run     
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder                       ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ string_tag/f994bd20           │
│ list_of_strings_tags/8c22be9e │
└───────────────────────────────┘
string_tag/f994bd20: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/string_tag/f994bd20/stage
string_tag/f994bd20: Running Test via command: bash --norc --noprofile -eo pipefail string_tag_build.sh
string_tag/f994bd20: Test completed in 0.006577 seconds
string_tag/f994bd20: Test completed with returncode: 0
string_tag/f994bd20: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/string_tag/f994bd20/string_tag.out
string_tag/f994bd20: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/string_tag/f994bd20/string_tag.err
list_of_strings_tags/8c22be9e: Current Working Directory : /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/list_of_strings_tags/8c22be9e/stage
list_of_strings_tags/8c22be9e: Running Test via command: bash --norc --noprofile -eo pipefail list_of_strings_tags_build.sh
list_of_strings_tags/8c22be9e: Test completed in 3.030027 seconds
list_of_strings_tags/8c22be9e: Test completed with returncode: 0
list_of_strings_tags/8c22be9e: Writing output file -  /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/list_of_strings_tags/8c22be9e/list_of_strings_tags.out
list_of_strings_tags/8c22be9e: Writing error file - /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/tags_example/list_of_strings_tags/8c22be9e/list_of_strings_tags.err
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ list_of_stri │ generic.loca │ PASS   │ None None     │ 0          │ 3.030027 │
│ ngs_tags/8c2 │ l.bash       │        │ None          │            │          │
│ 2be9e        │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ string_tag/f │ generic.loca │ PASS   │ None None     │ 0          │ 0.006577 │
│ 994bd20      │ l.bash       │        │ None          │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 2 test results to /tmp/tmpy0ox5_tj/var/report.json
Writing Logfile to: /tmp/tmpy0ox5_tj/var/logs/buildtest_oo5cyib2.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: /tmp/tmpy0ox5_tj/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                                ┃ id              ┃ tags                 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ list_of_strings_tags                │ 8c22be9e        │ network ping         │
├─────────────────────────────────────┼─────────────────┼──────────────────────┤
│ string_tag                          │ f994bd20        │ network              │
└─────────────────────────────────────┴─────────────────┴──────────────────────┘

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               ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ c4817e34-32a2-4499-9e71 │ variables_bash           │ /home/docs/checkouts/re │
│ -52ec76a89aa6           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/vars.yml │
│ bdd2ed29-5835-479c-a59b │ exit1_fail               │ /home/docs/checkouts/re │
│ -2117b0533dc2           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/pass_returncode.yml │
│ 662f91e5-26ec-449e-a018 │ returncode_list_mismatch │ /home/docs/checkouts/re │
│ -eff47a3d57f8           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/pass_returncode.yml │
│ d70e2993-f3e8-4663-8c48 │ returncode_int_match     │ /home/docs/checkouts/re │
│ -4fb4d147fd7b           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/pass_returncode.yml │
│ a5cc27e1-7625-47b9-94d9 │ exit1_pass               │ /home/docs/checkouts/re │
│ -4fe209eb18f5           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/pass_returncode.yml │
│ 1ca30651-5713-4aca-b167 │ status_regex_stderr_pass │ /home/docs/checkouts/re │
│ -9a10f2afb9b3           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/status_regex.yml    │
│ 23c160a3-001c-449d-844d │ status_regex_stderr_fail │ /home/docs/checkouts/re │
│ -de5eeb9ec6ba           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/status_regex.yml    │
│ f11eb876-b7d6-427c-b9cf │ status_regex_stdout_pass │ /home/docs/checkouts/re │
│ -2c161f1773f5           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/status_regex.yml    │
│ e12fa64a-3428-453f-bc62 │ status_regex_stdout_fail │ /home/docs/checkouts/re │
│ -b4084425e2bf           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/status_regex.yml    │
│ 2d08d204-c819-4a39-9345 │ regex_on_directory_not_s │ /home/docs/checkouts/re │
│ -ab2a7699361a           │ upported                 │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/regex_on_filename.y │
│                         │                          │ ml                      │
│ 6e2a2bf0-5c30-431b-9d27 │ file_expansion_supported │ /home/docs/checkouts/re │
│ -7d06cff5f22f           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/regex_on_filename.y │
│                         │                          │ ml                      │
│ 3c848a9f-06be-442c-b26a │ regex_on_multiple_files  │ /home/docs/checkouts/re │
│ -6c094875a44c           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/regex_on_filename.y │
│                         │                          │ ml                      │
│ d32143c6-224f-4287-b8e1 │ timelimit_max            │ /home/docs/checkouts/re │
│ -90d4f2e164a0           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/runtime_status_test │
│                         │                          │ .yml                    │
│ 6bbe695e-f62d-42d9-b3fb │ timelimit_min            │ /home/docs/checkouts/re │
│ -0c8064b71e75           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/runtime_status_test │
│                         │                          │ .yml                    │
│ d982bdda-9f13-4ca6-9ea9 │ timelimit_min_fail       │ /home/docs/checkouts/re │
│ -f64fe2c83196           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/runtime_status_test │
│                         │                          │ .yml                    │
│ 24fba77f-11fb-4c85-a7e9 │ timelimit_max_fail       │ /home/docs/checkouts/re │
│ -6b3f72dab9b8           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/runtime_status_test │
│                         │                          │ .yml                    │
│ b0573554-9686-4fd4-85f5 │ timelimit_min_max        │ /home/docs/checkouts/re │
│ -4cef2938cd3a           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/runtime_status_test │
│                         │                          │ .yml                    │
│ a214c3e2-b90e-4903-b38e │ always_fail              │ /home/docs/checkouts/re │
│ -4507ab311b39           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/explicit_state.yml  │
│ 15373b83-0430-46aa-bef1 │ test_pass_returncode_mis │ /home/docs/checkouts/re │
│ -f656d4643e26           │ match                    │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/explicit_state.yml  │
│ 8b1410eb-691b-4824-ae74 │ always_pass              │ /home/docs/checkouts/re │
│ -b9c2eaa3b6b5           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/explicit_state.yml  │
│ 67f855e0-75cb-4629-a83f │ test_fail_returncode_mat │ /home/docs/checkouts/re │
│ -94bbfafad996           │ ch                       │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/explicit_state.yml  │
│ cdb9abe6-1713-4db7-9b5d │ status_exists            │ /home/docs/checkouts/re │
│ -10b1b93bc897           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/exists.yml          │
│ 102804dc-812a-4d20-9385 │ status_exists_failure    │ /home/docs/checkouts/re │
│ -f0f1ca9ae2a1           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/exists.yml          │
│ e665dd0f-1ffb-44c0-8dc2 │ file_exists_pass         │ /home/docs/checkouts/re │
│ -7fd8b23ee1b1           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_exists_with_nu │
│                         │                          │ mber.yml                │
│ d31c02bc-432d-4496-a403 │ file_and_dir_checks      │ /home/docs/checkouts/re │
│ -60b97d731ffd           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_and_dir_check. │
│                         │                          │ yml                     │
│ 7f29fe2d-975d-498d-8629 │ combined_file_and_dir_ch │ /home/docs/checkouts/re │
│ -c1be3d91b7b5           │ ecks                     │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_and_dir_check. │
│                         │                          │ yml                     │
│ 5592fd2d-7bfb-4401-90b4 │ symlink_test             │ /home/docs/checkouts/re │
│ -232ec88dc9bf           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/is_symlink.yml      │
│ 67aaf162-c42f-4623-bf36 │ file_count_on_directory  │ /home/docs/checkouts/re │
│ -707e1f08f6e0           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_count.yml      │
│ 1e4f9220-d3aa-4759-aef4 │ file_count_by_extension  │ /home/docs/checkouts/re │
│ -f97830bc2ce0           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_count.yml      │
│ 4b1c390e-be06-489b-bf56 │ file_extension_and_filep │ /home/docs/checkouts/re │
│ -b1ca6bd98571           │ attern                   │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_count_pattern. │
│                         │                          │ yml                     │
│ 967b97ea-d03f-4eee-891b │ file_count_by_expression │ /home/docs/checkouts/re │
│ -88d18b1c0a2d           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_count_pattern. │
│                         │                          │ yml                     │
│ 098cde3e-9266-4952-b772 │ file_count_by_filetype   │ /home/docs/checkouts/re │
│ -83c8dece5924           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_count_filetype │
│                         │                          │ .yml                    │
│ ebb85efe-b1eb-4ec5-9b9d │ file_traverse_limit      │ /home/docs/checkouts/re │
│ -8572a423caae           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/file_count_file_tra │
│                         │                          │ verse_limit.yml         │
│ 325afb6b-dcbe-4886-a6ce │ status_logical_and       │ /home/docs/checkouts/re │
│ -a971c7043b1e           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/mode.yml            │
│ f09659f2-a540-483f-844e │ status_logical_or        │ /home/docs/checkouts/re │
│ -b70119996100           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/test_sta │
│                         │                          │ tus/mode.yml            │
│ b3b2e6b9-6912-49a2-8771 │ unskipped                │ /home/docs/checkouts/re │
│ -3222e5c4b89e           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/skip_tes │
│                         │                          │ ts.yml                  │
│ ee3d9fcf-2f97-4b3d-86c7 │ hello_world              │ /home/docs/checkouts/re │
│ -9ba96f727f39           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/hello_wo │
│                         │                          │ rld.yml                 │
│ 87881b8a-91eb-4cb7-a3d4 │ hello_world              │ /home/docs/checkouts/re │
│ -44317aff2409           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/hello_wo │
│                         │                          │ rld.yml                 │
│ 874b6f21-7aa3-4f9e-8bb1 │ ulimit_filedescriptor_40 │ /home/docs/checkouts/re │
│ -82f09fc9a354           │ 96                       │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/ulimits.yml   │
│ c30d85f7-788d-405f-a0f2 │ ulimit_vmsize_unlimited  │ /home/docs/checkouts/re │
│ -7f1f78c853a9           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/ulimits.yml   │
│ 5f2b88ad-8862-41bb-9e18 │ ulimit_filelock_unlimite │ /home/docs/checkouts/re │
│ -b7b6f9fe9b7d           │ d                        │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/ulimits.yml   │
│ e11eccd3-6305-4c13-bed6 │ ulimit_max_user_process_ │ /home/docs/checkouts/re │
│ -7d5d3a7dec24           │ 2048                     │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/ulimits.yml   │
│ f42f0d6d-0567-431f-b8d1 │ ulimit_stacksize_unlimit │ /home/docs/checkouts/re │
│ -daf54eb81eab           │ ed                       │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/ulimits.yml   │
│ f9335bb3-fb54-4e3c-bb36 │ ulimit_cputime_unlimited │ /home/docs/checkouts/re │
│ -d9f0c6b78ae1           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/ulimits.yml   │
│ beac1ee8-fd5a-4393-adf6 │ kernel_swapusage         │ /home/docs/checkouts/re │
│ -bfa9f13c1dc3           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/kernel_state. │
│                         │                          │ yml                     │
│ 087e4fd4-f06f-4e31-9484 │ root_disk_usage          │ /home/docs/checkouts/re │
│ -eeaba59af82b           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/disk_usage.ym │
│                         │                          │ l                       │
│ 0c6e0c8e-afca-4b41-8fef │ systemd_default_target   │ /home/docs/checkouts/re │
│ -f1c4f4ad66b4           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/general_tests/conf │
│                         │                          │ iguration/systemd-defau │
│                         │                          │ lt-target.yml           │
│ 8c22be9e-9a44-413d-bb80 │ list_of_strings_tags     │ /home/docs/checkouts/re │
│ -9d8aca1a7eaf           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/tags_exa │
│                         │                          │ mple.yml                │
│ f994bd20-a0ad-46b3-86c6 │ string_tag               │ /home/docs/checkouts/re │
│ -142c61819199           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ v1.6/tutorials/tags_exa │
│                         │                          │ mple.yml                │
└─────────────────────────┴──────────────────────────┴─────────────────────────┘

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 -t hello_world
$ buildtest it query -o -e -t hello_world
─────────────── hello_world/87881b8a-91eb-4cb7-a3d4-44317aff2409 ───────────────
Executor: generic.local.bash
Description: hello world example
State: PASS
Returncode: 0
Runtime: 0.006442 sec
Starttime: 2023/09/28 19:49:50
Endtime: 2023/09/28 19:49:50
Command: bash --norc --noprofile -eo pipefail hello_world_build.sh
Test Script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/hello_world.sh
Build Script: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/hello_world_build.sh
Output File: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/hello_world.out
Error File: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_world/87881b8a/hello_world.err
Log File: /tmp/tmpy0ox5_tj/var/logs/buildtest_l2drk4md.log
─ Output File: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hell… ─
hello world!                                                                    
                                                                                
─ Error File: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello… ─
                                                                                
─ Test File: /tmp/tmpy0ox5_tj/var/tests/generic.local.bash/hello_world/hello_… ─
#!/usr/bin/bash                                                                 
set -eo pipefail                                                                
# 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.6/t… ─
"[/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.6/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
───────────────────────── /tmp/tmpy0ox5_tj/config.yml ──────────────────────────
   1 system:
   2   generic:
   3     # specify a list of hostnames that is a regular expression where buildtest can run.
   4     hostnames: ['.*']
   5     # system description
   6     description: Generic System
   7     # specify module system to use. Supported module systems are lmod, environment-modules or set to N/A if not available
   8     moduletool: N/A
   9 
  10     # specify size of job pool (https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool). This will configure the number of processes that can run in parallel.
  11     # If not specified then buildtest will use all available cores on the system.
  12     poolsize: 1
  13 
  14     # maximum number of jobs that can run in parallel. If not specified, buildtest will run all jobs in parallel.
  15     #max_jobs: 1
  16 
  17     # test timeout in number of seconds
  18     # timeout: 3600
  19 
  20     # enable pagination for buildtest
  21     pager: false
  22 
  23     # options for buildtest buildspec find command
  24     buildspecs:
  25       # determine whether to rebuild buildspec cache
  26       rebuild: false
  27       # determine number of records to display
  28       count: 15
  29       # specify format fields
  30       format: name,description
  31       # display output in terse mode
  32       terse: false
  33 
  34     # options for buildtest report command
  35     report:
  36       # number of records to display
  37       count: 25
  38       # display output in terse mode
  39       terse: false
  40       # specify format fields
  41       format: name,id,state,runtime,returncode
  42       # show latest test run
  43       latest: false
  44       # show oldest test run
  45       oldest: false
  46 
  47     executors:
  48       local:
  49         bash:
  50           description: submit jobs on local machine using bash shell
  51           shell: bash
  52         sh:
  53           description: submit jobs on local machine using sh shell
  54           shell: sh
  55         csh:
  56           description: submit jobs on local machine using csh shell
  57           shell: csh
  58         zsh:
  59           description: submit jobs on local machine using zsh shell
  60           shell: zsh
  61     compilers:
  62       compiler:
  63         gcc:
  64           builtin_gcc:
  65             cc: gcc
  66             fc: gfortran
  67             cxx: g++
  68     # specify CDASH configuration when using 'buildtest cdash upload'
  69     cdash:
  70       # CDASH server
  71       url: https://my.cdash.org/
  72       # name of CDASH project where to push test reports
  73       project: buildtest
  74       # specify the site name which should generally by name of your HPC system. This is used by CDASH to group test results by site
  75       site: generic
  76       # specify the build name which is used to group test results by build name
  77       buildname: tutorials
  78

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 list
$ buildtest cg executors list
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 list --json
$ buildtest cg executors list --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 list --yaml
$ buildtest cg executors list --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