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-19845526-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/03/20 22:58:11                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.3                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.7.15                                                   │
│ Configuration File: /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Test Directory:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Report File:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
╚══════════════════════════════════════════════════════════════════════════════╝


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



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


Adding 1 test results to /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/report.json
Writing Logfile to: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/logs/buildtest_21tbnc7x.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-19845526-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/03/20 22:58:12                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.3                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.7.15                                                   │
│ Configuration File: /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Test Directory:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Report File:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
╚══════════════════════════════════════════════════════════════════════════════╝


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/latest/general_tests/configuration/systemd-default-target.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/general_tests/configuration/disk_usage.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/general_tests/configuration/ulimits.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/general_tests/configuration/kernel_state.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/tutorials/hello_world.yml: VALID
Total builder objects created: 10
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ systemd… │ script │ generic… │ None     │ None  │ None  │ check if │ /home/… │
│          │        │          │          │       │       │ default  │         │
│          │        │          │          │       │       │ target   │         │
│          │        │          │          │       │       │ is       │         │
│          │        │          │          │       │       │ multi-u… │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ root_di… │ script │ generic… │ None     │ None  │ None  │ Check    │ /home/… │
│          │        │          │          │       │       │ root     │         │
│          │        │          │          │       │       │ disk     │         │
│          │        │          │          │       │       │ usage    │         │
│          │        │          │          │       │       │ and      │         │
│          │        │          │          │       │       │ report   │         │
│          │        │          │          │       │       │ if it    │         │
│          │        │          │          │       │       │ exceeds  │         │
│          │        │          │          │       │       │ thresho… │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ file     │         │
│          │        │          │          │       │       │ lock is  │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ unlimit… │         │
│          │        │          │          │       │       │ in       │         │
│          │        │          │          │       │       │ ulimits  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ cputime  │         │
│          │        │          │          │       │       │ is set   │         │
│          │        │          │          │       │       │ to       │         │
│          │        │          │          │       │       │ unlimit… │         │
│          │        │          │          │       │       │ in       │         │
│          │        │          │          │       │       │ ulimits  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ stack    │         │
│          │        │          │          │       │       │ size is  │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ unlimit… │         │
│          │        │          │          │       │       │ in       │         │
│          │        │          │          │       │       │ ulimits  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check    │ /home/… │
│          │        │          │          │       │       │ virtual  │         │
│          │        │          │          │       │       │ memory   │         │
│          │        │          │          │       │       │ size and │         │
│          │        │          │          │       │       │ check if │         │
│          │        │          │          │       │       │ its set  │         │
│          │        │          │          │       │       │ to       │         │
│          │        │          │          │       │       │ unlimit… │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check if │ /home/… │
│          │        │          │          │       │       │ open     │         │
│          │        │          │          │       │       │ file     │         │
│          │        │          │          │       │       │ descrip… │         │
│          │        │          │          │       │       │ limit is │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ 4096     │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ ulimit_… │ script │ generic… │ None     │ None  │ None  │ Check    │ /home/… │
│          │        │          │          │       │       │ max      │         │
│          │        │          │          │       │       │ number   │         │
│          │        │          │          │       │       │ of user  │         │
│          │        │          │          │       │       │ process  │         │
│          │        │          │          │       │       │ limit is │         │
│          │        │          │          │       │       │ set to   │         │
│          │        │          │          │       │       │ 2048     │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ kernel_… │ script │ generic… │ None     │ None  │ None  │ Retrieve │ /home/… │
│          │        │          │          │       │       │ Kernel   │         │
│          │        │          │          │       │       │ Swap     │         │
│          │        │          │          │       │       │ Usage    │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ hello_w… │ script │ generic… │ None     │ None  │ None  │ hello    │ /home/… │
│          │        │          │          │       │       │ world    │         │
│          │        │          │          │       │       │ example  │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
systemd_default_target/325ff7d8: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/325ff7d8
systemd_default_target/325ff7d8: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/325ff7d8/stage
systemd_default_target/325ff7d8: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/325ff7d8/systemd_default_target_build.sh
root_disk_usage/27adea3f: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/disk_usage/root_disk_usage/27adea3f
root_disk_usage/27adea3f: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/disk_usage/root_disk_usage/27adea3f/stage
root_disk_usage/27adea3f: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/disk_usage/root_disk_usage/27adea3f/root_disk_usage_build.sh
ulimit_filelock_unlimited/35a21bdb: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/35a21bdb
ulimit_filelock_unlimited/35a21bdb: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/35a21bdb/stage
ulimit_filelock_unlimited/35a21bdb: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/35a21bdb/ulimit_filelock_unlimited_build.sh
ulimit_cputime_unlimited/630644ba: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/630644ba
ulimit_cputime_unlimited/630644ba: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/630644ba/stage
ulimit_cputime_unlimited/630644ba: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/630644ba/ulimit_cputime_unlimited_build.sh
ulimit_stacksize_unlimited/35c59bff: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/35c59bff
ulimit_stacksize_unlimited/35c59bff: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/35c59bff/stage
ulimit_stacksize_unlimited/35c59bff: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/35c59bff/ulimit_stacksize_unlimited_build.sh
ulimit_vmsize_unlimited/47254d24: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/47254d24
ulimit_vmsize_unlimited/47254d24: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/47254d24/stage
ulimit_vmsize_unlimited/47254d24: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/47254d24/ulimit_vmsize_unlimited_build.sh
ulimit_filedescriptor_4096/583f7572: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/583f7572
ulimit_filedescriptor_4096/583f7572: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/583f7572/stage
ulimit_filedescriptor_4096/583f7572: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/583f7572/ulimit_filedescriptor_4096_build.sh
ulimit_max_user_process_2048/1d2d9f47: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1d2d9f47
ulimit_max_user_process_2048/1d2d9f47: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1d2d9f47/stage
ulimit_max_user_process_2048/1d2d9f47: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1d2d9f47/ulimit_max_user_process_2048_build.sh
kernel_swapusage/81fbac5c: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/kernel_state/kernel_swapusage/81fbac5c
kernel_swapusage/81fbac5c: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/kernel_state/kernel_swapusage/81fbac5c/stage
kernel_swapusage/81fbac5c: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/kernel_state/kernel_swapusage/81fbac5c/kernel_swapusage_build.sh
hello_world/91186bff: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff
hello_world/91186bff: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/stage
hello_world/91186bff: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/hello_world_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
kernel_swapusage/81fbac5c does not have any dependencies adding test to queue
root_disk_usage/27adea3f does not have any dependencies adding test to queue
ulimit_max_user_process_2048/1d2d9f47 does not have any dependencies adding test to queue
ulimit_stacksize_unlimited/35c59bff does not have any dependencies adding test to queue
ulimit_vmsize_unlimited/47254d24 does not have any dependencies adding test to queue
ulimit_filedescriptor_4096/583f7572 does not have any dependencies adding test to queue
hello_world/91186bff does not have any dependencies adding test to queue
systemd_default_target/325ff7d8 does not have any dependencies adding test to queue
ulimit_filelock_unlimited/35a21bdb does not have any dependencies adding test to queue
ulimit_cputime_unlimited/630644ba does not have any dependencies adding test to queue
kernel_swapusage/81fbac5c: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/kernel_state/kernel_swapusage/81fbac5c/stage
kernel_swapusage/81fbac5c: Running Test via command: bash --norc --noprofile -eo pipefail kernel_swapusage_build.sh
kernel_swapusage/81fbac5c: Test completed in 0.007188 seconds
kernel_swapusage/81fbac5c: Test completed with returncode: 255
kernel_swapusage/81fbac5c: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/kernel_state/kernel_swapusage/81fbac5c/kernel_swapusage.out
kernel_swapusage/81fbac5c: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/kernel_state/kernel_swapusage/81fbac5c/kernel_swapusage.err
ulimit_max_user_process_2048/1d2d9f47: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1d2d9f47/stage
ulimit_max_user_process_2048/1d2d9f47: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_max_user_process_2048_build.sh
ulimit_max_user_process_2048/1d2d9f47: Test completed in 0.005334 seconds
ulimit_max_user_process_2048/1d2d9f47: Test completed with returncode: 0
ulimit_max_user_process_2048/1d2d9f47: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1d2d9f47/ulimit_max_user_process_2048.out
ulimit_max_user_process_2048/1d2d9f47: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1d2d9f47/ulimit_max_user_process_2048.err
ulimit_max_user_process_2048/1d2d9f47: performing regular expression - '^2048$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1d2d9f47/ulimit_max_user_process_2048.out
ulimit_max_user_process_2048/1d2d9f47: Regular Expression Match - Failed!
root_disk_usage/27adea3f: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/disk_usage/root_disk_usage/27adea3f/stage
root_disk_usage/27adea3f: Running Test via command: bash --norc --noprofile -eo pipefail root_disk_usage_build.sh
root_disk_usage/27adea3f: Test completed in 0.008963 seconds
root_disk_usage/27adea3f: Test completed with returncode: 0
root_disk_usage/27adea3f: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/disk_usage/root_disk_usage/27adea3f/root_disk_usage.out
root_disk_usage/27adea3f: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/disk_usage/root_disk_usage/27adea3f/root_disk_usage.err
systemd_default_target/325ff7d8: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/325ff7d8/stage
systemd_default_target/325ff7d8: Running Test via command: bash --norc --noprofile -eo pipefail systemd_default_target_build.sh
systemd_default_target/325ff7d8: Test completed in 0.012439 seconds
systemd_default_target/325ff7d8: Test completed with returncode: 1
systemd_default_target/325ff7d8: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/325ff7d8/systemd_default_target.out
systemd_default_target/325ff7d8: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/325ff7d8/systemd_default_target.err
ulimit_stacksize_unlimited/35c59bff: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/35c59bff/stage
ulimit_stacksize_unlimited/35c59bff: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_stacksize_unlimited_build.sh
ulimit_stacksize_unlimited/35c59bff: Test completed in 0.005307 seconds
ulimit_stacksize_unlimited/35c59bff: Test completed with returncode: 0
ulimit_stacksize_unlimited/35c59bff: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/35c59bff/ulimit_stacksize_unlimited.out
ulimit_stacksize_unlimited/35c59bff: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/35c59bff/ulimit_stacksize_unlimited.err
ulimit_stacksize_unlimited/35c59bff: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/35c59bff/ulimit_stacksize_unlimited.out
ulimit_stacksize_unlimited/35c59bff: Regular Expression Match - Failed!
ulimit_vmsize_unlimited/47254d24: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/47254d24/stage
ulimit_vmsize_unlimited/47254d24: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_vmsize_unlimited_build.sh
ulimit_vmsize_unlimited/47254d24: Test completed in 0.005452 seconds
ulimit_vmsize_unlimited/47254d24: Test completed with returncode: 0
ulimit_vmsize_unlimited/47254d24: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/47254d24/ulimit_vmsize_unlimited.out
ulimit_vmsize_unlimited/47254d24: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/47254d24/ulimit_vmsize_unlimited.err
ulimit_vmsize_unlimited/47254d24: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/47254d24/ulimit_vmsize_unlimited.out
ulimit_vmsize_unlimited/47254d24: Regular Expression Match - Success!
ulimit_filedescriptor_4096/583f7572: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/583f7572/stage
ulimit_filedescriptor_4096/583f7572: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_filedescriptor_4096_build.sh
ulimit_filedescriptor_4096/583f7572: Test completed in 0.005536 seconds
ulimit_filedescriptor_4096/583f7572: Test completed with returncode: 0
ulimit_filedescriptor_4096/583f7572: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/583f7572/ulimit_filedescriptor_4096.out
ulimit_filedescriptor_4096/583f7572: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/583f7572/ulimit_filedescriptor_4096.err
ulimit_filedescriptor_4096/583f7572: performing regular expression - '^4096$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/583f7572/ulimit_filedescriptor_4096.out
ulimit_filedescriptor_4096/583f7572: Regular Expression Match - Failed!
hello_world/91186bff: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/stage
hello_world/91186bff: Running Test via command: bash --norc --noprofile -eo pipefail hello_world_build.sh
hello_world/91186bff: Test completed in 0.005741 seconds
hello_world/91186bff: Test completed with returncode: 0
hello_world/91186bff: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/hello_world.out
hello_world/91186bff: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/hello_world.err
ulimit_cputime_unlimited/630644ba: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/630644ba/stage
ulimit_cputime_unlimited/630644ba: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_cputime_unlimited_build.sh
ulimit_cputime_unlimited/630644ba: Test completed in 0.005668 seconds
ulimit_cputime_unlimited/630644ba: Test completed with returncode: 0
ulimit_cputime_unlimited/630644ba: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/630644ba/ulimit_cputime_unlimited.out
ulimit_cputime_unlimited/630644ba: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/630644ba/ulimit_cputime_unlimited.err
ulimit_cputime_unlimited/630644ba: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/630644ba/ulimit_cputime_unlimited.out
ulimit_cputime_unlimited/630644ba: Regular Expression Match - Success!
ulimit_filelock_unlimited/35a21bdb: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/35a21bdb/stage
ulimit_filelock_unlimited/35a21bdb: Running Test via command: bash --norc --noprofile -eo pipefail ulimit_filelock_unlimited_build.sh
ulimit_filelock_unlimited/35a21bdb: Test completed in 0.006545 seconds
ulimit_filelock_unlimited/35a21bdb: Test completed with returncode: 0
ulimit_filelock_unlimited/35a21bdb: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/35a21bdb/ulimit_filelock_unlimited.out
ulimit_filelock_unlimited/35a21bdb: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/35a21bdb/ulimit_filelock_unlimited.err
ulimit_filelock_unlimited/35a21bdb: performing regular expression - '^unlimited$' on file: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/35a21bdb/ulimit_filelock_unlimited.out
ulimit_filelock_unlimited/35a21bdb: Regular Expression Match - Success!
In this iteration we are going to run the following tests: [kernel_swapusage/81fbac5c, ulimit_max_user_process_2048/1d2d9f47, root_disk_usage/27adea3f, systemd_default_target/325ff7d8, ulimit_stacksize_unlimited/35c59bff, ulimit_vmsize_unlimited/47254d24, ulimit_filedescriptor_4096/583f7572, hello_world/91186bff, ulimit_cputime_unlimited/630644ba, ulimit_filelock_unlimited/35a21bdb]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ systemd_defa │ generic.loc… │ FAIL   │ N/A N/A N/A   │ 1          │ 0.012439 │
│ ult_target/3 │              │        │               │            │          │
│ 25ff7d8      │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ kernel_swapu │ generic.loc… │ FAIL   │ N/A N/A N/A   │ 255        │ 0.007188 │
│ sage/81fbac5 │              │        │               │            │          │
│ c            │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_max_u │ generic.loc… │ FAIL   │ False False   │ 0          │ 0.005334 │
│ ser_process_ │              │        │ False         │            │          │
│ 2048/1d2d9f4 │              │        │               │            │          │
│ 7            │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_filed │ generic.loc… │ FAIL   │ False False   │ 0          │ 0.005536 │
│ escriptor_40 │              │        │ False         │            │          │
│ 96/583f7572  │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ hello_world/ │ generic.loc… │ PASS   │ N/A N/A N/A   │ 0          │ 0.005741 │
│ 91186bff     │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_cputi │ generic.loc… │ PASS   │ False True    │ 0          │ 0.005668 │
│ me_unlimited │              │        │ False         │            │          │
│ /630644ba    │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_filel │ generic.loc… │ PASS   │ False True    │ 0          │ 0.006545 │
│ ock_unlimite │              │        │ False         │            │          │
│ d/35a21bdb   │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ root_disk_us │ generic.loc… │ PASS   │ N/A N/A N/A   │ 0          │ 0.008963 │
│ age/27adea3f │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_stack │ generic.loc… │ FAIL   │ False False   │ 0          │ 0.005307 │
│ size_unlimit │              │        │ False         │            │          │
│ ed/35c59bff  │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ ulimit_vmsiz │ generic.loc… │ PASS   │ False True    │ 0          │ 0.005452 │
│ e_unlimited/ │              │        │ False         │            │          │
│ 47254d24     │              │        │               │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 10 test results to /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/report.json
Writing Logfile to: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/logs/buildtest_g_9omx4n.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 python
$ buildtest build -t python
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-19845526-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/03/20 22:58:13                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.3                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.7.15                                                   │
│ Configuration File: /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Test Directory:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Report File:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
╚══════════════════════════════════════════════════════════════════════════════╝
                            Buildspecs By Tag=python                            
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  2
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  2
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 2
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/tutorials/python-hello.yml: VALID
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/tutorials/python-shell.yml: VALID
Total builder objects created: 2
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ python_… │ script │ generic… │ None     │ None  │ None  │ Hello    │ /home/… │
│          │        │          │          │       │       │ World    │         │
│          │        │          │          │       │       │ python   │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ circle_… │ script │ generic… │ None     │ None  │ None  │ Calcula… │ /home/… │
│          │        │          │          │       │       │ circle   │         │
│          │        │          │          │       │       │ of area  │         │
│          │        │          │          │       │       │ given a  │         │
│          │        │          │          │       │       │ radius   │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
python_hello/1f40a55d: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-hello/python_hello/1f40a55d
python_hello/1f40a55d: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-hello/python_hello/1f40a55d/stage
python_hello/1f40a55d: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-hello/python_hello/1f40a55d/python_hello_build.sh
circle_area/cbb45979: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-shell/circle_area/cbb45979
circle_area/cbb45979: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-shell/circle_area/cbb45979/stage
circle_area/cbb45979: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-shell/circle_area/cbb45979/circle_area_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
python_hello/1f40a55d does not have any dependencies adding test to queue
circle_area/cbb45979 does not have any dependencies adding test to queue
python_hello/1f40a55d: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-hello/python_hello/1f40a55d/stage
python_hello/1f40a55d: Running Test via command: bash --norc --noprofile -eo pipefail python_hello_build.sh
python_hello/1f40a55d: Test completed in 0.031115 seconds
python_hello/1f40a55d: Test completed with returncode: 0
python_hello/1f40a55d: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-hello/python_hello/1f40a55d/python_hello.out
python_hello/1f40a55d: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-hello/python_hello/1f40a55d/python_hello.err
circle_area/cbb45979: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-shell/circle_area/cbb45979/stage
circle_area/cbb45979: Running Test via command: bash --norc --noprofile -eo pipefail circle_area_build.sh
circle_area/cbb45979: Test completed in 0.030846 seconds
circle_area/cbb45979: Test completed with returncode: 0
circle_area/cbb45979: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-shell/circle_area/cbb45979/circle_area.out
circle_area/cbb45979: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/python-shell/circle_area/cbb45979/circle_area.err
In this iteration we are going to run the following tests: [python_hello/1f40a55d, circle_area/cbb45979]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ circle_area/ │ generic.loc… │ PASS   │ N/A N/A N/A   │ 0          │ 0.030846 │
│ cbb45979     │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ python_hello │ generic.loc… │ PASS   │ N/A N/A N/A   │ 0          │ 0.031115 │
│ /1f40a55d    │              │        │               │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 2 test results to /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/report.json
Writing Logfile to: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/logs/buildtest_hvxgec5w.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=python --format name,id,tags
$ buildtest rt --filter tags=python --format name,id,tags
Report File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/report.json
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                     ┃ id               ┃ tags                           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ circle_area              │ cbb45979         │ tutorials python               │
├──────────────────────────┼──────────────────┼────────────────────────────────┤
│ python_hello             │ 1f40a55d         │ python                         │
└──────────────────────────┴──────────────────┴────────────────────────────────┘

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 name, id, buildspec                       
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ id                      ┃ name                     ┃ buildspec               ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ce7cb60e-0d4b-4f01-996… │ variables_bash           │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/vars.y │
│                         │                          │ ml                      │
│ 7945840a-35de-4368-875… │ exit1_pass               │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/pass_returncode.y │
│                         │                          │ ml                      │
│ 5aa3c304-b099-40c8-ae9… │ returncode_list_mismatch │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/pass_returncode.y │
│                         │                          │ ml                      │
│ c1e5818a-23ac-4aa9-a7a… │ exit1_fail               │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/pass_returncode.y │
│                         │                          │ ml                      │
│ ca24a585-d720-4974-b9c… │ returncode_int_match     │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/pass_returncode.y │
│                         │                          │ ml                      │
│ ffa4be84-8975-44fd-816… │ status_regex_fail        │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/status_regex.yml  │
│ fe59448d-e9a3-4a43-bcf… │ status_regex_pass        │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/status_regex.yml  │
│ 317e1d5e-473f-4ddb-8cb… │ regex_on_multiple_files  │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/regex_on_filename │
│                         │                          │ .yml                    │
│ d99d0345-a5ca-4456-ace… │ file_expansion_supported │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/regex_on_filename │
│                         │                          │ .yml                    │
│ ef90b10c-9e12-425a-b68… │ regex_on_directory_not_… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/regex_on_filename │
│                         │                          │ .yml                    │
│ f79c3ad2-b350-4599-8c0… │ timelimit_max            │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/runtime_status_te │
│                         │                          │ st.yml                  │
│ bb44b7c8-533d-4db1-90f… │ timelimit_min_max        │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/runtime_status_te │
│                         │                          │ st.yml                  │
│ fac1030a-ca44-4d1e-a83… │ timelimit_min_fail       │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/runtime_status_te │
│                         │                          │ st.yml                  │
│ c51af5d4-366c-4e7d-96e… │ timelimit_max_fail       │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/runtime_status_te │
│                         │                          │ st.yml                  │
│ 1593fbf5-bb6a-4bcc-977… │ timelimit_min            │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/runtime_status_te │
│                         │                          │ st.yml                  │
│ 171debe0-59c1-4052-9ec… │ test_pass_returncode_mi… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/explicit_state.ym │
│                         │                          │ l                       │
│ bc5f8ea4-53ab-472e-adb… │ always_pass              │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/explicit_state.ym │
│                         │                          │ l                       │
│ 4a988435-5a51-4c23-84c… │ always_fail              │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/explicit_state.ym │
│                         │                          │ l                       │
│ 36c4d7dd-d95a-4f3b-8fb… │ test_fail_returncode_ma… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/explicit_state.ym │
│                         │                          │ l                       │
│ 4f3bb225-480e-4c0e-888… │ status_exists_failure    │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/exists.yml        │
│ 4a03d53c-db35-48ef-b7c… │ status_exists            │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/exists.yml        │
│ b16535a1-2a08-4b19-922… │ file_exists_pass         │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_exists_with_ │
│                         │                          │ number.yml              │
│ 232759a6-a45e-40ec-8c4… │ combined_file_and_dir_c… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_and_dir_chec │
│                         │                          │ k.yml                   │
│ 213eaf95-3501-40fa-a73… │ file_and_dir_checks      │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_and_dir_chec │
│                         │                          │ k.yml                   │
│ 962da21f-5e2f-461b-a1d… │ symlink_test             │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/is_symlink.yml    │
│ 20056936-9d21-41f3-85a… │ file_count_by_extension  │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_count.yml    │
│ 660149b0-5639-4ddf-b62… │ file_count_on_directory  │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_count.yml    │
│ 99009e6c-62be-4f30-8e0… │ file_extension_and_file… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_count_patter │
│                         │                          │ n.yml                   │
│ e7d7d676-5024-4aba-947… │ file_count_by_expression │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_count_patter │
│                         │                          │ n.yml                   │
│ 2102b32b-eb32-4189-aaf… │ file_count_by_filetype   │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_count_filety │
│                         │                          │ pe.yml                  │
│ b0335d1c-5cf0-4f40-b47… │ file_traverse_limit      │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/test_s │
│                         │                          │ tatus/file_count_file_t │
│                         │                          │ raverse_limit.yml       │
│ a374709a-08b6-4c8b-886… │ unskipped                │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/skip_t │
│                         │                          │ ests.yml                │
│ df110b6c-1b78-44e4-82d… │ hello_world              │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/hello_ │
│                         │                          │ world.yml               │
│ 91186bff-ed11-46f1-b23… │ hello_world              │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/hello_ │
│                         │                          │ world.yml               │
│ 325ff7d8-938e-405d-ba1… │ systemd_default_target   │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/systemd-def │
│                         │                          │ ault-target.yml         │
│ 81fbac5c-8577-4ab4-b0d… │ kernel_swapusage         │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/kernel_stat │
│                         │                          │ e.yml                   │
│ 1d2d9f47-927b-4bed-83a… │ ulimit_max_user_process… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/ulimits.yml │
│ 583f7572-7007-4335-b85… │ ulimit_filedescriptor_4… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/ulimits.yml │
│ 630644ba-bb6c-478c-b26… │ ulimit_cputime_unlimited │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/ulimits.yml │
│ 35a21bdb-c536-4b2d-8c0… │ ulimit_filelock_unlimit… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/ulimits.yml │
│ 35c59bff-d4a1-4e1d-8b3… │ ulimit_stacksize_unlimi… │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/ulimits.yml │
│ 47254d24-858c-481e-8e5… │ ulimit_vmsize_unlimited  │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/ulimits.yml │
│ 27adea3f-6b46-4da0-a58… │ root_disk_usage          │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/general_tests/co │
│                         │                          │ nfiguration/disk_usage. │
│                         │                          │ yml                     │
│ cbb45979-77a6-4084-80a… │ circle_area              │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/python │
│                         │                          │ -shell.yml              │
│ 1f40a55d-0f3d-414e-805… │ python_hello             │ /home/docs/checkouts/re │
│                         │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ latest/tutorials/python │
│                         │                          │ -hello.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/91186bff-ed11-46f1-b238-dcada6fc7ddc ───────────────
Executor: generic.local.bash
Description: hello world example
State: PASS
Returncode: 0
Runtime: 0.005741 sec
Starttime: 2023/03/20 22:58:12
Endtime: 2023/03/20 22:58:12
Command: bash --norc --noprofile -eo pipefail hello_world_build.sh
Test Script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/hello_world.sh
Build Script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/hello_world_build.sh
Output File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/hello_world.out
Error File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/tests/generic.local.bash/hello_world/hello_world/91186bff/hello_world.err
Log File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/var/logs/buildtest_g_9omx4n.log
─ Output File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/che… ─
hello world!                                                                    
                                                                                
─ Error File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/chec… ─
                                                                                
─ Test File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/check… ─
#!/usr/bin/bash                                                                 
# Content of run section                                                        
echo "hello world!"

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

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

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

Interacting with Buildspecs

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

The buildtest help 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 help buildspec
$ buildtest help 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                             │
└───────────────────────────────────────┴──────────────────────────────────────┘
                             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  │
│ --list                                │ cache                                │
│ buildtest buildspec maintainers       │ List all maintainers in machine      │
│ --list --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/latest… ─
"[/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest/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 -t <THEME> can be used select a color theme.

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

   buildtest bc show -t
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 -t 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.

Buildtest Configuration

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

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

buildtest config path

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

buildtest cg view
$ buildtest cg view
─ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/latest… ─
   1 system:
   2   generic:
   3     # specify list of hostnames where buildtest can run for given system record
   4     hostnames: [".*"]
   5 
   6     # system description
   7     description: Generic System
   8     # specify module system used at your site (environment-modules, lmod)
   9     moduletool: N/A
  10 
  11     # specify test timeout duration in number of seconds
  12     # timeout: 60
  13 
  14     # pool size for parallel processing using multiprocessing.Pool. Pool Size must be 1 or higher. The pool size is calculated as follows: poolsize = min(poolsize, os.cpu_count())
  15     poolsize: 1
  16 
  17     executors:
  18       # define local executors for running jobs locally
  19       local:
  20         bash:
  21           description: submit jobs on local machine using bash shell
  22           shell: bash
  23         sh:
  24           description: submit jobs on local machine using sh shell
  25           shell: sh
  26         csh:
  27           description: submit jobs on local machine using csh shell
  28           shell: csh
  29         zsh:
  30           description: submit jobs on local machine using zsh shell
  31           shell: zsh
  32     # compiler block
  33     compilers:
  34       # a list of directories to search for modules
  35       # modulepath: ['/tmp', '/var/']
  36 
  37       # regular expression to search for compilers based on module pattern. Used with 'buildtest config compilers find' to generate compiler instance
  38       # find:
  39       #  gcc: "^(gcc)"
  40       #  intel: "^(intel)"
  41       #  cray: "^(craype)"
  42       #  pgi: "^(pgi)"
  43       #  cuda: ^(cuda)"
  44       #  clang: "^(clang)"
  45 
  46       # declare compiler instance which can be site-specific. You can let 'buildtest config compilers find' generate compiler section
  47       compiler:
  48         gcc:
  49           builtin_gcc:
  50             cc: gcc
  51             fc: gfortran
  52             cxx: g++
  53 
  54     # location of log directory
  55     # logdir: /tmp/
  56 
  57     # specify location where buildtest will write tests
  58     # testdir: /tmp
  59 
  60     # specify one or more directory where buildtest should load buildspecs
  61     # buildspec_roots: []
  62 
  63     cdash:
  64       url: https://my.cdash.org/
  65       project: buildtest
  66       site: generic
  67       buildname: tutorials
  68

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:

buildtest cg executors

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

buildtest cg executors --json
buildtest cg executors --yaml