Building Test via buildtest

This guide will get you familiar with buildtest command line interface. Once you complete this section, you can proceed to writing buildspecs section where we will cover how to write buildspecs.

Once you install buildtest, you should find the buildtest command in your $PATH. You can check the path to buildtest command by running:

$ which buildtest

If you don’t see buildtest go back and install buildtest.

When you clone buildtest, you also get a set of buildspecs that you can run on your system. The buildtest build command is used for building and running tests. Buildtest will read one or more buildspecs file that adheres to one of the buildtest schemas. For a complete list of build options, run buildtest build --help

Build Usage

$ buildtest build --help
usage: buildtest [options] [COMMANDS] build [-h] [-b BUILDSPEC] [-x EXCLUDE] [-t TAGS] [-f FILTER] [-e EXECUTOR]
                                            [-s {parse,build}] [--testdir TESTDIR] [--rebuild REBUILD] [-r REPORT]
                                            [--max-pend-time MAX_PEND_TIME] [--poll-interval POLL_INTERVAL] [-k]

optional arguments:
  -h, --help            show this help message and exit
  -b BUILDSPEC, --buildspec BUILDSPEC
                        Specify a buildspec (file or directory) to build. A buildspec must end in '.yml' extension.
  -x EXCLUDE, --exclude EXCLUDE
                        Exclude one or more buildspecs (file or directory) from processing. A buildspec must end in
                        '.yml' extension.
  -t TAGS, --tags TAGS  Discover buildspecs by tags found in buildspec cache
  -f FILTER, --filter FILTER
                        Filter buildspec based on tags, type, or maintainers. Usage: --filter key1=val1,key2=val2
  -e EXECUTOR, --executor EXECUTOR
                        Discover buildspecs by executor name found in buildspec cache
  -s {parse,build}, --stage {parse,build}
                        control behavior of buildtest build
  --testdir TESTDIR     Specify a custom test directory where to write tests. This overrides configuration file and
                        default location.
  --rebuild REBUILD     Rebuild test X number of times. Must be a positive number between [1-50]
  -r REPORT, --report REPORT
                        Specify a report file where tests will be written.
  --max-pend-time MAX_PEND_TIME
                        Specify Maximum Pending Time (sec) for job before cancelling job. This only applies for batch
                        job submission.
  --poll-interval POLL_INTERVAL
                        Specify Poll Interval (sec) for polling batch jobs
  -k, --keep-stage-dir  Keep stage directory after job completion.

Building a Test

To build a test, we use the --buildspec or short option -b to specify the path to buildspec file. Let’s see some examples, first we specify a full path to buildspec file. In this example, buildtest will discover buildspecs followed by parsing the test with appropriate schema and generate a shell script that is run by buildtest. You can learn more about build and test process.

$ buildtest build -b $BUILDTEST_ROOT/tutorials/vars.yml


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:01:35
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                           |
+=================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml |
+-------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+-------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml



name            description
--------------  -------------------------------
variables_bash  Declare shell variables in bash

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name           | id       | type   | executor           | tags          | testpath
----------------+----------+--------+--------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------
 variables_bash | 5cd95412 | script | generic.local.bash | ['tutorials'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/vars/variables_bash/0/variables_bash_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name           | id       | executor           | status   |   returncode
----------------+----------+--------------------+----------+--------------
 variables_bash | 5cd95412 | generic.local.bash | PASS     |            0

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 1/1 Percentage: 100.000%
Failed Tests: 0/1 Percentage: 0.000%


Writing Logfile to: /tmp/buildtest_luxf1hm9.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

Note

buildtest will only read buildspecs with .yml extension, if you specify a .yaml it will be ignored by buildtest.

The --buildspec option can be used to specify a file or directory path. If you want to build multiple buildspecs in a directory you can specify the directory path and buildtest will recursively search for all .yml files. In the next example, we build all tests in directory general_tests/configuration.

$ buildtest build -b general_tests/configuration/


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:00
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b general_tests/configuration/

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-------------------------------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                                               |
+=====================================================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/kernel_state.yml           |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ulimits.yml                |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/disk_usage.yml             |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/systemd-default-target.yml |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ssh_localhost.yml          |
+-------------------------------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  5
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  5

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/kernel_state.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ulimits.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/disk_usage.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/systemd-default-target.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ssh_localhost.yml



name                          description
----------------------------  ----------------------------------------------------------------
kernel_swapusage              Retrieve Kernel Swap Usage
ulimit_filelock_unlimited     Check if file lock is set to unlimited in ulimits
ulimit_cputime_unlimited      Check if cputime is set to unlimited in ulimits
ulimit_stacksize_unlimited    Check if stack size is set to unlimited in ulimits
ulimit_vmsize_unlimited       Check virtual memory size and check if its set to unlimited
ulimit_filedescriptor_4096    Check if open file descriptors limit is set to 4096
ulimit_max_user_process_2048  Check max number of user process limit is set to 2048
root_disk_usage               Check root disk usage and report if it exceeds threshold
systemd_default_target        check if default target is multi-user.target
ssh_localhost_remotecommand   Test if ssh on localhost works and if we can run remote command.

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                         | id       | type   | executor           | tags                      | testpath
------------------------------+----------+--------+--------------------+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 kernel_swapusage             | 78385aa3 | script | generic.local.bash | ['configuration']         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/kernel_state/kernel_swapusage/0/kernel_swapusage_build.sh
 ulimit_filelock_unlimited    | 7853d621 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/0/ulimit_filelock_unlimited_build.sh
 ulimit_cputime_unlimited     | fad17159 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/0/ulimit_cputime_unlimited_build.sh
 ulimit_stacksize_unlimited   | f41c7eba | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/0/ulimit_stacksize_unlimited_build.sh
 ulimit_vmsize_unlimited      | 43a72137 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/0/ulimit_vmsize_unlimited_build.sh
 ulimit_filedescriptor_4096   | 725bf02b | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/0/ulimit_filedescriptor_4096_build.sh
 ulimit_max_user_process_2048 | f5fc40c0 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/0/ulimit_max_user_process_2048_build.sh
 root_disk_usage              | 4decdc8d | script | generic.local.bash | ['filesystem', 'storage'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/disk_usage/root_disk_usage/0/root_disk_usage_build.sh
 systemd_default_target       | 5e0428e3 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/0/systemd_default_target_build.sh
 ssh_localhost_remotecommand  | 87badcae | script | generic.local.bash | ['ssh']                   | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ssh_localhost/ssh_localhost_remotecommand/0/ssh_localhost_remotecommand_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                         | id       | executor           | status   |   returncode
------------------------------+----------+--------------------+----------+--------------
 kernel_swapusage             | 78385aa3 | generic.local.bash | FAIL     |          127
 ulimit_filelock_unlimited    | 7853d621 | generic.local.bash | PASS     |            0
 ulimit_cputime_unlimited     | fad17159 | generic.local.bash | PASS     |            0
 ulimit_stacksize_unlimited   | f41c7eba | generic.local.bash | FAIL     |            0
 ulimit_vmsize_unlimited      | 43a72137 | generic.local.bash | PASS     |            0
 ulimit_filedescriptor_4096   | 725bf02b | generic.local.bash | FAIL     |            0
 ulimit_max_user_process_2048 | f5fc40c0 | generic.local.bash | FAIL     |            0
 root_disk_usage              | 4decdc8d | generic.local.bash | PASS     |            0
 systemd_default_target       | 5e0428e3 | generic.local.bash | FAIL     |            1
 ssh_localhost_remotecommand  | 87badcae | generic.local.bash | FAIL     |          255

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 4/10 Percentage: 40.000%
Failed Tests: 6/10 Percentage: 60.000%


Writing Logfile to: /tmp/buildtest_jfj0xqii.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

Building Multiple Buildspecs

You can append -b option to build multiple buildspecs in the same command. Buildtest will discover buildspecs for every argument (-b) and accumulate a list of buildspecs to run. In this example, we instruct buildtest to build a buildspec file and all buildspecs in a directory path.

$ buildtest build -b general_tests/configuration/ -b tutorials/vars.yml


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:00
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b general_tests/configuration/ -b tutorials/vars.yml

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-------------------------------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                                               |
+=====================================================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/systemd-default-target.yml |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ulimits.yml                |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/disk_usage.yml             |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ssh_localhost.yml          |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/kernel_state.yml           |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml                                     |
+-------------------------------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  6
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  6

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/systemd-default-target.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ulimits.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/disk_usage.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ssh_localhost.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/kernel_state.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml



name                          description
----------------------------  ----------------------------------------------------------------
systemd_default_target        check if default target is multi-user.target
ulimit_filelock_unlimited     Check if file lock is set to unlimited in ulimits
ulimit_cputime_unlimited      Check if cputime is set to unlimited in ulimits
ulimit_stacksize_unlimited    Check if stack size is set to unlimited in ulimits
ulimit_vmsize_unlimited       Check virtual memory size and check if its set to unlimited
ulimit_filedescriptor_4096    Check if open file descriptors limit is set to 4096
ulimit_max_user_process_2048  Check max number of user process limit is set to 2048
root_disk_usage               Check root disk usage and report if it exceeds threshold
ssh_localhost_remotecommand   Test if ssh on localhost works and if we can run remote command.
kernel_swapusage              Retrieve Kernel Swap Usage
variables_bash                Declare shell variables in bash

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                         | id       | type   | executor           | tags                      | testpath
------------------------------+----------+--------+--------------------+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 systemd_default_target       | dfa421fa | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/1/systemd_default_target_build.sh
 ulimit_filelock_unlimited    | 4348b714 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_filelock_unlimited/1/ulimit_filelock_unlimited_build.sh
 ulimit_cputime_unlimited     | 39d4625e | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_cputime_unlimited/1/ulimit_cputime_unlimited_build.sh
 ulimit_stacksize_unlimited   | 7600c5e0 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_stacksize_unlimited/1/ulimit_stacksize_unlimited_build.sh
 ulimit_vmsize_unlimited      | 279d126d | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_vmsize_unlimited/1/ulimit_vmsize_unlimited_build.sh
 ulimit_filedescriptor_4096   | 467c31bb | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_filedescriptor_4096/1/ulimit_filedescriptor_4096_build.sh
 ulimit_max_user_process_2048 | 9d024d0b | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ulimits/ulimit_max_user_process_2048/1/ulimit_max_user_process_2048_build.sh
 root_disk_usage              | 4450223b | script | generic.local.bash | ['filesystem', 'storage'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/disk_usage/root_disk_usage/1/root_disk_usage_build.sh
 ssh_localhost_remotecommand  | 2b361527 | script | generic.local.bash | ['ssh']                   | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ssh_localhost/ssh_localhost_remotecommand/1/ssh_localhost_remotecommand_build.sh
 kernel_swapusage             | ac8de77a | script | generic.local.bash | ['configuration']         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/kernel_state/kernel_swapusage/1/kernel_swapusage_build.sh
 variables_bash               | d54fb273 | script | generic.local.bash | ['tutorials']             | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/vars/variables_bash/1/variables_bash_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                         | id       | executor           | status   |   returncode
------------------------------+----------+--------------------+----------+--------------
 systemd_default_target       | dfa421fa | generic.local.bash | FAIL     |            1
 ulimit_filelock_unlimited    | 4348b714 | generic.local.bash | PASS     |            0
 ulimit_cputime_unlimited     | 39d4625e | generic.local.bash | PASS     |            0
 ulimit_stacksize_unlimited   | 7600c5e0 | generic.local.bash | FAIL     |            0
 ulimit_vmsize_unlimited      | 279d126d | generic.local.bash | PASS     |            0
 ulimit_filedescriptor_4096   | 467c31bb | generic.local.bash | FAIL     |            0
 ulimit_max_user_process_2048 | 9d024d0b | generic.local.bash | FAIL     |            0
 root_disk_usage              | 4450223b | generic.local.bash | PASS     |            0
 ssh_localhost_remotecommand  | 2b361527 | generic.local.bash | FAIL     |          255
 kernel_swapusage             | ac8de77a | generic.local.bash | FAIL     |          127
 variables_bash               | d54fb273 | generic.local.bash | PASS     |            0

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 5/11 Percentage: 45.455%
Failed Tests: 6/11 Percentage: 54.545%


Writing Logfile to: /tmp/buildtest_aib6qmtb.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

Excluding Buildspecs

So far we learned how to build buildspecs by file and directory path using the -b option. Next, we will discuss how one may exclude buildspecs which behaves similar to -b option. You can exclude buildspecs via --exclude or short option -x which can be useful when you want to exclude certain files or sub directory.

For example we can build all buildspecs in tutorials but exclude file tutorials/vars.yml by running:

$ buildtest build -b tutorials -x tutorials/vars.yml

buildtest will discover all buildspecs and then exclude any buildspecs specified by -x option. You can specify -x multiple times just like -b option.

For example, we can undo discovery by passing same option to -b and -x as follows

$ buildtest build -b tutorials/ -x tutorials/


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:00
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials/ -x tutorials/
There are no Buildspec files to process.

Buildtest will stop immediately if there are no Buildspecs to process, this is true if you were to specify files instead of directory.

In this example, we build all buildspecs in a directory but exclude a file. Buildtest will report the excluded buildspecs in the output and -x option can be appended multiple times. The -x can be a file or a directory and behaves similar to -b option.

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


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:01
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b general_tests/configuration/ -x general_tests/configuration/ulimits.yml

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-------------------------------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                                               |
+=====================================================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ulimits.yml                |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ssh_localhost.yml          |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/kernel_state.yml           |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/disk_usage.yml             |
+-------------------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/systemd-default-target.yml |
+-------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------------------------------------------+
| Excluded Buildspecs                                                                                                  |
+======================================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ulimits.yml |
+----------------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  5
Excluded Buildspecs:  1
Detected Buildspecs after exclusion:  4

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+-------------------------------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/ssh_localhost.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/kernel_state.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/disk_usage.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/general_tests/configuration/systemd-default-target.yml



name                         description
---------------------------  ----------------------------------------------------------------
ssh_localhost_remotecommand  Test if ssh on localhost works and if we can run remote command.
kernel_swapusage             Retrieve Kernel Swap Usage
root_disk_usage              Check root disk usage and report if it exceeds threshold
systemd_default_target       check if default target is multi-user.target

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                        | id       | type   | executor           | tags                      | testpath
-----------------------------+----------+--------+--------------------+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ssh_localhost_remotecommand | 2aef4455 | script | generic.local.bash | ['ssh']                   | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/ssh_localhost/ssh_localhost_remotecommand/2/ssh_localhost_remotecommand_build.sh
 kernel_swapusage            | 4892fa48 | script | generic.local.bash | ['configuration']         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/kernel_state/kernel_swapusage/2/kernel_swapusage_build.sh
 root_disk_usage             | a7303c75 | script | generic.local.bash | ['filesystem', 'storage'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/disk_usage/root_disk_usage/2/root_disk_usage_build.sh
 systemd_default_target      | b38db031 | script | generic.local.bash | ['system']                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/systemd-default-target/systemd_default_target/2/systemd_default_target_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                        | id       | executor           | status   |   returncode
-----------------------------+----------+--------------------+----------+--------------
 ssh_localhost_remotecommand | 2aef4455 | generic.local.bash | FAIL     |          255
 kernel_swapusage            | 4892fa48 | generic.local.bash | FAIL     |          127
 root_disk_usage             | a7303c75 | generic.local.bash | PASS     |            0
 systemd_default_target      | b38db031 | generic.local.bash | FAIL     |            1

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 1/4 Percentage: 25.000%
Failed Tests: 3/4 Percentage: 75.000%


Writing Logfile to: /tmp/buildtest_ci86tqrh.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

Building By Tags

buildtest can perform builds by tags by using --tags or short option (-t). In order to use this feature, buildtest must load buildspecs in cache which can be run via buildtest buildspec find. If you are unsure of the available tags you can run buildtest buildspec find --tags or let buildtest tab-complete the available tags. For more details see Querying buildspec tags.

Let’s assume you want to build by tag name network, buildtest will attempt to find all tests that contain tags: ['network'] in the buildspec which is loaded in the buildcache cache. If a test matches the tag name, the test will be picked up during the discover process.

$ buildtest build -t network


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:01
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -t network

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+---------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                   |
+=========================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml |
+---------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1

BREAKDOWN OF BUILDSPECS BY TAGS
----------------------------------
Detected Tag Names: ['network']
+---------------------------------------------------------------------------------------------------------+
| network                                                                                                 |
+=========================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml |
+---------------------------------------------------------------------------------------------------------+



+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+---------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml



name                  description
--------------------  -----------------------------
string_tag            tags can be a string
list_of_strings_tags  tags can be a list of strings

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                 | id       | type   | executor           | tags                | testpath
----------------------+----------+--------+--------------------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 string_tag           | 28b04d5d | script | generic.local.bash | network             | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/tags_example/string_tag/0/string_tag_build.sh
 list_of_strings_tags | 3e32ff68 | script | generic.local.bash | ['network', 'ping'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/tags_example/list_of_strings_tags/0/list_of_strings_tags_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                 | id       | executor           | status   |   returncode
----------------------+----------+--------------------+----------+--------------
 string_tag           | 28b04d5d | generic.local.bash | PASS     |            0
 list_of_strings_tags | 3e32ff68 | generic.local.bash | FAIL     |          127

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 1/2 Percentage: 50.000%
Failed Tests: 1/2 Percentage: 50.000%


Writing Logfile to: /tmp/buildtest_zj7_zg5i.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

You can build by multiple tags by specifying --tags multiple times. In next example we build all tests with tag name pass and python.

$ buildtest build -t python -t pass


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:01
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -t python -t pass

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                      |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml    |
+------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml    |
+------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  3
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  3

BREAKDOWN OF BUILDSPECS BY TAGS
----------------------------------
Detected Tag Names: ['python', 'pass']
+---------------------------------------------------------------------------------------------------------+
| python                                                                                                  |
+=========================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml |
+---------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml |
+---------------------------------------------------------------------------------------------------------+


+------------------------------------------------------------------------------------------------------------+
| pass                                                                                                       |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+



+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml



name                      description
------------------------  ---------------------------------------------------
python_hello              Hello World python
exit1_fail                exit 1 by default is FAIL
exit1_pass                report exit 1 as PASS
returncode_list_mismatch  exit 2 failed since it failed to match returncode 1
returncode_int_match      exit 128 matches returncode 128
circle_area               Calculate circle of area given a radius

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                     | id       | type   | executor             | tags                    | testpath
--------------------------+----------+--------+----------------------+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 python_hello             | aa2fbe0b | script | generic.local.bash   | python                  | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/python-hello/python_hello/1/python_hello_build.sh
 exit1_fail               | cad7aa63 | script | generic.local.sh     | ['tutorials', 'fail']   | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_fail/1/exit1_fail_build.sh
 exit1_pass               | cbd241fa | script | generic.local.sh     | ['tutorials', 'pass']   | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_pass/1/exit1_pass_build.sh
 returncode_list_mismatch | 99ee050f | script | generic.local.sh     | ['tutorials', 'fail']   | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_list_mismatch/1/returncode_list_mismatch_build.sh
 returncode_int_match     | 25fc3da8 | script | generic.local.sh     | ['tutorials', 'pass']   | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_int_match/1/returncode_int_match_build.sh
 circle_area              | 1f60989b | script | generic.local.python | ['tutorials', 'python'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.python/python-shell/circle_area/1/circle_area_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                     | id       | executor             | status   |   returncode
--------------------------+----------+----------------------+----------+--------------
 python_hello             | aa2fbe0b | generic.local.bash   | PASS     |            0
 exit1_fail               | cad7aa63 | generic.local.sh     | FAIL     |            1
 exit1_pass               | cbd241fa | generic.local.sh     | PASS     |            1
 returncode_list_mismatch | 99ee050f | generic.local.sh     | FAIL     |            2
 returncode_int_match     | 25fc3da8 | generic.local.sh     | PASS     |          128
 circle_area              | 1f60989b | generic.local.python | PASS     |            0

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 4/6 Percentage: 66.667%
Failed Tests: 2/6 Percentage: 33.333%


Writing Logfile to: /tmp/buildtest_zdo2orj_.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

When multiple tags are specified, we search each tag independently and if it’s found in the buildspec cache we retrieve the buildspec file and add file to queue. This queue is a list of buildspecs that buildtest will process (i.e parse, build, run). You can query tags from buildspecs cache to see all available tags by running buildtest buildspec find --tags.

Note

The --tags is used for discovering buildspec file and not filtering tests by tag.

You can combine --tags with --buildspec to discover buildspecs in a single command. buildtest will query tags and buildspecs independently and combine all discovered buildspecs together.

$ buildtest build --tags pass --buildspec tutorials/python-hello.yml


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:02
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build --tags pass --buildspec tutorials/python-hello.yml

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                      |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml    |
+------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  2
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  2

BREAKDOWN OF BUILDSPECS BY TAGS
----------------------------------
Detected Tag Names: ['pass']
+------------------------------------------------------------------------------------------------------------+
| pass                                                                                                       |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+



+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml



name                      description
------------------------  ---------------------------------------------------
python_hello              Hello World python
exit1_fail                exit 1 by default is FAIL
exit1_pass                report exit 1 as PASS
returncode_list_mismatch  exit 2 failed since it failed to match returncode 1
returncode_int_match      exit 128 matches returncode 128

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                     | id       | type   | executor           | tags                  | testpath
--------------------------+----------+--------+--------------------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 python_hello             | 82bc0254 | script | generic.local.bash | python                | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/python-hello/python_hello/2/python_hello_build.sh
 exit1_fail               | 4a9f6ee2 | script | generic.local.sh   | ['tutorials', 'fail'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_fail/2/exit1_fail_build.sh
 exit1_pass               | 0190d85b | script | generic.local.sh   | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_pass/2/exit1_pass_build.sh
 returncode_list_mismatch | e36655e4 | script | generic.local.sh   | ['tutorials', 'fail'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_list_mismatch/2/returncode_list_mismatch_build.sh
 returncode_int_match     | 30190320 | script | generic.local.sh   | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_int_match/2/returncode_int_match_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                     | id       | executor           | status   |   returncode
--------------------------+----------+--------------------+----------+--------------
 python_hello             | 82bc0254 | generic.local.bash | PASS     |            0
 exit1_fail               | 4a9f6ee2 | generic.local.sh   | FAIL     |            1
 exit1_pass               | 0190d85b | generic.local.sh   | PASS     |            1
 returncode_list_mismatch | e36655e4 | generic.local.sh   | FAIL     |            2
 returncode_int_match     | 30190320 | generic.local.sh   | PASS     |          128

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 3/5 Percentage: 60.000%
Failed Tests: 2/5 Percentage: 40.000%


Writing Logfile to: /tmp/buildtest_lbmm9q3d.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

As you may see, there are several ways to build buildspecs with buildtest. Tags is great way to build a whole collection of tests if you don’t know path to all the files. You can specify multiple tags per buildspecs to classify how test can be run.

Building by Executors

Every buildspec is associated to an executor which is responsible for running the test. You can instruct buildtest to run all tests by given executor via --executor option or short option -e. For instance, if you want to build all test associated to executor generic.local.python you can run:

$ buildtest build --executor generic.local.python

buildtest will query buildspec cache for the executor name and retrieve a list of buildspecs with matching executor name. To see a list of available executors in buildspec cache see querying buildspec executor.

Note

By default all tests are run in buildspec file. The buildtest build --executor option discovers buildspecs if one of the test matches the executor name. The --executor option is not filtering on test level like --filter-tags option.

In this example we run all tests that are associated to generic.local.python executor.

$ buildtest build --executor generic.local.python


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:02
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build --executor generic.local.python

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+--------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                        |
+==============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml |
+--------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml      |
+--------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  2
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  2

BREAKDOWN OF BUILDSPECS BY EXECUTORS
--------------------------------------
Detected Executor Names: ['generic.local.python']
+--------------------------------------------------------------------------------------------------------------+
| generic.local.python                                                                                         |
+==============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml      |
+--------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml |
+--------------------------------------------------------------------------------------------------------------+


[run_only_platform_darwin][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml]: test is skipped because this test is expected to run on platform: Darwin but detected platform: Linux.

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+--------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml



name                     description
-----------------------  ---------------------------------------------------
run_only_platform_linux  This test will only run if target platform is Linux
circle_area              Calculate circle of area given a radius

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                    | id       | type   | executor             | tags                    | testpath
-------------------------+----------+--------+----------------------+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 run_only_platform_linux | 5b85aaf5 | script | generic.local.python | ['tutorials']           | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.python/run_only_platform/run_only_platform_linux/0/run_only_platform_linux_build.sh
 circle_area             | 0bbd21fa | script | generic.local.python | ['tutorials', 'python'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.python/python-shell/circle_area/2/circle_area_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                    | id       | executor             | status   |   returncode
-------------------------+----------+----------------------+----------+--------------
 run_only_platform_linux | 5b85aaf5 | generic.local.python | PASS     |            0
 circle_area             | 0bbd21fa | generic.local.python | PASS     |            0

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 2/2 Percentage: 100.000%
Failed Tests: 0/2 Percentage: 0.000%


Writing Logfile to: /tmp/buildtest_1bpqbvx1.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

Note

The --executor option can be appended to discover tests by multiple executors.

Filtering Buildspecs

buildtest has support for filtering buildspecs based on certain attributes defined in buildspec file. Upon Discover Buildspecs, buildtest will filter out tests or entire buildspec files. The buildtest build --filter option can be used to filter buildspecs which expects a single key=value pair. Currently, buildtest can filter tests based on tags, type and maintainers.

In this example, we will discover all buildspecs based on tagname pass and then filter each test by tagname pass specified by –filter tags=pass.

$ buildtest build -t pass --filter tags=pass


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:03
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -t pass --filter tags=pass

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                      |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1

BREAKDOWN OF BUILDSPECS BY TAGS
----------------------------------
Detected Tag Names: ['pass']
+------------------------------------------------------------------------------------------------------------+
| pass                                                                                                       |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+


[exit1_fail][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml]: test is skipped because it is not in tag filter list: {'tags': 'pass'}
[returncode_list_mismatch][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml]: test is skipped because it is not in tag filter list: {'tags': 'pass'}

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml



name                  description
--------------------  -------------------------------
exit1_pass            report exit 1 as PASS
returncode_int_match  exit 128 matches returncode 128

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                 | id       | type   | executor         | tags                  | testpath
----------------------+----------+--------+------------------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 exit1_pass           | 2c1a87d2 | script | generic.local.sh | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_pass/3/exit1_pass_build.sh
 returncode_int_match | 35889441 | script | generic.local.sh | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_int_match/3/returncode_int_match_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                 | id       | executor         | status   |   returncode
----------------------+----------+------------------+----------+--------------
 exit1_pass           | 2c1a87d2 | generic.local.sh | PASS     |            1
 returncode_int_match | 35889441 | generic.local.sh | PASS     |          128

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 2/2 Percentage: 100.000%
Failed Tests: 0/2 Percentage: 0.000%


Writing Logfile to: /tmp/buildtest_ls8n5msv.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

buildtest can run filter tests by maintainers, this can be useful if you want to run tests that you are maintainer. The maintainers field is set per buildspec and not each test. You can filter maintiners via --filter maintainers=<MAINTAINER_NAME>. If the maintainers field is not specified the buildspec will be filtered out if --filter maintainers is specified. In this next example, we will build all tests for maintainer @shahzebsiddiqui.

$ buildtest build -b tutorials --filter maintainers=@shahzebsiddiqui


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:03
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials --filter maintainers=@shahzebsiddiqui

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-----------------------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                                       |
+=============================================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/envvar_override.yml        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_c.yml            |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/metrics_openmp.yml         |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_distro.yml                  |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml                |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/pre_post_build_run.yml     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_regex.yml                    |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_install.yml                |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_executor.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/sleep.yml                            |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml                  |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/remove_environment_example.yml |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/install_zlib.yml               |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/executor_regex_script.yml            |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test_specs.yml           |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/concretize_m4.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/custom_run.yml             |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/skip_tests.yml                       |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_exclude.yml       |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/vecadd.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml                      |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shebang.yml                          |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_directory.yml       |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_tags.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/root_user.yml                        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/openmp_hello.yml           |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/maintainers_example.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/pre_post_cmds.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/csh_shell_examples.yml               |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_manifest.yml        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/mirror_example.yml             |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_status_regex.yml  |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_sbatch.yml               |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_buildspec_section.yml        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/add_numbers.yml                      |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/selinux.yml                          |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml                             |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml                   |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_fortran.yml      |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_variable.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/hello_world.yml                      |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  46
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  46


Buildspecs that failed validation
________________________________________________________________________________
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_install.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_executor.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_tags.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_buildspec_section.yml

Buildspecs that were filtered out
________________________________________________________________________________
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/envvar_override.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_c.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/metrics_openmp.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_distro.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/pre_post_build_run.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_regex.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/sleep.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/remove_environment_example.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/install_zlib.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/executor_regex_script.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test_specs.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/concretize_m4.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/custom_run.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/skip_tests.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_exclude.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/vecadd.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shebang.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_directory.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/root_user.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/openmp_hello.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/maintainers_example.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/pre_post_cmds.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/csh_shell_examples.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_manifest.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/mirror_example.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_status_regex.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_sbatch.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/add_numbers.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/selinux.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_fortran.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_variable.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile                | validstate   | buildspec
---------------------------+--------------+-----------------------------------------------------------------------------------------------------------------------------
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/envvar_override.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_c.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/metrics_openmp.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_distro.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/pre_post_build_run.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_regex.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/sleep.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/remove_environment_example.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/install_zlib.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/executor_regex_script.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test_specs.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/concretize_m4.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/custom_run.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/skip_tests.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_exclude.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/vecadd.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shebang.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_directory.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/root_user.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/openmp_hello.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/maintainers_example.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/pre_post_cmds.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/csh_shell_examples.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_manifest.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/mirror_example.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_status_regex.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_sbatch.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/add_numbers.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/selinux.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_fortran.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_variable.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/hello_world.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml



name         description
-----------  -------------------
hello_world  hello world example

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name        | id       | type   | executor           | tags      | testpath
-------------+----------+--------+--------------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------
 hello_world | 6c3944ec | script | generic.local.bash | tutorials | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/hello_world/hello_world/0/hello_world_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name        | id       | executor           | status   |   returncode
-------------+----------+--------------------+----------+--------------
 hello_world | 6c3944ec | generic.local.bash | PASS     |            0

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 1/1 Percentage: 100.000%
Failed Tests: 0/1 Percentage: 0.000%


Writing Logfile to: /tmp/buildtest_dicpq155.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

Please see Query Maintainers on list of maintainers and breakdown of buildspecs by maintainers.

We can also filter tests by type field in the buildspec which corresponds to the schema type. In this next example, we filter all tests by spack schema type by passing option --filter type=spack. We inform buildtest to stop after build stage (--stage=build) for more details see Configure Build Stages.

$ buildtest build -b tutorials --filter type=spack --stage=build


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:04
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials --filter type=spack --stage=build

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-----------------------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                                       |
+=============================================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/metrics_openmp.yml         |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/pre_post_cmds.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/hello_world.yml                      |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/sleep.yml                            |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_executor.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/pre_post_build_run.yml     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_variable.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/remove_environment_example.yml |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test_specs.yml           |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_manifest.yml        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_sbatch.yml               |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/mirror_example.yml             |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_exclude.yml       |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/maintainers_example.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/csh_shell_examples.yml               |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_distro.yml                  |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml                  |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml                |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_directory.yml       |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/executor_regex_script.yml            |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_regex.yml                    |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/custom_run.yml             |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/skip_tests.yml                       |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_install.yml                |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/root_user.yml                        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/openmp_hello.yml           |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_status_regex.yml  |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/vecadd.yml                 |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_c.yml            |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml                   |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_tags.yml                     |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/install_zlib.yml               |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml                             |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/selinux.yml                          |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/concretize_m4.yml              |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/add_numbers.yml                      |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/envvar_override.yml        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_fortran.yml      |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_buildspec_section.yml        |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shebang.yml                          |
+-----------------------------------------------------------------------------------------------------------------------------+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml                      |
+-----------------------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  46
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  46
[metrics_variable_compiler][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/metrics_openmp.yml]: test is skipped because it is not in type filter list: spack
[hello_world][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/hello_world.yml]: test is skipped because it is not in type filter list: spack
[sleep][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/sleep.yml]: test is skipped because it is not in type filter list: spack
[pre_post_build_run][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/pre_post_build_run.yml]: test is skipped because it is not in type filter list: spack
[timelimit_min_max][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml]: test is skipped because it is not in type filter list: spack
[timelimit_min][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml]: test is skipped because it is not in type filter list: spack
[timelimit_max][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml]: test is skipped because it is not in type filter list: spack
[timelimit_min_fail][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml]: test is skipped because it is not in type filter list: spack
[timelimit_max_fail][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml]: test is skipped because it is not in type filter list: spack
[metric_variable_assignment][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_variable.yml]: test is skipped because it is not in type filter list: spack
[vecadd_gnu_exclude][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_exclude.yml]: test is skipped because it is not in type filter list: spack
[foo_bar][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/maintainers_example.yml]: test is skipped because it is not in type filter list: spack
[csh_shell][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/csh_shell_examples.yml]: test is skipped because it is not in type filter list: spack
[python_hello][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml]: test is skipped because it is not in type filter list: spack
[run_only_macos_distro][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_distro.yml]: test is skipped because it is not in type filter list: spack
[run_only_linux_distro][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_distro.yml]: test is skipped because it is not in type filter list: spack
[string_tag][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml]: test is skipped because it is not in type filter list: spack
[list_of_strings_tags][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml]: test is skipped because it is not in type filter list: spack
[exit1_fail][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml]: test is skipped because it is not in type filter list: spack
[exit1_pass][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml]: test is skipped because it is not in type filter list: spack
[returncode_list_mismatch][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml]: test is skipped because it is not in type filter list: spack
[returncode_int_match][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml]: test is skipped because it is not in type filter list: spack
[run_only_platform_darwin][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml]: test is skipped because it is not in type filter list: spack
[run_only_platform_linux][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml]: test is skipped because it is not in type filter list: spack
[executor_regex_script_schema][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/executor_regex_script.yml]: test is skipped because it is not in type filter list: spack
[metric_regex_example][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_regex.yml]: test is skipped because it is not in type filter list: spack
[circle_area][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml]: test is skipped because it is not in type filter list: spack
[custom_run_by_compilers][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/custom_run.yml]: test is skipped because it is not in type filter list: spack
[skip](/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/skip_tests.yml): test is skipped.
[unskipped][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/skip_tests.yml]: test is skipped because it is not in type filter list: spack
[run_only_as_root][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/root_user.yml]: test is skipped because it is not in type filter list: spack
[openmp_hello_c_example][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/openmp_hello.yml]: test is skipped because it is not in type filter list: spack
[default_status_regex][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_status_regex.yml]: test is skipped because it is not in type filter list: spack
[override_status_regex][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_status_regex.yml]: test is skipped because it is not in type filter list: spack
[vecadd_gnu][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/vecadd.yml]: test is skipped because it is not in type filter list: spack
[hello_c][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_c.yml]: test is skipped because it is not in type filter list: spack
[_bin_sh_shell][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml]: test is skipped because it is not in type filter list: spack
[_bin_bash_shell][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml]: test is skipped because it is not in type filter list: spack
[bash_shell][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml]: test is skipped because it is not in type filter list: spack
[sh_shell][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml]: test is skipped because it is not in type filter list: spack
[shell_options][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml]: test is skipped because it is not in type filter list: spack
[variables_bash][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml]: test is skipped because it is not in type filter list: spack
[selinux_disable][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/selinux.yml]: test is skipped because it is not in type filter list: spack
[add_numbers][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/add_numbers.yml]: test is skipped because it is not in type filter list: spack
[override_environmentvars][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/envvar_override.yml]: test is skipped because it is not in type filter list: spack
[hello_f][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_fortran.yml]: test is skipped because it is not in type filter list: spack
[bash_login_shebang][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shebang.yml]: test is skipped because it is not in type filter list: spack
[bash_nonlogin_shebang][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shebang.yml]: test is skipped because it is not in type filter list: spack
[bash_env_variables][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml]: test is skipped because it is not in type filter list: spack
[csh_env_declaration][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml]: test is skipped because it is not in type filter list: spack
[tcsh_env_declaration][/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml]: test is skipped because it is not in type filter list: spack


Buildspecs that failed validation
________________________________________________________________________________
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_executor.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_install.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_tags.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_buildspec_section.yml

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile                | validstate   | buildspec
---------------------------+--------------+-----------------------------------------------------------------------------------------------------------------------------
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/metrics_openmp.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/pre_post_cmds.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/hello_world.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/sleep.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/pre_post_build_run.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/runtime_status_test.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_variable.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/remove_environment_example.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test_specs.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_manifest.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_test.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/spack_sbatch.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/mirror_example.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_exclude.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/maintainers_example.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/csh_shell_examples.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-hello.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_distro.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/tags_example.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/run_only_platform.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/env_create_directory.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/executor_regex_script.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/metrics_regex.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/custom_run.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/skip_tests.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/root_user.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/openmp_hello.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/compiler_status_regex.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/vecadd.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_c.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shell_examples.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/install_zlib.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/selinux.yml
 spack-v1.0.schema.json    | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/spack/concretize_m4.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/add_numbers.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/envvar_override.yml
 compiler-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/compilers/gnu_hello_fortran.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/shebang.yml
 script-v1.0.schema.json   | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/environment.yml



name                              description
--------------------------------  ------------------------------------------------------------------------
run_pre_post_commands             Install zlib
remove_environment_automatically  remove spack environment automatically before creating a new environment
remove_environment_explicit       remove spack environment explicitly using the 'rm' property
spack_test_results_specs_format   Run spack test results with spec format
spack_env_create_from_manifest    Create spack environment from spack.yaml
spack_test                        Install bzip2 and run spack test and report results
spack_sbatch_example              sbatch directives can be defined in spack schema
add_mirror                        Declare spack mirror
add_mirror_in_spack_env           Declare spack mirror in spack environment
spack_env_directory               Concretize m4 in a spack environment named m4
install_zlib                      Install zlib
concretize_m4_in_spack_env        Concretize m4 in a spack environment named m4

+----------------------+
| Stage: Building Test |
+----------------------+ 



 name                             | id       | type   | executor         | tags      | testpath
----------------------------------+----------+--------+------------------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 run_pre_post_commands            | a4b63e50 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pre_post_cmds/run_pre_post_commands/0/run_pre_post_commands_build.sh
 remove_environment_automatically | 91764b31 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/remove_environment_example/remove_environment_automatically/0/remove_environment_automatically_build.sh
 remove_environment_explicit      | e7b5c1a3 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/remove_environment_example/remove_environment_explicit/0/remove_environment_explicit_build.sh
 spack_test_results_specs_format  | 3312d534 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/spack_test_specs/spack_test_results_specs_format/0/spack_test_results_specs_format_build.sh
 spack_env_create_from_manifest   | 21a6450b | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/env_create_manifest/spack_env_create_from_manifest/0/spack_env_create_from_manifest_build.sh
 spack_test                       | 6987fbc7 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/spack_test/spack_test/0/spack_test_build.sh
 spack_sbatch_example             | cfcd0ad5 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/spack_sbatch/spack_sbatch_example/0/spack_sbatch_example_build.sh
 add_mirror                       | d1e02ce8 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/mirror_example/add_mirror/0/add_mirror_build.sh
 add_mirror_in_spack_env          | f2389924 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/mirror_example/add_mirror_in_spack_env/0/add_mirror_in_spack_env_build.sh
 spack_env_directory              | 87ee3296 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/env_create_directory/spack_env_directory/0/spack_env_directory_build.sh
 install_zlib                     | df7107af | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/install_zlib/install_zlib/0/install_zlib_build.sh
 concretize_m4_in_spack_env       | 4796ca69 | spack  | generic.local.sh | ['spack'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/concretize_m4/concretize_m4_in_spack_env/0/concretize_m4_in_spack_env_build.sh

Discover Buildspecs

Now, let’s discuss how buildtest discovers buildspecs since there are several ways to build buildspecs.

The buildspec search resolution is described as follows:

  • If file or directory specified by -b option doesn’t exist we exit immediately.

  • If buildspec path is a directory, traverse directory recursively to find all .yml extensions

  • If buildspec path is a file, check if file extension is not .yml, exit immediately

  • If user specifies --tags or --executor we search in buildspec cache to discover buildspecs.

Shown below is a diagram on how buildtest discovers buildspecs. The user can build buildspecs by --buildspec, –tags, or –executor which will discover the buildspecs. You can exclude buildspecs using --exclude option which is processed after discovering buildspecs. The excluded buildspecs are removed from list if found and final list of buildspecs is processed.

../_images/DiscoverBuildspecs.jpg

Configure Build Stages

We can control behavior of buildtest build command to stop at certain phase using --stage option. The –stage option accepts parse or build, which will instruct buildtest to stop at parse or build phase of the pipeline.

Buildtest will validate all the buildspecs in the parse stage, so you can instruct buildtest to stop at parse stage via --stage=parse. This can be useful when debugging buildspecs that are invalid. In this example below, we instruct buildtest to stop after parse stage.

$ buildtest build -b tutorials/vars.yml --stage=parse


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:04
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials/vars.yml --stage=parse

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                           |
+=================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml |
+-------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+-------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml



name            description
--------------  -------------------------------
variables_bash  Declare shell variables in bash

Likewise, if you want to troubleshoot your test script without running them you can use --stage=build which will stop after build phase. This can be used when you are writing buildspec to troubleshoot how test is generated. In this next example, we inform buildtest to stop after build stage.

$ buildtest build -b tutorials/vars.yml --stage=build


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:04
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials/vars.yml --stage=build

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                           |
+=================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml |
+-------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+-------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/vars.yml



name            description
--------------  -------------------------------
variables_bash  Declare shell variables in bash

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name           | id       | type   | executor           | tags          | testpath
----------------+----------+--------+--------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------
 variables_bash | 5d1d3763 | script | generic.local.bash | ['tutorials'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.bash/vars/variables_bash/2/variables_bash_build.sh

Invalid Buildspecs

buildtest will skip any buildspecs that fail to validate, in that case the test script will not be generated. Here is an example where we have an invalid buildspec.

$ buildtest build -b tutorials/invalid_buildspec_section.yml


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:05
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials/invalid_buildspec_section.yml

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+----------------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                                |
+======================================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_buildspec_section.yml |
+----------------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1


Buildspecs that failed validation
________________________________________________________________________________
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_buildspec_section.yml
No buildspecs to process because there are no valid buildspecs

buildtest may skip tests from running if buildspec specifies an invalid executor name since buildtest needs to know this in order to delegate test to Executor class responsible for running the test. Here is an example where test failed to run since we provided invalid executor.

$ buildtest build -b tutorials/invalid_executor.yml


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:05
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials/invalid_executor.yml

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+-------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                       |
+=============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_executor.yml |
+-------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1


Buildspecs that failed validation
________________________________________________________________________________
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/invalid_executor.yml
No buildspecs to process because there are no valid buildspecs

Rebuild Tests

buildtest can rebuild tests using the --rebuild option which can be useful if you want to test a particular test multiple times. The rebuild option works across all discovered buildspecs and create a new test instance (unique id) and test directory path. To demonstrate we will build tutorials/python-shell.yml three times using --rebuild=3.

$ buildtest build -b tutorials/python-shell.yml --rebuild=3


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:05
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -b tutorials/python-shell.yml --rebuild=3

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+---------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                   |
+=========================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml |
+---------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1

+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+---------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/python-shell.yml



name         description
-----------  ---------------------------------------
circle_area  Calculate circle of area given a radius
circle_area  Calculate circle of area given a radius
circle_area  Calculate circle of area given a radius

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name        | id       | type   | executor             | tags                    | testpath
-------------+----------+--------+----------------------+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------
 circle_area | f1a17ac0 | script | generic.local.python | ['tutorials', 'python'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.python/python-shell/circle_area/3/circle_area_build.sh
 circle_area | d14e4082 | script | generic.local.python | ['tutorials', 'python'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.python/python-shell/circle_area/4/circle_area_build.sh
 circle_area | 12a030f6 | script | generic.local.python | ['tutorials', 'python'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.python/python-shell/circle_area/5/circle_area_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name        | id       | executor             | status   |   returncode
-------------+----------+----------------------+----------+--------------
 circle_area | f1a17ac0 | generic.local.python | PASS     |            0
 circle_area | d14e4082 | generic.local.python | PASS     |            0
 circle_area | 12a030f6 | generic.local.python | PASS     |            0

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 3/3 Percentage: 100.000%
Failed Tests: 0/3 Percentage: 0.000%


Writing Logfile to: /tmp/buildtest_3rjt4orh.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

The rebuild works with all options including: --buildspec, --exclude, --tags and --executors. buildtest will perform rebuild for all discovered tests, for instance in this next example we will discover all tests by tag name fail and each test is rebuild twice.

$ buildtest build -t fail --rebuild 2


User:  docs
Hostname:  build-14364669-project-280831-buildtest
Platform:  Linux
Current Time:  2021/07/30 22:02:06
buildtest path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest
buildtest version:  0.10.1
python path: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/envs/v0.10.1/bin/python
python version:  3.6.12
Test Directory:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests
Configuration File:  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/settings/config.yml
Command: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest build -t fail --rebuild 2

+-------------------------------+
| Stage: Discovering Buildspecs |
+-------------------------------+ 

+------------------------------------------------------------------------------------------------------------+
| Discovered Buildspecs                                                                                      |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+
Discovered Buildspecs:  1
Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1

BREAKDOWN OF BUILDSPECS BY TAGS
----------------------------------
Detected Tag Names: ['fail']
+------------------------------------------------------------------------------------------------------------+
| fail                                                                                                       |
+============================================================================================================+
| /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml |
+------------------------------------------------------------------------------------------------------------+



+---------------------------+
| Stage: Parsing Buildspecs |
+---------------------------+ 

 schemafile              | validstate   | buildspec
-------------------------+--------------+------------------------------------------------------------------------------------------------------------
 script-v1.0.schema.json | True         | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/tutorials/pass_returncode.yml



name                      description
------------------------  ---------------------------------------------------
exit1_fail                exit 1 by default is FAIL
exit1_pass                report exit 1 as PASS
returncode_list_mismatch  exit 2 failed since it failed to match returncode 1
returncode_int_match      exit 128 matches returncode 128
exit1_fail                exit 1 by default is FAIL
exit1_pass                report exit 1 as PASS
returncode_list_mismatch  exit 2 failed since it failed to match returncode 1
returncode_int_match      exit 128 matches returncode 128

+----------------------+
| Stage: Building Test |
+----------------------+ 

 name                     | id       | type   | executor         | tags                  | testpath
--------------------------+----------+--------+------------------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 exit1_fail               | 16429a3c | script | generic.local.sh | ['tutorials', 'fail'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_fail/3/exit1_fail_build.sh
 exit1_pass               | 1438fb0e | script | generic.local.sh | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_pass/4/exit1_pass_build.sh
 returncode_list_mismatch | a22198e9 | script | generic.local.sh | ['tutorials', 'fail'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_list_mismatch/3/returncode_list_mismatch_build.sh
 returncode_int_match     | dac89b86 | script | generic.local.sh | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_int_match/4/returncode_int_match_build.sh
 exit1_fail               | 7714d388 | script | generic.local.sh | ['tutorials', 'fail'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_fail/4/exit1_fail_build.sh
 exit1_pass               | fa9cc65e | script | generic.local.sh | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/exit1_pass/5/exit1_pass_build.sh
 returncode_list_mismatch | eca6beab | script | generic.local.sh | ['tutorials', 'fail'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_list_mismatch/4/returncode_list_mismatch_build.sh
 returncode_int_match     | 073ecd6f | script | generic.local.sh | ['tutorials', 'pass'] | /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/var/tests/generic.local.sh/pass_returncode/returncode_int_match/5/returncode_int_match_build.sh





+---------------------+
| Stage: Running Test |
+---------------------+ 

 name                     | id       | executor         | status   |   returncode
--------------------------+----------+------------------+----------+--------------
 exit1_fail               | 16429a3c | generic.local.sh | FAIL     |            1
 exit1_pass               | 1438fb0e | generic.local.sh | PASS     |            1
 returncode_list_mismatch | a22198e9 | generic.local.sh | FAIL     |            2
 returncode_int_match     | dac89b86 | generic.local.sh | PASS     |          128
 exit1_fail               | 7714d388 | generic.local.sh | FAIL     |            1
 exit1_pass               | fa9cc65e | generic.local.sh | PASS     |            1
 returncode_list_mismatch | eca6beab | generic.local.sh | FAIL     |            2
 returncode_int_match     | 073ecd6f | generic.local.sh | PASS     |          128

+----------------------+
| Stage: Test Summary  |
+----------------------+ 
    
Passed Tests: 4/8 Percentage: 50.000%
Failed Tests: 4/8 Percentage: 50.000%


Writing Logfile to: /tmp/buildtest_ijf40bj3.log
A copy of logfile can be found at $BUILDTEST_ROOT/buildtest.log -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest.log

The rebuild option expects a range between 1-50, the --rebuild=1 is equivalent to running without --rebuild option. We set a max limit for rebuild option to avoid system degredation due to high workload.

If you try to exceed this bound you will get an error such as

$ buildtest build -b tutorials/pass_returncode.yml --rebuild 51
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/bin/buildtest", line 17, in <module>
    buildtest.main.main()
  File "/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/main.py", line 86, in main
    keep_stage_dir=args.keep_stage_dir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v0.10.1/buildtest/cli/build.py", line 461, in __init__
    f"--rebuild {rebuild} exceeds maximum rebuild limit of 50"
buildtest.exceptions.BuildTestError: '--rebuild 51 exceeds maximum rebuild limit of 50'

Use Alternate Configuration file

If you want to use an alternate configuration file when building test you can use buildtest -c <config> build. buildtest will prefer configuration file on command line over the user configuration ($HOME/.buildtest/config.yml). For more details see Which configuration file does buildtest read?.

Keeping Stage Directory

buildtest will create setup the test environment in the stage directory where test will be executed. Once test is complete, buildtest will remove the stage directory. If you want to preserve the stage directory you can use buildtest build --keep-stage-dir, this is only useful if you want to run the test manually