Query Test Report

buildtest keeps track of all tests and results in a JSON file. This file is read by buildtest report command to extract certain fields from JSON file and display them in table format. Shown below is command usage to query test reports.

buildtest report --help
$ buildtest report --help
usage: buildtest [options] [COMMANDS] report [-h] [--pager] [--row-count]
                                             [--terse] [-n] [-c COUNT]
                                             [--filter FILTER] [--helpfilter]
                                             [--filterfields] [--helpformat]
                                             [--formatfields] [--latest]
                                             [--oldest] [-s START] [-e END]
                                             [-f | -p] [--format FORMAT | -d]
                                             ...

optional arguments:
  -h, --help            show this help message and exit
  --pager               Enable PAGING when viewing result
  --row-count           Display number of rows from query shown in table
  --terse               Print output in machine readable format
  -n, --no-header       Do not print header columns in terse output (--terse)
  -c COUNT, --count COUNT
                        Retrieve limited number of rows that get printed
  -f, --fail            Retrieve all FAIL tests
  -p, --pass            Retrieve all PASS tests
  --format FORMAT       Format field for printing purposes. Fields must be
                        separated by commas (e.g., --format
                        field1,field2,...).
  -d, --detailed        Print a detailed summary of the test results

subcommands:
  Fetch test results from the report file and print them in table format

  
    clear (c)           Remove all report files
    list (ls)           List all report files
    path (p)            Print full path to the report file being used
    summary (sm)        Summarize test report

filter:
  --filter FILTER       Filter report by filter fields. The filter fields must
                        be in key=value format and multiple fields can be
                        comma separated (e.g., --filter key1=val1,key2=val2).
                        For a list of filter fields, run --helpfilter.
  --helpfilter          List available filter fields to be used with --filter
                        option
  --filterfields        Print raw filter fields for --filter option to filter
                        the report

format:
  --helpformat          List available format fields to be used with --format
                        option
  --formatfields        Print raw format fields for --format option to format
                        the report

extra:
  --latest              Retrieve latest record of a particular test
  --oldest              Retrieve oldest record of a particular test
  -s START, --start START
                        Filter test by starttime
  -e END, --end END     Filter test by endtime

You may run buildtest report without any option, and buildtest will display all test results with default format fields. To see a list of all format fields, click here.

buildtest report
$ buildtest report
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ name                         ┃ id         ┃ state  ┃ runtime   ┃ returncode  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ variables_bash               │ 26a15409   │ PASS   │ 0.0142    │ 0           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
│ variables_bash               │ f432ceff   │ PASS   │ 0.009858  │ 0           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
│ variables_bash               │ 77b12d9e   │ PASS   │ 0.010068  │ 0           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
│ variables_bash               │ 02dc085d   │ PASS   │ 0.010154  │ 0           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
│ variables_bash               │ b6711492   │ PASS   │ 0.010002  │ 0           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
│ returncode_list_mismatch     │ 1b4070f0   │ FAIL   │ 0.014182  │ 2           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
│ returncode_list_mismatch     │ 445cf9cb   │ FAIL   │ 0.014693  │ 2           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
│ returncode_list_mismatch     │ e3cf96cf   │ FAIL   │ 0.015648  │ 2           │
├──────────────────────────────┼────────────┼────────┼───────────┼─────────────┤
...

You can run buildtest report path command to get the full path to the report file being used. This is helpful when the report file is not known in that case one can print the file by doing cat $(buildtest report path).

buildtest report path
$ buildtest report path
/tmp/tmpq07_ocbs/var/report.json

The buildtest report command will fetch all records and display them in a table format, if you want to know how many records are displayed in the table you can use buildtest report --row-count which will display a raw count of records in the table. In the example below we will run buildtest report --row-count which will show number of tests in the report.

buildtest report --row-count
$ buildtest report --row-count
25

You may find it useful to fetch all failed records and determine pass/fail criteria as part of your shell script, this can be done by running buildtest report --row-count --fail as shown below.

buildtest report --row-count --fail
$ buildtest report --row-count --fail
25

Note

buildtest rt is an alias for buildtest report command.

Detailed Reports (buildtest report --detailed)

The buildtest report –detailed option can be used to show a detailed test report that may be of interest when examining a test. This option is synonymous to running buildtest report --format name,id,user,state,returncode, runtime,outfile,errfile,buildspec. Shown below is an example output.

buildtest report --detailed
$ buildtest report --detailed
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━┳━━━━━━━━┳━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
┃        ┃        ┃      ┃       ┃ return ┃ runtim ┃ outfil ┃ errfil ┃ buildsp ┃
┃ name   ┃ id     ┃ user ┃ state ┃ code   ┃ e      ┃ e      ┃ e      ┃ ec      ┃
┡━━━━━━━━╇━━━━━━━━╇━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
│ variab │ 26a154 │ docs │ PASS  │ 0      │ 0.0142 │ /tmp/t │ /tmp/t │ /home/d │
│ les_ba │ 09     │      │       │        │        │ mpq07_ │ mpq07_ │ ocs/che │
│ sh     │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/va │ ash/va │ buildte │
│        │        │      │       │        │        │ rs/var │ rs/var │ st/chec │
│        │        │      │       │        │        │ iables │ iables │ kouts/d │
│        │        │      │       │        │        │ _bash/ │ _bash/ │ evel/tu │
│        │        │      │       │        │        │ 26a154 │ 26a154 │ torials │
│        │        │      │       │        │        │ 09/var │ 09/var │ /vars.y │
│        │        │      │       │        │        │ iables │ iables │ ml      │
│        │        │      │       │        │        │ _bash. │ _bash. │         │
│        │        │      │       │        │        │ out    │ err    │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ variab │ f432ce │ docs │ PASS  │ 0      │ 0.0098 │ /tmp/t │ /tmp/t │ /home/d │
│ les_ba │ ff     │      │       │        │ 58     │ mpq07_ │ mpq07_ │ ocs/che │
│ sh     │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/va │ ash/va │ buildte │
│        │        │      │       │        │        │ rs/var │ rs/var │ st/chec │
│        │        │      │       │        │        │ iables │ iables │ kouts/d │
│        │        │      │       │        │        │ _bash/ │ _bash/ │ evel/tu │
│        │        │      │       │        │        │ f432ce │ f432ce │ torials │
│        │        │      │       │        │        │ ff/var │ ff/var │ /vars.y │
│        │        │      │       │        │        │ iables │ iables │ ml      │
│        │        │      │       │        │        │ _bash. │ _bash. │         │
│        │        │      │       │        │        │ out    │ err    │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ variab │ 77b12d │ docs │ PASS  │ 0      │ 0.0100 │ /tmp/t │ /tmp/t │ /home/d │
│ les_ba │ 9e     │      │       │        │ 68     │ mpq07_ │ mpq07_ │ ocs/che │
│ sh     │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/va │ ash/va │ buildte │
│        │        │      │       │        │        │ rs/var │ rs/var │ st/chec │
│        │        │      │       │        │        │ iables │ iables │ kouts/d │
│        │        │      │       │        │        │ _bash/ │ _bash/ │ evel/tu │
│        │        │      │       │        │        │ 77b12d │ 77b12d │ torials │
│        │        │      │       │        │        │ 9e/var │ 9e/var │ /vars.y │
│        │        │      │       │        │        │ iables │ iables │ ml      │
│        │        │      │       │        │        │ _bash. │ _bash. │         │
│        │        │      │       │        │        │ out    │ err    │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ variab │ 02dc08 │ docs │ PASS  │ 0      │ 0.0101 │ /tmp/t │ /tmp/t │ /home/d │
│ les_ba │ 5d     │      │       │        │ 54     │ mpq07_ │ mpq07_ │ ocs/che │
│ sh     │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/va │ ash/va │ buildte │
│        │        │      │       │        │        │ rs/var │ rs/var │ st/chec │
│        │        │      │       │        │        │ iables │ iables │ kouts/d │
│        │        │      │       │        │        │ _bash/ │ _bash/ │ evel/tu │
│        │        │      │       │        │        │ 02dc08 │ 02dc08 │ torials │
│        │        │      │       │        │        │ 5d/var │ 5d/var │ /vars.y │
│        │        │      │       │        │        │ iables │ iables │ ml      │
│        │        │      │       │        │        │ _bash. │ _bash. │         │
│        │        │      │       │        │        │ out    │ err    │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ variab │ b67114 │ docs │ PASS  │ 0      │ 0.0100 │ /tmp/t │ /tmp/t │ /home/d │
│ les_ba │ 92     │      │       │        │ 02     │ mpq07_ │ mpq07_ │ ocs/che │
│ sh     │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/va │ ash/va │ buildte │
│        │        │      │       │        │        │ rs/var │ rs/var │ st/chec │
│        │        │      │       │        │        │ iables │ iables │ kouts/d │
│        │        │      │       │        │        │ _bash/ │ _bash/ │ evel/tu │
│        │        │      │       │        │        │ b67114 │ b67114 │ torials │
│        │        │      │       │        │        │ 92/var │ 92/var │ /vars.y │
│        │        │      │       │        │        │ iables │ iables │ ml      │
│        │        │      │       │        │        │ _bash. │ _bash. │         │
│        │        │      │       │        │        │ out    │ err    │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ 1b4070 │ docs │ FAIL  │ 2      │ 0.0141 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ f0     │      │       │        │ 82     │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/1b4 │ ch/1b4 │ ass_ret │
│        │        │      │       │        │        │ 070f0/ │ 070f0/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ 445cf9 │ docs │ FAIL  │ 2      │ 0.0146 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ cb     │      │       │        │ 93     │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/445 │ ch/445 │ ass_ret │
│        │        │      │       │        │        │ cf9cb/ │ cf9cb/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ e3cf96 │ docs │ FAIL  │ 2      │ 0.0156 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ cf     │      │       │        │ 48     │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/e3c │ ch/e3c │ ass_ret │
│        │        │      │       │        │        │ f96cf/ │ f96cf/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ ce179e │ docs │ FAIL  │ 2      │ 0.0160 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ f0     │      │       │        │ 75     │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/ce1 │ ch/ce1 │ ass_ret │
│        │        │      │       │        │        │ 79ef0/ │ 79ef0/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ ebbda3 │ docs │ FAIL  │ 2      │ 0.0156 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ 54     │      │       │        │ 1      │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/ebb │ ch/ebb │ ass_ret │
│        │        │      │       │        │        │ da354/ │ da354/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ b8fba5 │ docs │ FAIL  │ 2      │ 0.0144 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ af     │      │       │        │ 58     │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/b8f │ ch/b8f │ ass_ret │
│        │        │      │       │        │        │ ba5af/ │ ba5af/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ 88196c │ docs │ FAIL  │ 2      │ 0.0148 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ 27     │      │       │        │ 15     │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/881 │ ch/881 │ ass_ret │
│        │        │      │       │        │        │ 96c27/ │ 96c27/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ return │ 5a6a49 │ docs │ FAIL  │ 2      │ 0.0151 │ /tmp/t │ /tmp/t │ /home/d │
│ code_l │ c2     │      │       │        │ 49     │ mpq07_ │ mpq07_ │ ocs/che │
│ ist_mi │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│ smatch │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/retu │ e/retu │ evel/tu │
│        │        │      │       │        │        │ rncode │ rncode │ torials │
│        │        │      │       │        │        │ _list_ │ _list_ │ /test_s │
│        │        │      │       │        │        │ mismat │ mismat │ tatus/p │
│        │        │      │       │        │        │ ch/5a6 │ ch/5a6 │ ass_ret │
│        │        │      │       │        │        │ a49c2/ │ a49c2/ │ urncode │
│        │        │      │       │        │        │ return │ return │ .yml    │
│        │        │      │       │        │        │ code_l │ code_l │         │
│        │        │      │       │        │        │ ist_mi │ ist_mi │         │
│        │        │      │       │        │        │ smatch │ smatch │         │
│        │        │      │       │        │        │ .out   │ .err   │         │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ b72ed6 │ docs │ FAIL  │ 1      │ 0.0146 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ 65     │      │       │        │ 68     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /b72ed │ /b72ed │ /test_s │
│        │        │      │       │        │        │ 665/ex │ 665/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ c32d00 │ docs │ FAIL  │ 1      │ 0.0142 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ e5     │      │       │        │ 15     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /c32d0 │ /c32d0 │ /test_s │
│        │        │      │       │        │        │ 0e5/ex │ 0e5/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ 34b13a │ docs │ FAIL  │ 1      │ 0.0149 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ 0d     │      │       │        │ 9      │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /34b13 │ /34b13 │ /test_s │
│        │        │      │       │        │        │ a0d/ex │ a0d/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ f7971f │ docs │ FAIL  │ 1      │ 0.0151 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ 42     │      │       │        │ 83     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /f7971 │ /f7971 │ /test_s │
│        │        │      │       │        │        │ f42/ex │ f42/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ e6e8d6 │ docs │ FAIL  │ 1      │ 0.0152 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ e5     │      │       │        │ 4      │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /e6e8d │ /e6e8d │ /test_s │
│        │        │      │       │        │        │ 6e5/ex │ 6e5/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ 791b81 │ docs │ FAIL  │ 1      │ 0.0157 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ 4a     │      │       │        │ 99     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /791b8 │ /791b8 │ /test_s │
│        │        │      │       │        │        │ 14a/ex │ 14a/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ 4e4c3f │ docs │ FAIL  │ 1      │ 0.0152 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ 19     │      │       │        │ 02     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /4e4c3 │ /4e4c3 │ /test_s │
│        │        │      │       │        │        │ f19/ex │ f19/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ 573432 │ docs │ FAIL  │ 1      │ 0.0146 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ 18     │      │       │        │ 74     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /57343 │ /57343 │ /test_s │
│        │        │      │       │        │        │ 218/ex │ 218/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ 6dee43 │ docs │ FAIL  │ 1      │ 0.0163 │ /tmp/t │ /tmp/t │ /home/d │
│ fail   │ bb     │      │       │        │ 96     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_fail │ 1_fail │ torials │
│        │        │      │       │        │        │ /6dee4 │ /6dee4 │ /test_s │
│        │        │      │       │        │        │ 3bb/ex │ 3bb/ex │ tatus/p │
│        │        │      │       │        │        │ it1_fa │ it1_fa │ ass_ret │
│        │        │      │       │        │        │ il.out │ il.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ ba20e2 │ docs │ PASS  │ 1      │ 0.0143 │ /tmp/t │ /tmp/t │ /home/d │
│ pass   │ 6d     │      │       │        │ 6      │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_pass │ 1_pass │ torials │
│        │        │      │       │        │        │ /ba20e │ /ba20e │ /test_s │
│        │        │      │       │        │        │ 26d/ex │ 26d/ex │ tatus/p │
│        │        │      │       │        │        │ it1_pa │ it1_pa │ ass_ret │
│        │        │      │       │        │        │ ss.out │ ss.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ c9fbc1 │ docs │ PASS  │ 1      │ 0.0157 │ /tmp/t │ /tmp/t │ /home/d │
│ pass   │ 8c     │      │       │        │ 1      │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_pass │ 1_pass │ torials │
│        │        │      │       │        │        │ /c9fbc │ /c9fbc │ /test_s │
│        │        │      │       │        │        │ 18c/ex │ 18c/ex │ tatus/p │
│        │        │      │       │        │        │ it1_pa │ it1_pa │ ass_ret │
│        │        │      │       │        │        │ ss.out │ ss.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
├────────┼────────┼──────┼───────┼────────┼────────┼────────┼────────┼─────────┤
│ exit1_ │ eb233c │ docs │ PASS  │ 1      │ 0.0146 │ /tmp/t │ /tmp/t │ /home/d │
│ pass   │ 15     │      │       │        │ 61     │ mpq07_ │ mpq07_ │ ocs/che │
│        │        │      │       │        │        │ ocbs/v │ ocbs/v │ ckouts/ │
│        │        │      │       │        │        │ ar/tes │ ar/tes │ readthe │
│        │        │      │       │        │        │ ts/gen │ ts/gen │ docs.or │
│        │        │      │       │        │        │ eric.l │ eric.l │ g/user_ │
│        │        │      │       │        │        │ ocal.b │ ocal.b │ builds/ │
│        │        │      │       │        │        │ ash/pa │ ash/pa │ buildte │
│        │        │      │       │        │        │ ss_ret │ ss_ret │ st/chec │
│        │        │      │       │        │        │ urncod │ urncod │ kouts/d │
│        │        │      │       │        │        │ e/exit │ e/exit │ evel/tu │
│        │        │      │       │        │        │ 1_pass │ 1_pass │ torials │
│        │        │      │       │        │        │ /eb233 │ /eb233 │ /test_s │
│        │        │      │       │        │        │ c15/ex │ c15/ex │ tatus/p │
│        │        │      │       │        │        │ it1_pa │ it1_pa │ ass_ret │
│        │        │      │       │        │        │ ss.out │ ss.err │ urncode │
│        │        │      │       │        │        │        │        │ .yml    │
└────────┴────────┴──────┴───────┴────────┴────────┴────────┴────────┴─────────┘

Note

The --detailed and --format options are mutually exclusive options because both options will alter the format fields when displaying test results.

You will get the following error if you specify both options as shown below

buildtest report --detailed --format name
$ buildtest report --detailed --format name
usage: buildtest [options] [COMMANDS] report [-h] [--pager] [--row-count]
                                             [--terse] [-n] [-c COUNT]
                                             [--filter FILTER] [--helpfilter]
                                             [--filterfields] [--helpformat]
                                             [--formatfields] [--latest]
                                             [--oldest] [-s START] [-e END]
                                             [-f | -p] [--format FORMAT | -d]
                                             ...
buildtest [options] [COMMANDS] report: error: argument --format: not allowed with argument -d/--detailed

Format Reports (buildtest report --format)

The buildtest report command displays a default format fields that can be changed using the --format option. The report file (JSON) contains many more fields and we expose some of the fields with the –format option. To see a list of available format fields you can run buildtest report --helpformat. This option will list all format fields with their description.

buildtest report --helpformat
$ buildtest report --helpformat
                          Format Fields                          
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Field      ┃ Description                                      ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ buildspec  │ Buildspec File                                   │
│ buildenv   │ Show build environment file for test             │
│ command    │ Command executed                                 │
│ compiler   │ Retrieve compiler used for test                  │
│ endtime    │ End Time for test                                │
│ errfile    │ Error File                                       │
│ executor   │ Name of executor used for running test           │
│ hostname   │ Hostname of machine where job was submitted from │
│ full_id    │ Fully qualified build identifier                 │
│ id         │ Unique build identifier                          │
│ metrics    │ List all metrics for test                        │
│ name       │ Name of test                                     │
│ outfile    │ Output file                                      │
│ returncode │ Return Code                                      │
│ runtime    │ Total runtime in seconds                         │
│ schemafile │ Schema file used for validating test             │
│ starttime  │ Start time of test                               │
│ state      │ State of test (PASS/FAIL)                        │
│ tags       │ Tag name                                         │
│ testroot   │ Root of test directory                           │
│ testpath   │ Path to test                                     │
│ user       │ User who ran the test                            │
└────────────┴──────────────────────────────────────────────────┘

To print just the raw format fields use the command buildtest report --formatfields.

buildtest report --formatfields
$ buildtest report --formatfields
buildspec
buildenv
command
compiler
endtime
errfile
executor
hostname
full_id
id
metrics
name
outfile
returncode
runtime
schemafile
starttime
state
tags
testroot
testpath
user

Format Field Usage

The --format field are specified in comma separated format (i.e --format <field1>,<field2>). In this example we format table by fields --format id,executor,state,returncode.

buildtest rt --format name,id,executor,state,returncode
$ buildtest rt --format name,id,executor,state,returncode
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┓
┃ name                    ┃ id       ┃ executor           ┃ state ┃ returncode ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━┩
│ variables_bash          │ 26a15409 │ generic.local.bash │ PASS  │ 0          │
├─────────────────────────┼──────────┼────────────────────┼───────┼────────────┤
│ variables_bash          │ f432ceff │ generic.local.bash │ PASS  │ 0          │
├─────────────────────────┼──────────┼────────────────────┼───────┼────────────┤
│ variables_bash          │ 77b12d9e │ generic.local.bash │ PASS  │ 0          │
├─────────────────────────┼──────────┼────────────────────┼───────┼────────────┤
│ variables_bash          │ 02dc085d │ generic.local.bash │ PASS  │ 0          │
├─────────────────────────┼──────────┼────────────────────┼───────┼────────────┤
│ variables_bash          │ b6711492 │ generic.local.bash │ PASS  │ 0          │
├─────────────────────────┼──────────┼────────────────────┼───────┼────────────┤
│ returncode_list_mismatc │ 1b4070f0 │ generic.local.bash │ FAIL  │ 2          │
│ h                       │          │                    │       │            │
├─────────────────────────┼──────────┼────────────────────┼───────┼────────────┤
│ returncode_list_mismatc │ 445cf9cb │ generic.local.bash │ FAIL  │ 2          │
│ h                       │          │                    │       │            │
├─────────────────────────┼──────────┼────────────────────┼───────┼────────────┤
│ returncode_list_mismatc │ e3cf96cf │ generic.local.bash │ FAIL  │ 2          │
...

Filter Reports (buildtest report --filter)

The buildtest report command will display all tests results, which can be quite long depending on number of tests so therefore we need a mechanism to filter the test results. The --filter option can be used to filter out tests in the output based on filter fields. First, lets see the available filter fields by run buildtest report --helpfilter which shows a list of filter fields and their description.

buildtest report --helpfilter
$ buildtest report --helpfilter
                       Filter Fields                        
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Field      ┃ Description                ┃ Expected Value ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ buildspec  │ Filter by buildspec file   │ FILE           │
│ name       │ Filter by test name        │ STRING         │
│ executor   │ Filter by executor name    │ STRING         │
│ returncode │ Filter tests by returncode │ INT            │
│ state      │ Filter by test state       │ PASS/FAIL      │
│ tags       │ Filter tests by tag name   │ STRING         │
└────────────┴────────────────────────────┴────────────────┘

To print just the raw filter fields use the command buildtest report --filterfields.

buildtest report --filterfields
$ buildtest report --filterfields
buildspec
name
executor
returncode
state
tags

The --filter option expects arguments in key=value format. You can specify multiple filter delimited by comma. buildtest will treat multiple filters as logical AND operation. The filter option can be used with --format field. Let’s see some examples to illustrate the point.

Filter by returncode (--filter returncode)

If you want to retrieve all tests with a given returncode, we can use the returncode property. For instance, let’s retrieve all tests with returncode of 2 by setting --filter returncode=2.

buildtest rt --filter returncode=2 --format=name,id,returncode
$ buildtest rt --filter returncode=2 --format=name,id,returncode
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ name                                     ┃ id             ┃ returncode       ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│ returncode_list_mismatch                 │ 1b4070f0       │ 2                │
├──────────────────────────────────────────┼────────────────┼──────────────────┤
│ returncode_list_mismatch                 │ 445cf9cb       │ 2                │
├──────────────────────────────────────────┼────────────────┼──────────────────┤
│ returncode_list_mismatch                 │ e3cf96cf       │ 2                │
├──────────────────────────────────────────┼────────────────┼──────────────────┤
│ returncode_list_mismatch                 │ ce179ef0       │ 2                │
├──────────────────────────────────────────┼────────────────┼──────────────────┤
│ returncode_list_mismatch                 │ ebbda354       │ 2                │
├──────────────────────────────────────────┼────────────────┼──────────────────┤
│ returncode_list_mismatch                 │ b8fba5af       │ 2                │
├──────────────────────────────────────────┼────────────────┼──────────────────┤
│ returncode_list_mismatch                 │ 88196c27       │ 2                │
├──────────────────────────────────────────┼────────────────┼──────────────────┤
│ returncode_list_mismatch                 │ 5a6a49c2       │ 2                │
└──────────────────────────────────────────┴────────────────┴──────────────────┘

Note

buildtest automatically converts returncode to integer when matching returncode, so --filter returncode="2" will work too

Filter by test name (--filter name)

If you want to filter by test name, use the name attribute in filter option. Let’s assume we want to filter all tests by name exit1_pass, this can be achieved by setting filter field as follows: --filter name=exit1_pass. Shown below is an example using name filter field to filter test results.

buildtest rt --filter name=exit1_pass --format=name,id,returncode,state
$ buildtest rt --filter name=exit1_pass --format=name,id,returncode,state
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ name                 ┃ id                ┃ returncode           ┃ state      ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ exit1_pass           │ ba20e26d          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ c9fbc18c          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ eb233c15          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ b4a194ad          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ 396cb9a9          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ 4af07718          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ d274c7ac          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ 7a174e27          │ 1                    │ PASS       │
├──────────────────────┼───────────────────┼──────────────────────┼────────────┤
│ exit1_pass           │ 23e23699          │ 1                    │ PASS       │
└──────────────────────┴───────────────────┴──────────────────────┴────────────┘

Filter by buildspec (--filter buildspec)

Likewise, we can filter results by buildspec file using buildspec attribute via --filter buildspec=<file>. The buildspec attribute must resolve to a file path which can be relative or absolute path. buildtest will resolve path (absolute path) and find the appropriate tests that belong to the buildspec file. If file doesn’t exist or is not found in cache it will raise an error.

buildtest rt --filter buildspec=tutorials/python-hello.yml --format=name,id,state,buildspec
$ buildtest rt --filter buildspec=tutorials/python-hello.yml --format=name,id,state,buildspec
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name         ┃ id       ┃ state ┃ buildspec                                  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ python_hello │ ae816c22 │ PASS  │ /home/docs/checkouts/readthedocs.org/user_ │
│              │          │       │ builds/buildtest/checkouts/devel/tutorials │
│              │          │       │ /python-hello.yml                          │
├──────────────┼──────────┼───────┼────────────────────────────────────────────┤
│ python_hello │ 36a3b0da │ PASS  │ /home/docs/checkouts/readthedocs.org/user_ │
│              │          │       │ builds/buildtest/checkouts/devel/tutorials │
│              │          │       │ /python-hello.yml                          │
├──────────────┼──────────┼───────┼────────────────────────────────────────────┤
│ python_hello │ 3bcd9103 │ PASS  │ /home/docs/checkouts/readthedocs.org/user_ │
│              │          │       │ builds/buildtest/checkouts/devel/tutorials │
│              │          │       │ /python-hello.yml                          │
├──────────────┼──────────┼───────┼────────────────────────────────────────────┤
│ python_hello │ a56a8946 │ PASS  │ /home/docs/checkouts/readthedocs.org/user_ │
│              │          │       │ builds/buildtest/checkouts/devel/tutorials │
│              │          │       │ /python-hello.yml                          │
└──────────────┴──────────┴───────┴────────────────────────────────────────────┘

Filter by test state (--filter state)

If you want to filter results by test state, use the state property. This can be useful if you want to know all pass or failed tests. The state property expects value of [PASS|FAIL] since these are the two recorded test states marked by buildtest. We can also pass multiple filter fields for instance if we want to find all FAIL tests for executor generic.local.sh we can do the following.

buildtest rt --filter state=FAIL,executor=generic.local.sh --format=name,id,state,executor
$ buildtest rt --filter state=FAIL,executor=generic.local.sh --format=name,id,state,executor
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
┃ name                             ┃ id         ┃ state   ┃ executor           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
│ timelimit_max_fail               │ 0942faed   │ FAIL    │ generic.local.sh   │
├──────────────────────────────────┼────────────┼─────────┼────────────────────┤
│ timelimit_min_fail               │ 7bff2900   │ FAIL    │ generic.local.sh   │
├──────────────────────────────────┼────────────┼─────────┼────────────────────┤
│ always_fail                      │ b2ba3ea6   │ FAIL    │ generic.local.sh   │
├──────────────────────────────────┼────────────┼─────────┼────────────────────┤
│ test_fail_returncode_match       │ 82cc863f   │ FAIL    │ generic.local.sh   │
└──────────────────────────────────┴────────────┴─────────┴────────────────────┘

Filter Exception Cases

The returncode filter field expects an integer value, so if you try a non-integer returncode you will get the following message

buildtest rt --filter returncode=1.5
$ buildtest rt --filter returncode=1.5
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ in/buildtest:38 in <module>                                                  │
│                                                                              │
│   35                                                                         │
│   36 if __name__ == "__main__":                                              │
│   37                                                                         │
│ ❱ 38   sys.exit(main())                                                      │
│   39                                                                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ buildtest_file = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │           main = <function main at 0x7ff84780bee0>                       │ │
│ │             os = <module 'os' from                                       │ │
│ │                  '/home/docs/.asdf/installs/python/3.8.18/lib/python3.8… │ │
│ │         prefix = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │            sys = <module 'sys' (built-in)>                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/main.py:301 in main                                                 │
│                                                                              │
│   298 │                                                                      │
│   299 │   # buildtest report                                                 │
│   300 │   elif args.subcommands in ["report", "rt"]:                         │
│ ❱ 301 │   │   report_cmd(args, configuration=configuration, report_file=repo │
│   302 │                                                                      │
│   303 │   elif args.subcommands == "path":                                   │
│   304 │   │   path_cmd(                                                      │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             args = Namespace(color=None, configfile=None, count=None,    │ │
│ │                    debug=False, detailed=False, editor=None, end=None,   │ │
│ │                    fail=False, filter={'returncode': '1.5'},             │ │
│ │                    filterfields=False, format=None, formatfields=False,  │ │
│ │                    helpcolor=False, helpfilter=False, helpformat=False,  │ │
│ │                    latest=False, loglevel='DEBUG', logpath=False,        │ │
│ │                    no_color=False, no_header=False, oldest=False,        │ │
│ │                    pager=False, passed=False, print_log=False,           │ │
│ │                    report=None, report_subcommand=None, row_count=False, │ │
│ │                    start=None, subcommands='rt', terse=False,            │ │
│ │                    view_log=False)                                       │ │
│ │ buildtest_editor = '/usr/bin/vim'                                        │ │
│ │      config_file = None                                                  │ │
│ │    configuration = <buildtest.config.SiteConfiguration object at         │ │
│ │                    0x7ff84599f6a0>                                       │ │
│ │           logger = <Logger buildtest (DEBUG)>                            │ │
│ │         no_color = False                                                 │ │
│ │           parser = <buildtest.cli.BuildTestParser object at              │ │
│ │                    0x7ff8478afa90>                                       │ │
│ │      report_file = None                                                  │ │
│ │           system = <buildtest.system.BuildTestSystem object at           │ │
│ │                    0x7ff84599f1c0>                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:849 in report_cmd                                     │
│                                                                              │
│   846 │   │   list_report()                                                  │
│   847 │   │   return                                                         │
│   848 │                                                                      │
│ ❱ 849 │   results = Report(                                                  │
│   850 │   │   configuration=configuration,                                   │
│   851 │   │   filter_args=args.filter,                                       │
│   852 │   │   format_args=args.format,                                       │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │          args = Namespace(color=None, configfile=None, count=None,       │ │
│ │                 debug=False, detailed=False, editor=None, end=None,      │ │
│ │                 fail=False, filter={'returncode': '1.5'},                │ │
│ │                 filterfields=False, format=None, formatfields=False,     │ │
│ │                 helpcolor=False, helpfilter=False, helpformat=False,     │ │
│ │                 latest=False, loglevel='DEBUG', logpath=False,           │ │
│ │                 no_color=False, no_header=False, oldest=False,           │ │
│ │                 pager=False, passed=False, print_log=False, report=None, │ │
│ │                 report_subcommand=None, row_count=False, start=None,     │ │
│ │                 subcommands='rt', terse=False, view_log=False)           │ │
│ │ configuration = <buildtest.config.SiteConfiguration object at            │ │
│ │                 0x7ff84599f6a0>                                          │ │
│ │  consoleColor = 'default'                                                │ │
│ │         pager = False                                                    │ │
│ │   report_file = None                                                     │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:155 in __init__                                       │
│                                                                              │
│   152 │   │   │   self._reportfile = resolve_path(report_file)               │
│   153 │   │                                                                  │
│   154 │   │   self.report = self.load()                                      │
│ ❱ 155 │   │   self._check_filter_fields()                                    │
│   156 │   │   self._check_format_fields()                                    │
│   157 │   │   self._check_start_and_end_fields()                             │
│   158 │   │   self.filter_buildspecs_from_report()                           │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │           color = None                                                   │ │
│ │   configuration = <buildtest.config.SiteConfiguration object at          │ │
│ │                   0x7ff84599f6a0>                                        │ │
│ │           count = None                                                   │ │
│ │        detailed = None                                                   │ │
│ │             end = None                                                   │ │
│ │         failure = False                                                  │ │
│ │     filter_args = {'returncode': '1.5'}                                  │ │
│ │     format_args = None                                                   │ │
│ │ format_detailed = False                                                  │ │
│ │          latest = False                                                  │ │
│ │          oldest = False                                                  │ │
│ │           pager = None                                                   │ │
│ │          passed = False                                                  │ │
│ │     report_file = None                                                   │ │
│ │            self = <buildtest.cli.report.Report object at 0x7ff845994940> │ │
│ │           start = None                                                   │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:191 in _check_filter_fields                           │
│                                                                              │
│   188 │   │   │   │   │   )                                                  │
│   189 │   │   │   │                                                          │
│   190 │   │   │   │   if key == "returncode" and not is_int(self.filter[key] │
│ ❱ 191 │   │   │   │   │   raise BuildTestError(                              │
│   192 │   │   │   │   │   │   f"Invalid returncode:{self.filter[key]} must b │
│   193 │   │   │   │   │   )                                                  │
│   194                                                                        │
│                                                                              │
│ ╭─────────────────────────── locals ────────────────────────────╮            │
│ │  key = 'returncode'                                           │            │
│ │ self = <buildtest.cli.report.Report object at 0x7ff845994940> │            │
│ ╰───────────────────────────────────────────────────────────────╯            │
╰──────────────────────────────────────────────────────────────────────────────╯
BuildTestError: 'Invalid returncode:1.5 must be an integer'

The state filter field expects value of PASS or FAIL so if you specify an invalid state you will get an error as follows.

buildtest rt --filter state=UNKNOWN
$ buildtest rt --filter state=UNKNOWN
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ in/buildtest:38 in <module>                                                  │
│                                                                              │
│   35                                                                         │
│   36 if __name__ == "__main__":                                              │
│   37                                                                         │
│ ❱ 38   sys.exit(main())                                                      │
│   39                                                                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ buildtest_file = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │           main = <function main at 0x7fd673cf2ee0>                       │ │
│ │             os = <module 'os' from                                       │ │
│ │                  '/home/docs/.asdf/installs/python/3.8.18/lib/python3.8… │ │
│ │         prefix = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │            sys = <module 'sys' (built-in)>                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/main.py:301 in main                                                 │
│                                                                              │
│   298 │                                                                      │
│   299 │   # buildtest report                                                 │
│   300 │   elif args.subcommands in ["report", "rt"]:                         │
│ ❱ 301 │   │   report_cmd(args, configuration=configuration, report_file=repo │
│   302 │                                                                      │
│   303 │   elif args.subcommands == "path":                                   │
│   304 │   │   path_cmd(                                                      │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             args = Namespace(color=None, configfile=None, count=None,    │ │
│ │                    debug=False, detailed=False, editor=None, end=None,   │ │
│ │                    fail=False, filter={'state': 'UNKNOWN'},              │ │
│ │                    filterfields=False, format=None, formatfields=False,  │ │
│ │                    helpcolor=False, helpfilter=False, helpformat=False,  │ │
│ │                    latest=False, loglevel='DEBUG', logpath=False,        │ │
│ │                    no_color=False, no_header=False, oldest=False,        │ │
│ │                    pager=False, passed=False, print_log=False,           │ │
│ │                    report=None, report_subcommand=None, row_count=False, │ │
│ │                    start=None, subcommands='rt', terse=False,            │ │
│ │                    view_log=False)                                       │ │
│ │ buildtest_editor = '/usr/bin/vim'                                        │ │
│ │      config_file = None                                                  │ │
│ │    configuration = <buildtest.config.SiteConfiguration object at         │ │
│ │                    0x7fd671e86700>                                       │ │
│ │           logger = <Logger buildtest (DEBUG)>                            │ │
│ │         no_color = False                                                 │ │
│ │           parser = <buildtest.cli.BuildTestParser object at              │ │
│ │                    0x7fd673d96a90>                                       │ │
│ │      report_file = None                                                  │ │
│ │           system = <buildtest.system.BuildTestSystem object at           │ │
│ │                    0x7fd671e86220>                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:849 in report_cmd                                     │
│                                                                              │
│   846 │   │   list_report()                                                  │
│   847 │   │   return                                                         │
│   848 │                                                                      │
│ ❱ 849 │   results = Report(                                                  │
│   850 │   │   configuration=configuration,                                   │
│   851 │   │   filter_args=args.filter,                                       │
│   852 │   │   format_args=args.format,                                       │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │          args = Namespace(color=None, configfile=None, count=None,       │ │
│ │                 debug=False, detailed=False, editor=None, end=None,      │ │
│ │                 fail=False, filter={'state': 'UNKNOWN'},                 │ │
│ │                 filterfields=False, format=None, formatfields=False,     │ │
│ │                 helpcolor=False, helpfilter=False, helpformat=False,     │ │
│ │                 latest=False, loglevel='DEBUG', logpath=False,           │ │
│ │                 no_color=False, no_header=False, oldest=False,           │ │
│ │                 pager=False, passed=False, print_log=False, report=None, │ │
│ │                 report_subcommand=None, row_count=False, start=None,     │ │
│ │                 subcommands='rt', terse=False, view_log=False)           │ │
│ │ configuration = <buildtest.config.SiteConfiguration object at            │ │
│ │                 0x7fd671e86700>                                          │ │
│ │  consoleColor = 'default'                                                │ │
│ │         pager = False                                                    │ │
│ │   report_file = None                                                     │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:158 in __init__                                       │
│                                                                              │
│   155 │   │   self._check_filter_fields()                                    │
│   156 │   │   self._check_format_fields()                                    │
│   157 │   │   self._check_start_and_end_fields()                             │
│ ❱ 158 │   │   self.filter_buildspecs_from_report()                           │
│   159 │   │                                                                  │
│   160 │   │   self.process_report()                                          │
│   161                                                                        │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │           color = None                                                   │ │
│ │   configuration = <buildtest.config.SiteConfiguration object at          │ │
│ │                   0x7fd671e86700>                                        │ │
│ │           count = None                                                   │ │
│ │        detailed = None                                                   │ │
│ │             end = None                                                   │ │
│ │         failure = False                                                  │ │
│ │     filter_args = {'state': 'UNKNOWN'}                                   │ │
│ │     format_args = None                                                   │ │
│ │ format_detailed = False                                                  │ │
│ │          latest = False                                                  │ │
│ │          oldest = False                                                  │ │
│ │           pager = None                                                   │ │
│ │          passed = False                                                  │ │
│ │     report_file = None                                                   │ │
│ │            self = <buildtest.cli.report.Report object at 0x7fd671e57640> │ │
│ │           start = None                                                   │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:323 in filter_buildspecs_from_report                  │
│                                                                              │
│   320 │   │   # ensure 'state' field in filter is either 'PASS' or 'FAIL', i │
│   321 │   │   if self.filter.get("state"):                                   │
│   322 │   │   │   if self.filter["state"] not in ["PASS", "FAIL"]:           │
│ ❱ 323 │   │   │   │   raise BuildTestError(                                  │
│   324 │   │   │   │   │   f"filter argument 'state' must be 'PASS' or 'FAIL' │
│   325 │   │   │   │   )                                                      │
│   326                                                                        │
│                                                                              │
│ ╭─────────────────────────── locals ────────────────────────────╮            │
│ │ self = <buildtest.cli.report.Report object at 0x7fd671e57640> │            │
│ ╰───────────────────────────────────────────────────────────────╯            │
╰──────────────────────────────────────────────────────────────────────────────╯
BuildTestError: "filter argument 'state' must be 'PASS' or 'FAIL' got value 
UNKNOWN"

The buildspec field expects a valid file path, it can be an absolute or relative path, buildtest will resolve absolute path and check if file exist and is in the report file. If it’s an invalid file we get an error such as

buildtest rt --filter buildspec=/path/to/invalid.yml
$ buildtest rt --filter buildspec=/path/to/invalid.yml
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ in/buildtest:38 in <module>                                                  │
│                                                                              │
│   35                                                                         │
│   36 if __name__ == "__main__":                                              │
│   37                                                                         │
│ ❱ 38   sys.exit(main())                                                      │
│   39                                                                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ buildtest_file = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │           main = <function main at 0x7ff39d481ee0>                       │ │
│ │             os = <module 'os' from                                       │ │
│ │                  '/home/docs/.asdf/installs/python/3.8.18/lib/python3.8… │ │
│ │         prefix = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │            sys = <module 'sys' (built-in)>                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/main.py:301 in main                                                 │
│                                                                              │
│   298 │                                                                      │
│   299 │   # buildtest report                                                 │
│   300 │   elif args.subcommands in ["report", "rt"]:                         │
│ ❱ 301 │   │   report_cmd(args, configuration=configuration, report_file=repo │
│   302 │                                                                      │
│   303 │   elif args.subcommands == "path":                                   │
│   304 │   │   path_cmd(                                                      │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             args = Namespace(color=None, configfile=None, count=None,    │ │
│ │                    debug=False, detailed=False, editor=None, end=None,   │ │
│ │                    fail=False, filter={'buildspec':                      │ │
│ │                    '/path/to/invalid.yml'}, filterfields=False,          │ │
│ │                    format=None, formatfields=False, helpcolor=False,     │ │
│ │                    helpfilter=False, helpformat=False, latest=False,     │ │
│ │                    loglevel='DEBUG', logpath=False, no_color=False,      │ │
│ │                    no_header=False, oldest=False, pager=False,           │ │
│ │                    passed=False, print_log=False, report=None,           │ │
│ │                    report_subcommand=None, row_count=False, start=None,  │ │
│ │                    subcommands='rt', terse=False, view_log=False)        │ │
│ │ buildtest_editor = '/usr/bin/vim'                                        │ │
│ │      config_file = None                                                  │ │
│ │    configuration = <buildtest.config.SiteConfiguration object at         │ │
│ │                    0x7ff39b6137c0>                                       │ │
│ │           logger = <Logger buildtest (DEBUG)>                            │ │
│ │         no_color = False                                                 │ │
│ │           parser = <buildtest.cli.BuildTestParser object at              │ │
│ │                    0x7ff39d525a90>                                       │ │
│ │      report_file = None                                                  │ │
│ │           system = <buildtest.system.BuildTestSystem object at           │ │
│ │                    0x7ff39b613190>                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:849 in report_cmd                                     │
│                                                                              │
│   846 │   │   list_report()                                                  │
│   847 │   │   return                                                         │
│   848 │                                                                      │
│ ❱ 849 │   results = Report(                                                  │
│   850 │   │   configuration=configuration,                                   │
│   851 │   │   filter_args=args.filter,                                       │
│   852 │   │   format_args=args.format,                                       │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │          args = Namespace(color=None, configfile=None, count=None,       │ │
│ │                 debug=False, detailed=False, editor=None, end=None,      │ │
│ │                 fail=False, filter={'buildspec':                         │ │
│ │                 '/path/to/invalid.yml'}, filterfields=False,             │ │
│ │                 format=None, formatfields=False, helpcolor=False,        │ │
│ │                 helpfilter=False, helpformat=False, latest=False,        │ │
│ │                 loglevel='DEBUG', logpath=False, no_color=False,         │ │
│ │                 no_header=False, oldest=False, pager=False,              │ │
│ │                 passed=False, print_log=False, report=None,              │ │
│ │                 report_subcommand=None, row_count=False, start=None,     │ │
│ │                 subcommands='rt', terse=False, view_log=False)           │ │
│ │ configuration = <buildtest.config.SiteConfiguration object at            │ │
│ │                 0x7ff39b6137c0>                                          │ │
│ │  consoleColor = 'default'                                                │ │
│ │         pager = False                                                    │ │
│ │   report_file = None                                                     │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:158 in __init__                                       │
│                                                                              │
│   155 │   │   self._check_filter_fields()                                    │
│   156 │   │   self._check_format_fields()                                    │
│   157 │   │   self._check_start_and_end_fields()                             │
│ ❱ 158 │   │   self.filter_buildspecs_from_report()                           │
│   159 │   │                                                                  │
│   160 │   │   self.process_report()                                          │
│   161                                                                        │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │           color = None                                                   │ │
│ │   configuration = <buildtest.config.SiteConfiguration object at          │ │
│ │                   0x7ff39b6137c0>                                        │ │
│ │           count = None                                                   │ │
│ │        detailed = None                                                   │ │
│ │             end = None                                                   │ │
│ │         failure = False                                                  │ │
│ │     filter_args = {'buildspec': '/path/to/invalid.yml'}                  │ │
│ │     format_args = None                                                   │ │
│ │ format_detailed = False                                                  │ │
│ │          latest = False                                                  │ │
│ │          oldest = False                                                  │ │
│ │           pager = None                                                   │ │
│ │          passed = False                                                  │ │
│ │     report_file = None                                                   │ │
│ │            self = <buildtest.cli.report.Report object at 0x7ff39b63ccd0> │ │
│ │           start = None                                                   │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:307 in filter_buildspecs_from_report                  │
│                                                                              │
│   304 │   │   │                                                              │
│   305 │   │   │   # if file doesn't exist we terminate with message          │
│   306 │   │   │   if not resolved_buildspecs:                                │
│ ❱ 307 │   │   │   │   raise BuildTestError(                                  │
│   308 │   │   │   │   │   f"Invalid File Path for filter field 'buildspec':  │
│   309 │   │   │   │   )                                                      │
│   310                                                                        │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ resolved_buildspecs = None                                               │ │
│ │                self = <buildtest.cli.report.Report object at             │ │
│ │                       0x7ff39b63ccd0>                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
BuildTestError: "Invalid File Path for filter field 'buildspec': 
/path/to/invalid.yml"

You may have a valid filepath for buildspec filter field such as $BUILDTEST_ROOT/tutorials/invalid_executor.yml, but there is no record of a test in the report cache because this test wasn’t run. In this case you will get the following message.

buildtest rt --filter buildspec=$BUILDTEST_ROOT/tutorials/invalid_executor.yml
$ buildtest rt --filter buildspec=$BUILDTEST_ROOT/tutorials/invalid_executor.yml
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ in/buildtest:38 in <module>                                                  │
│                                                                              │
│   35                                                                         │
│   36 if __name__ == "__main__":                                              │
│   37                                                                         │
│ ❱ 38   sys.exit(main())                                                      │
│   39                                                                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ buildtest_file = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │           main = <function main at 0x7feafcc1dee0>                       │ │
│ │             os = <module 'os' from                                       │ │
│ │                  '/home/docs/.asdf/installs/python/3.8.18/lib/python3.8… │ │
│ │         prefix = '/home/docs/checkouts/readthedocs.org/user_builds/buil… │ │
│ │            sys = <module 'sys' (built-in)>                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/main.py:301 in main                                                 │
│                                                                              │
│   298 │                                                                      │
│   299 │   # buildtest report                                                 │
│   300 │   elif args.subcommands in ["report", "rt"]:                         │
│ ❱ 301 │   │   report_cmd(args, configuration=configuration, report_file=repo │
│   302 │                                                                      │
│   303 │   elif args.subcommands == "path":                                   │
│   304 │   │   path_cmd(                                                      │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             args = Namespace(color=None, configfile=None, count=None,    │ │
│ │                    debug=False, detailed=False, editor=None, end=None,   │ │
│ │                    fail=False, filter={'buildspec':                      │ │
│ │                    '$BUILDTEST_ROOT/tutorials/invalid_executor.yml'},    │ │
│ │                    filterfields=False, format=None, formatfields=False,  │ │
│ │                    helpcolor=False, helpfilter=False, helpformat=False,  │ │
│ │                    latest=False, loglevel='DEBUG', logpath=False,        │ │
│ │                    no_color=False, no_header=False, oldest=False,        │ │
│ │                    pager=False, passed=False, print_log=False,           │ │
│ │                    report=None, report_subcommand=None, row_count=False, │ │
│ │                    start=None, subcommands='rt', terse=False,            │ │
│ │                    view_log=False)                                       │ │
│ │ buildtest_editor = '/usr/bin/vim'                                        │ │
│ │      config_file = None                                                  │ │
│ │    configuration = <buildtest.config.SiteConfiguration object at         │ │
│ │                    0x7feafadb1730>                                       │ │
│ │           logger = <Logger buildtest (DEBUG)>                            │ │
│ │         no_color = False                                                 │ │
│ │           parser = <buildtest.cli.BuildTestParser object at              │ │
│ │                    0x7feafccc1a90>                                       │ │
│ │      report_file = None                                                  │ │
│ │           system = <buildtest.system.BuildTestSystem object at           │ │
│ │                    0x7feafadb1250>                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:849 in report_cmd                                     │
│                                                                              │
│   846 │   │   list_report()                                                  │
│   847 │   │   return                                                         │
│   848 │                                                                      │
│ ❱ 849 │   results = Report(                                                  │
│   850 │   │   configuration=configuration,                                   │
│   851 │   │   filter_args=args.filter,                                       │
│   852 │   │   format_args=args.format,                                       │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │          args = Namespace(color=None, configfile=None, count=None,       │ │
│ │                 debug=False, detailed=False, editor=None, end=None,      │ │
│ │                 fail=False, filter={'buildspec':                         │ │
│ │                 '$BUILDTEST_ROOT/tutorials/invalid_executor.yml'},       │ │
│ │                 filterfields=False, format=None, formatfields=False,     │ │
│ │                 helpcolor=False, helpfilter=False, helpformat=False,     │ │
│ │                 latest=False, loglevel='DEBUG', logpath=False,           │ │
│ │                 no_color=False, no_header=False, oldest=False,           │ │
│ │                 pager=False, passed=False, print_log=False, report=None, │ │
│ │                 report_subcommand=None, row_count=False, start=None,     │ │
│ │                 subcommands='rt', terse=False, view_log=False)           │ │
│ │ configuration = <buildtest.config.SiteConfiguration object at            │ │
│ │                 0x7feafadb1730>                                          │ │
│ │  consoleColor = 'default'                                                │ │
│ │         pager = False                                                    │ │
│ │   report_file = None                                                     │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:158 in __init__                                       │
│                                                                              │
│   155 │   │   self._check_filter_fields()                                    │
│   156 │   │   self._check_format_fields()                                    │
│   157 │   │   self._check_start_and_end_fields()                             │
│ ❱ 158 │   │   self.filter_buildspecs_from_report()                           │
│   159 │   │                                                                  │
│   160 │   │   self.process_report()                                          │
│   161                                                                        │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │           color = None                                                   │ │
│ │   configuration = <buildtest.config.SiteConfiguration object at          │ │
│ │                   0x7feafadb1730>                                        │ │
│ │           count = None                                                   │ │
│ │        detailed = None                                                   │ │
│ │             end = None                                                   │ │
│ │         failure = False                                                  │ │
│ │     filter_args = {                                                      │ │
│ │                   │   'buildspec':                                       │ │
│ │                   '$BUILDTEST_ROOT/tutorials/invalid_executor.yml'       │ │
│ │                   }                                                      │ │
│ │     format_args = None                                                   │ │
│ │ format_detailed = False                                                  │ │
│ │          latest = False                                                  │ │
│ │          oldest = False                                                  │ │
│ │           pager = None                                                   │ │
│ │          passed = False                                                  │ │
│ │     report_file = None                                                   │ │
│ │            self = <buildtest.cli.report.Report object at 0x7feafad82250> │ │
│ │           start = None                                                   │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/b │
│ uildtest/cli/report.py:313 in filter_buildspecs_from_report                  │
│                                                                              │
│   310 │   │   │                                                              │
│   311 │   │   │   # if file not found in cache we exit                       │
│   312 │   │   │   if not resolved_buildspecs in self.report.keys():          │
│ ❱ 313 │   │   │   │   raise BuildTestError(                                  │
│   314 │   │   │   │   │   f"buildspec file: {resolved_buildspecs} not found  │
│   315 │   │   │   │   )                                                      │
│   316                                                                        │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ resolved_buildspecs = '/home/docs/checkouts/readthedocs.org/user_builds… │ │
│ │                self = <buildtest.cli.report.Report object at             │ │
│ │                       0x7feafad82250>                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
BuildTestError: 'buildspec file: 
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutor
ials/invalid_executor.yml not found in cache'

Find Latest or Oldest test

We can search for oldest or latest test for any given test. This can be useful if you want to see first or last test run for a particular test. If you want to retrieve the oldest test you can use --oldest option, likewise you can retrieve the latest run via --latest option.

Let’s take a look at this example, we filter by test name exit1_pass which retrieves all test runs. In subsequent example we filter by latest and oldest run.

Show oldest run
$ buildtest report --filter name=exit1_pass --format name,id,starttime
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                 ┃ id               ┃ starttime                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ exit1_pass           │ ba20e26d         │ 2024/02/22 20:29:40                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ c9fbc18c         │ 2024/02/22 20:30:56                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ eb233c15         │ 2024/02/22 20:31:00                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ b4a194ad         │ 2024/02/22 20:31:01                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ 396cb9a9         │ 2024/02/22 20:31:09                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ 4af07718         │ 2024/02/22 20:31:17                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ d274c7ac         │ 2024/02/22 20:31:17                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ 7a174e27         │ 2024/02/22 20:31:19                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ 23e23699         │ 2024/02/22 20:31:20                │
└──────────────────────┴──────────────────┴────────────────────────────────────┘
$ buildtest report --filter name=exit1_pass --format name,id,starttime --oldest
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                 ┃ id               ┃ starttime                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ exit1_pass           │ ba20e26d         │ 2024/02/22 20:29:40                │
└──────────────────────┴──────────────────┴────────────────────────────────────┘
Show latest run
$ buildtest report --filter name=exit1_pass --format name,id,starttime --latest
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                 ┃ id               ┃ starttime                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ exit1_pass           │ 23e23699         │ 2024/02/22 20:31:20                │
└──────────────────────┴──────────────────┴────────────────────────────────────┘

You may combine –oldest and –latest options in same command, in this case buildtest will retrieve the first and last record of every test.

Show oldest and latest run
$ buildtest report --filter name=exit1_pass --format name,id,starttime --oldest --latest
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                 ┃ id               ┃ starttime                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ exit1_pass           │ ba20e26d         │ 2024/02/22 20:29:40                │
├──────────────────────┼──────────────────┼────────────────────────────────────┤
│ exit1_pass           │ 23e23699         │ 2024/02/22 20:31:20                │
└──────────────────────┴──────────────────┴────────────────────────────────────┘

Find all Failed Tests (buildtest report --fail)

The buildtest report --fail command can be used to retrieve all failed tests which is equivalent to filtering tests by state=FAIL since test state is determined by state property. This command can be useful to pin-point failures.

Let’s take a look at next two example, the first command will query report and limit output to 6 rows which can retrieve both pass and failed test. The second command will run same example with --fail and only retrieve failed tests. Take note of the state property in table, in second example buildtest will filter test and report all FAIL tests.

Show fail tests
$ buildtest report --format name,id,state --count=6
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ name                                         ┃ id               ┃ state      ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ variables_bash                               │ 26a15409         │ PASS       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ variables_bash                               │ f432ceff         │ PASS       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ variables_bash                               │ 77b12d9e         │ PASS       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ variables_bash                               │ 02dc085d         │ PASS       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ variables_bash                               │ b6711492         │ PASS       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ returncode_list_mismatch                     │ 1b4070f0         │ FAIL       │
└──────────────────────────────────────────────┴──────────────────┴────────────┘
$ buildtest report --format name,id,state --fail --count=6
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ name                                         ┃ id               ┃ state      ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ returncode_list_mismatch                     │ 1b4070f0         │ FAIL       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ returncode_list_mismatch                     │ 445cf9cb         │ FAIL       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ returncode_list_mismatch                     │ e3cf96cf         │ FAIL       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ returncode_list_mismatch                     │ ce179ef0         │ FAIL       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ returncode_list_mismatch                     │ ebbda354         │ FAIL       │
├──────────────────────────────────────────────┼──────────────────┼────────────┤
│ returncode_list_mismatch                     │ b8fba5af         │ FAIL       │
└──────────────────────────────────────────────┴──────────────────┴────────────┘

Find all Passed Tests (buildtest report --pass)

The buildtest report --pass, works similar to buildtest report --fail where it will filter test by state=PASS which can be used to find all passed tests.

We can see in example below, that buildtest will retrieve only PASS tests which can be determined by the state property

Show pass tests
$ buildtest report --format name,id,state --pass --count=6
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ name                                ┃ id                    ┃ state          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ variables_bash                      │ 26a15409              │ PASS           │
├─────────────────────────────────────┼───────────────────────┼────────────────┤
│ variables_bash                      │ f432ceff              │ PASS           │
├─────────────────────────────────────┼───────────────────────┼────────────────┤
│ variables_bash                      │ 77b12d9e              │ PASS           │
├─────────────────────────────────────┼───────────────────────┼────────────────┤
│ variables_bash                      │ 02dc085d              │ PASS           │
├─────────────────────────────────────┼───────────────────────┼────────────────┤
│ variables_bash                      │ b6711492              │ PASS           │
├─────────────────────────────────────┼───────────────────────┼────────────────┤
│ exit1_pass                          │ ba20e26d              │ PASS           │
└─────────────────────────────────────┴───────────────────────┴────────────────┘

Note

The --pass and --fail are mutually exclusive option which will query all PASS or FAIL test from report file, if you try to specify both options on command line you will get an error

$ buildtest report --pass --fail
usage: buildtest [options] [COMMANDS] report [-h] [--pager] [--row-count]
                                             [--terse] [-n] [-c COUNT]
                                             [--filter FILTER] [--helpfilter]
                                             [--filterfields] [--helpformat]
                                             [--formatfields] [--latest]
                                             [--oldest] [-s START] [-e END]
                                             [-f | -p] [--format FORMAT | -d]
                                             ...
buildtest [options] [COMMANDS] report: error: argument -f/--fail: not allowed with argument -p/--pass

Find Tests by Start and End Date (buildtest report --start --end)

The buildtest report --start and buildtest report --end command can be used to retrieve test records based on start and end date.

Let’s take a look at these two example, the first test queries report by filtering by state and name. The second command will run same example with --start --end option. Take note of the starttime and endtime properties in table, in second example buildtest will filter test and only report tests in the range of [start, end] dates.

Filter by start and end date
$ buildtest report --filter state=FAIL,name=exit1_fail --format name,state,starttime,endtime
Report File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkout
                             s/1082/var/report.json
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                                                   ┃ state        ┃ starttime                                ┃ endtime                                 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ exit1_fail                                             │ FAIL         │ 2022/06/09 17:51:50                      │ 2022/06/09 17:51:50                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/09 17:51:51                      │ 2022/06/09 17:51:51                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/09 17:51:53                      │ 2022/06/09 17:51:53                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/09 17:52:01                      │ 2022/06/09 17:52:01                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:51:50                      │ 2022/06/10 17:51:50                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:51:52                      │ 2022/06/10 17:51:52                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:51:52                      │ 2022/06/10 17:51:52                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:52:01                      │ 2022/06/10 17:52:01                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:57                      │ 2022/06/11 17:51:57                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:59                      │ 2022/06/11 17:51:59                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:57                      │ 2022/06/11 17:51:57                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:59                      │ 2022/06/11 17:51:59                     │
└────────────────────────────────────────────────────────┴──────────────┴──────────────────────────────────────────┴─────────────────────────────────────────┘
$ buildtest report --filter state=FAIL,name=exit1_fail --format name,state,starttime,endtime --start 2022-06-10 --end 2022-06-11
Report File: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkout
                             s/1082/var/report.json
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                                                   ┃ state        ┃ starttime                                ┃ endtime                                 ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:51:50                      │ 2022/06/10 17:51:50                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:51:52                      │ 2022/06/10 17:51:52                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:51:52                      │ 2022/06/10 17:51:52                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/10 17:52:01                      │ 2022/06/10 17:52:01                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:57                      │ 2022/06/11 17:51:57                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:59                      │ 2022/06/11 17:51:59                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:57                      │ 2022/06/11 17:51:57                     │
├────────────────────────────────────────────────────────┼──────────────┼──────────────────────────────────────────┼─────────────────────────────────────────┤
│ exit1_fail                                             │ FAIL         │ 2022/06/11 17:51:59                      │ 2022/06/11 17:51:59                     │
└────────────────────────────────────────────────────────┴──────────────┴──────────────────────────────────────────┴─────────────────────────────────────────┘

Limit number of test records (buildtest report --count)

The buildtest report command will show all test results from the report file and the output can be quite long. If you want to limit the number of records that get printed then you can use buildtest report --count where --count is number of rows that that get printed. Shown below is the output of 2 records in table format

buildtest report --count 2
$ buildtest report --count 2
                 Report File: /tmp/tmpq07_ocbs/var/report.json                  
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ name                 ┃ id           ┃ state    ┃ runtime     ┃ returncode    ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ variables_bash       │ 26a15409     │ PASS     │ 0.0142      │ 0             │
├──────────────────────┼──────────────┼──────────┼─────────────┼───────────────┤
│ variables_bash       │ f432ceff     │ PASS     │ 0.009858    │ 0             │
└──────────────────────┴──────────────┴──────────┴─────────────┴───────────────┘

The --count option also works with terse mode --terse, shown below is the same output

buildtest report --terse --count 2
$ buildtest report --terse --count 2
name|id|state|runtime|returncode
variables_bash|26a15409|PASS|0.0142|0
variables_bash|f432ceff|PASS|0.009858|0

If you set --count=0 no records will be displayed; however, if you set any negative value for --count then all records will be displayed.

Query tests with --count at 0 and negative value
$ buildtest report --count=0 --no-header --terse | wc -l
25
$ buildtest report --count=-5 --no-header --terse | wc -l
133

Terse Output (buildtest report --terse)

If you would like to parse the result of buildtest report, you can use the --terse or -t option which will print the report in machine readable format that shows the name of each column followed by each entry. Each entry is delimited by PIPE symbol (|). The --terse option works with --format and --filter option. In this next example, we report all FAIL tests in terse output. The first line is the header of tables followed by output, if you want to disable output of header you can use --no-header option.

buildtest report --filter state=FAIL --format=name,id,state --terse
$ buildtest report --filter state=FAIL --format=name,id,state --terse
name|id|state
returncode_list_mismatch|1b4070f0|FAIL
returncode_list_mismatch|445cf9cb|FAIL
returncode_list_mismatch|e3cf96cf|FAIL
returncode_list_mismatch|ce179ef0|FAIL
returncode_list_mismatch|ebbda354|FAIL
returncode_list_mismatch|b8fba5af|FAIL
returncode_list_mismatch|88196c27|FAIL
returncode_list_mismatch|5a6a49c2|FAIL
exit1_fail|b72ed665|FAIL
exit1_fail|c32d00e5|FAIL
exit1_fail|34b13a0d|FAIL
exit1_fail|f7971f42|FAIL
exit1_fail|e6e8d6e5|FAIL
exit1_fail|791b814a|FAIL
exit1_fail|4e4c3f19|FAIL
exit1_fail|57343218|FAIL
exit1_fail|6dee43bb|FAIL
status_regex_stderr_fail|b8b0b058|FAIL
status_regex_stdout_fail|728cbf07|FAIL
regex_on_directory_not_supported|dc235f39|FAIL
timelimit_max_fail|0942faed|FAIL
timelimit_min_fail|7bff2900|FAIL
always_fail|b2ba3ea6|FAIL
test_fail_returncode_match|82cc863f|FAIL
status_exists_failure|ee42eda9|FAIL

Report Summary (buildtest report summary)

The buildtest report summary command can be used to provide a short summary of the test report.

Shown below is an example output from the report summary.

buildtest report summary
$ buildtest report summary
Report File:  /tmp/tmpq07_ocbs/var/report.json
Total Tests: 133
Total Tests by Names:  57
Number of buildspecs in report:  29

The buildtest report summary --detailed command can be used to provide a summary of the test report with breakdown statistics of tests including all fail tests, number of tests by name, test runs and buildspecs in report file. To see a short report use

Shown below is an example output from the report summary –detailed.

buildtest report summary --detailed
$ buildtest report summary --detailed
Report File:  /tmp/tmpq07_ocbs/var/report.json
Total Tests: 133
Total Tests by Names:  57
Number of buildspecs in report:  29
                             Breakdown by test                             
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Name                             ┃ Total Pass ┃ Total Fail ┃ Total Runs ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ variables_bash                   │ 5          │ 0          │ 5          │
│ returncode_list_mismatch         │ 0          │ 8          │ 8          │
│ exit1_fail                       │ 0          │ 9          │ 9          │
│ exit1_pass                       │ 9          │ 0          │ 9          │
│ returncode_int_match             │ 8          │ 0          │ 8          │
│ status_regex_stdout_pass         │ 1          │ 0          │ 1          │
│ status_regex_stderr_fail         │ 0          │ 1          │ 1          │
│ status_regex_stderr_pass         │ 1          │ 0          │ 1          │
│ status_regex_stdout_fail         │ 0          │ 1          │ 1          │
│ file_expansion_supported         │ 1          │ 0          │ 1          │
│ regex_on_directory_not_supported │ 0          │ 1          │ 1          │
│ regex_on_multiple_files          │ 1          │ 0          │ 1          │
│ timelimit_max_fail               │ 0          │ 1          │ 1          │
│ timelimit_max                    │ 1          │ 0          │ 1          │
│ timelimit_min_fail               │ 0          │ 1          │ 1          │
│ timelimit_min                    │ 1          │ 0          │ 1          │
│ timelimit_min_max                │ 1          │ 0          │ 1          │
│ always_fail                      │ 0          │ 1          │ 1          │
│ test_pass_returncode_mismatch    │ 1          │ 0          │ 1          │
│ test_fail_returncode_match       │ 0          │ 1          │ 1          │
│ always_pass                      │ 1          │ 0          │ 1          │
│ status_exists                    │ 1          │ 0          │ 1          │
│ status_exists_failure            │ 0          │ 1          │ 1          │
│ file_exists_pass                 │ 1          │ 0          │ 1          │
│ combined_file_and_dir_checks     │ 1          │ 0          │ 1          │
│ file_and_dir_checks              │ 0          │ 1          │ 1          │
│ symlink_test                     │ 1          │ 0          │ 1          │
│ file_count_on_directory          │ 1          │ 0          │ 1          │
│ file_count_by_extension          │ 1          │ 0          │ 1          │
│ file_count_by_expression         │ 0          │ 1          │ 1          │
│ file_extension_and_filepattern   │ 1          │ 0          │ 1          │
│ file_count_by_filetype           │ 0          │ 1          │ 1          │
│ file_traverse_limit              │ 0          │ 1          │ 1          │
│ status_logical_or                │ 1          │ 0          │ 1          │
│ status_logical_and               │ 1          │ 0          │ 1          │
│ unskipped                        │ 1          │ 0          │ 1          │
│ hello_world                      │ 9          │ 0          │ 9          │
│ root_disk_usage                  │ 4          │ 0          │ 4          │
│ ulimit_cputime_unlimited         │ 3          │ 0          │ 3          │
│ ulimit_filedescriptor_4096       │ 0          │ 3          │ 3          │
│ ulimit_stacksize_unlimited       │ 0          │ 3          │ 3          │
│ ulimit_max_user_process_2048     │ 0          │ 3          │ 3          │
│ ulimit_filelock_unlimited        │ 3          │ 0          │ 3          │
│ ulimit_vmsize_unlimited          │ 3          │ 0          │ 3          │
│ systemd_default_target           │ 0          │ 4          │ 4          │
│ kernel_swapusage                 │ 0          │ 4          │ 4          │
│ string_tag                       │ 3          │ 0          │ 3          │
│ list_of_strings_tags             │ 3          │ 0          │ 3          │
│ python_hello                     │ 4          │ 0          │ 4          │
│ circle_area                      │ 6          │ 0          │ 6          │
│ summary_example                  │ 1          │ 0          │ 1          │
│ add_numbers                      │ 1          │ 0          │ 1          │
│ tcsh_env_declaration             │ 1          │ 0          │ 1          │
│ bash_env_variables               │ 1          │ 0          │ 1          │
│ csh_env_declaration              │ 1          │ 0          │ 1          │
│ csh_shell                        │ 1          │ 0          │ 1          │
│ sleep                            │ 1          │ 1          │ 2          │
└──────────────────────────────────┴────────────┴────────────┴────────────┘
                                   PASS Tests                                   
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ name            ┃ id       ┃ executor        ┃ state ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ variables_bash  │ 26a15409 │ generic.local.b │ PASS  │ 0          │ 0.0142   │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ variables_bash  │ f432ceff │ generic.local.b │ PASS  │ 0          │ 0.009858 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ variables_bash  │ 77b12d9e │ generic.local.b │ PASS  │ 0          │ 0.010068 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ variables_bash  │ 02dc085d │ generic.local.b │ PASS  │ 0          │ 0.010154 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ variables_bash  │ b6711492 │ generic.local.b │ PASS  │ 0          │ 0.010002 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ ba20e26d │ generic.local.b │ PASS  │ 1          │ 0.01436  │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ c9fbc18c │ generic.local.b │ PASS  │ 1          │ 0.01571  │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ eb233c15 │ generic.local.b │ PASS  │ 1          │ 0.014661 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ b4a194ad │ generic.local.b │ PASS  │ 1          │ 0.014539 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ 396cb9a9 │ generic.local.b │ PASS  │ 1          │ 0.014214 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ 4af07718 │ generic.local.b │ PASS  │ 1          │ 0.014922 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ d274c7ac │ generic.local.b │ PASS  │ 1          │ 0.015841 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ 7a174e27 │ generic.local.b │ PASS  │ 1          │ 0.015025 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_pass      │ 23e23699 │ generic.local.b │ PASS  │ 1          │ 0.014857 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ 004772b0 │ generic.local.b │ PASS  │ 128        │ 0.014366 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ 2a4f4c64 │ generic.local.b │ PASS  │ 128        │ 0.014585 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ d36296b6 │ generic.local.b │ PASS  │ 128        │ 0.014792 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ 87651392 │ generic.local.b │ PASS  │ 128        │ 0.015128 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ 108911b4 │ generic.local.b │ PASS  │ 128        │ 0.015542 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ 52d1a915 │ generic.local.b │ PASS  │ 128        │ 0.016018 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ 31d4c613 │ generic.local.b │ PASS  │ 128        │ 0.015097 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_int_ │ 6beaaa13 │ generic.local.b │ PASS  │ 128        │ 0.014824 │
│ match           │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ status_regex_st │ 76cc727e │ generic.local.b │ PASS  │ 0          │ 0.00581  │
│ dout_pass       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ status_regex_st │ be49e27c │ generic.local.b │ PASS  │ 0          │ 0.006045 │
│ derr_pass       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ file_expansion_ │ 0497df43 │ generic.local.b │ PASS  │ 0          │ 0.006215 │
│ supported       │          │ ash             │       │            │          │
└─────────────────┴──────────┴─────────────────┴───────┴────────────┴──────────┘
                                   FAIL Tests                                   
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ name            ┃ id       ┃ executor        ┃ state ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ returncode_list │ 1b4070f0 │ generic.local.b │ FAIL  │ 2          │ 0.014182 │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_list │ 445cf9cb │ generic.local.b │ FAIL  │ 2          │ 0.014693 │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_list │ e3cf96cf │ generic.local.b │ FAIL  │ 2          │ 0.015648 │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_list │ ce179ef0 │ generic.local.b │ FAIL  │ 2          │ 0.016075 │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_list │ ebbda354 │ generic.local.b │ FAIL  │ 2          │ 0.01561  │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_list │ b8fba5af │ generic.local.b │ FAIL  │ 2          │ 0.014458 │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_list │ 88196c27 │ generic.local.b │ FAIL  │ 2          │ 0.014815 │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ returncode_list │ 5a6a49c2 │ generic.local.b │ FAIL  │ 2          │ 0.015149 │
│ _mismatch       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ b72ed665 │ generic.local.b │ FAIL  │ 1          │ 0.014668 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ c32d00e5 │ generic.local.b │ FAIL  │ 1          │ 0.014215 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ 34b13a0d │ generic.local.b │ FAIL  │ 1          │ 0.01499  │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ f7971f42 │ generic.local.b │ FAIL  │ 1          │ 0.015183 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ e6e8d6e5 │ generic.local.b │ FAIL  │ 1          │ 0.01524  │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ 791b814a │ generic.local.b │ FAIL  │ 1          │ 0.015799 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ 4e4c3f19 │ generic.local.b │ FAIL  │ 1          │ 0.015202 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ 57343218 │ generic.local.b │ FAIL  │ 1          │ 0.014674 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ exit1_fail      │ 6dee43bb │ generic.local.b │ FAIL  │ 1          │ 0.016396 │
│                 │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ status_regex_st │ b8b0b058 │ generic.local.b │ FAIL  │ 0          │ 0.00623  │
│ derr_fail       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ status_regex_st │ 728cbf07 │ generic.local.b │ FAIL  │ 0          │ 0.005623 │
│ dout_fail       │          │ ash             │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ regex_on_direct │ dc235f39 │ generic.local.b │ FAIL  │ 0          │ 0.007654 │
│ ory_not_support │          │ ash             │       │            │          │
│ ed              │          │                 │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ timelimit_max_f │ 0942faed │ generic.local.s │ FAIL  │ 0          │ 3.006666 │
│ ail             │          │ h               │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ timelimit_min_f │ 7bff2900 │ generic.local.s │ FAIL  │ 0          │ 2.006387 │
│ ail             │          │ h               │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ always_fail     │ b2ba3ea6 │ generic.local.s │ FAIL  │ 0          │ 0.004813 │
│                 │          │ h               │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ test_fail_retur │ 82cc863f │ generic.local.s │ FAIL  │ 1          │ 0.013081 │
│ ncode_match     │          │ h               │       │            │          │
├─────────────────┼──────────┼─────────────────┼───────┼────────────┼──────────┤
│ status_exists_f │ ee42eda9 │ generic.local.b │ FAIL  │ 0          │ 0.006826 │
│ ailure          │          │ ash             │       │            │          │
└─────────────────┴──────────┴─────────────────┴───────┴────────────┴──────────┘

Inspect Tests Records via buildtest inspect

Note

buildtest it is an alias for buildtest inspect command.

In previous examples we saw how we can retrieve test records using buildtest report which is printed in table format. We have limited the output to a limited fields however, if you want to analyze a particular, we have a separate command called buildtest inspect that can be used for inspecting a test record based on name or id. Shown below is the command usage for buildtest inspect command.

buildtest inspect --help
$ buildtest inspect --help
usage: buildtest [options] [COMMANDS] inspect [-h]  ...

optional arguments:
  -h, --help     show this help message and exit

subcommands:
  Inspect Test result based on Test ID or Test Name

  
    buildspec (b)
                 Inspect a test based on buildspec
    name (n)     Specify name of test
    query (q)    Query fields from record
    list (ls)    List all test names, ids, and corresponding buildspecs

You can report all test names and corresponding ids using buildtest inspect list which will be used for querying tests by name or id.

buildtest inspect list
$ buildtest inspect list
                      Test Summary by id, name, buildspec                       
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ id                      ┃ name                     ┃ buildspec               ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 26a15409-30d0-4457-9397 │ variables_bash           │ /home/docs/checkouts/re │
│ -acb5c6632bcf           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ devel/tutorials/vars.ym │
│                         │                          │ l                       │
│ f432ceff-0348-4c4f-af7c │ variables_bash           │ /home/docs/checkouts/re │
│ -735fbc55ff0d           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ devel/tutorials/vars.ym │
│                         │                          │ l                       │
│ 77b12d9e-9876-4b84-8d1e │ variables_bash           │ /home/docs/checkouts/re │
│ -a268c1a4ee06           │                          │ adthedocs.org/user_buil │
│                         │                          │ ds/buildtest/checkouts/ │
│                         │                          │ devel/tutorials/vars.ym │
│                         │                          │ l                       │
│ 02dc085d-b046-4476-bce4 │ variables_bash           │ /home/docs/checkouts/re │
...

You can fetch all builder names via buildtest inspect list --builder which is the format used for querying test records via buildtest inspect name or buildtest inspect query.

buildtest inspect list --builder
$ buildtest inspect list --builder
variables_bash/26a15409-30d0-4457-9397-acb5c6632bcf
variables_bash/f432ceff-0348-4c4f-af7c-735fbc55ff0d
variables_bash/77b12d9e-9876-4b84-8d1e-a268c1a4ee06
variables_bash/02dc085d-b046-4476-bce4-f075d1e5125e
variables_bash/b6711492-1cc4-491c-baba-5eba8416138d
...

If you are interested in parsing output of buildtest inspect list, you can may find the --terse option useful. The output will show headers followed by entries, the headers can be omitted by specifying --no-header option.

buildtest inspect list --terse
$ buildtest inspect list --terse
id|name|buildspec
26a15409-30d0-4457-9397-acb5c6632bcf|variables_bash|/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/vars.yml
f432ceff-0348-4c4f-af7c-735fbc55ff0d|variables_bash|/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/vars.yml
77b12d9e-9876-4b84-8d1e-a268c1a4ee06|variables_bash|/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/vars.yml
02dc085d-b046-4476-bce4-f075d1e5125e|variables_bash|/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/vars.yml
...

Inspecting Test by Name via buildtest inspect name

The buildtest inspect name expects a list of positional argument that correspond to name of test you want to query and buildtest will fetch the last record for each named test. Let’s see an example to illustrate the point. We can see that each test is stored as a JSON format and buildtest keeps track of metadata for each test such as user, hostname, command, path to output and error file, content of test, state of test, returncode, etc… In this example, we will retrieve record for test name circle_area which will print the raw content of the test in JSON format.

buildtest inspect name circle_area
$ buildtest inspect name circle_area
We have detected 1 builders with the following names ['circle_area/5baf7cb7-ce91-4adc-a8de-af2adebd7d4c']
{
    'circle_area': [
        {
            '5baf7cb7-ce91-4adc-a8de-af2adebd7d4c': {
                'id': '5baf7cb7',
                'full_id': '5baf7cb7-ce91-4adc-a8de-af2adebd7d4c',
                'description': 'Calculate circle of area given a radius',
                'summary': '',
                'schemafile': 'script.schema.json',
                'executor': 'generic.local.bash',
                'compiler': None,
                'hostname': 'build-23532485-project-280831-buildtest',
                'user': 'docs',
                'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7',
                'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.sh',
                'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/stage',
                'command': 'bash circle_area_build.sh',
                'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.out',
                'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.err',
                'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/build-env.txt',
                'buildspec_content': 'buildspecs:\n  circle_area:\n    executor: generic.local.bash\n    type: script\n    shell: python\n    description: "Calculate circle of area given a radius"\n    tags: [tutorials, python]\n    run: |\n      import math\n      radius = 2\n      area = math.pi * radius * radius\n      print("Circle Radius ", radius)\n      print("Area of circle ", area)\n',
                'test_content': '#!/bin/bash\n\npython /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/stage/circle_area.py',
                'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=circle_area\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\n/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/stage/circle_area.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
                'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_uyob0fjj.log',
                'metrics': {},
                'check': {
                    'regex': None,
                    'returncode': None,
                    'runtime': None,
                    'file_regex': None,
                    'slurm_job_state': None,
                    'pbs_job_state': None,
                    'lsf_job_state': None,
                    'assert_ge': None,
                    'assert_gt': None,
                    'assert_le': None,
                    'assert_lt': None,
                    'assert_eq': None,
                    'assert_ne': None,
                    'contains': None,
                    'not_contains': None,
                    'is_symlink': None,
                    'exists': None,
                    'is_dir': None,
                    'is_file': None,
                    'file_count': None
                },
                'tags': 'tutorials python',
                'starttime': '2024/02/22 20:31:29',
                'endtime': '2024/02/22 20:31:29',
                'runtime': '0.031383',
                'state': 'PASS',
                'returncode': '0',
                'output': 'Circle Radius  2\nArea of circle  12.566370614359172\n',
                'error': '',
                'job': {},
                'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area_build.sh'
            }
        }
    ]
}

You can query multiple tests as positional arguments in the format: buildtest inspect name <test1> <test2> In this next example, we will retrieve test records for bash_shell and python_hello.

buildtest inspect name bash_shell python_hello
$ buildtest inspect name bash_shell python_hello
We have detected 1 builders with the following names ['python_hello/a56a8946-1a3e-4e91-8b11-16eafba84127']
{
    'python_hello': [
        {
            'a56a8946-1a3e-4e91-8b11-16eafba84127': {
                'id': 'a56a8946',
                'full_id': 'a56a8946-1a3e-4e91-8b11-16eafba84127',
                'description': 'Hello World python',
                'summary': '',
                'schemafile': 'script.schema.json',
                'executor': 'generic.local.bash',
                'compiler': None,
                'hostname': 'build-23532485-project-280831-buildtest',
                'user': 'docs',
                'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946',
                'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello.sh',
                'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/stage',
                'command': 'bash python_hello_build.sh',
                'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello.out',
                'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello.err',
                'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/build-env.txt',
                'buildspec_content': 'buildspecs:\n  python_hello:\n    type: script\n    description: Hello World python\n    executor: generic.local.bash\n    tags: python\n    run: python hello.py\n\n',
                'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\npython hello.py',
                'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=python_hello\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/stage/python_hello.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
                'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_uyob0fjj.log',
                'metrics': {},
                'check': {
                    'regex': None,
                    'returncode': None,
                    'runtime': None,
                    'file_regex': None,
                    'slurm_job_state': None,
                    'pbs_job_state': None,
                    'lsf_job_state': None,
                    'assert_ge': None,
                    'assert_gt': None,
                    'assert_le': None,
                    'assert_lt': None,
                    'assert_eq': None,
                    'assert_ne': None,
                    'contains': None,
                    'not_contains': None,
                    'is_symlink': None,
                    'exists': None,
                    'is_dir': None,
                    'is_file': None,
                    'file_count': None
                },
                'tags': 'python',
                'starttime': '2024/02/22 20:31:29',
                'endtime': '2024/02/22 20:31:29',
                'runtime': '0.03136',
                'state': 'PASS',
                'returncode': '0',
                'output': 'Hello World\n',
                'error': '',
                'job': {},
                'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello_build.sh'
            }
        }
    ]
}

If you want to query all test records for a given name you can use the --all option which is applied to all positional arguments.

Inspect Test by buildspec via buildtest inspect buildspec

buildtest can fetch records based on buildspec via buildtest inspect buildspec which expects a list of buildspecs. By default, buildtest will fetch the latest record of each test, but if you want to fetch all records you can pass the --all option.

In example below we will fetch latest record for all tests in tutorials/vars.yml

buildtest it buildspec tutorials/vars.yml
$ buildtest it buildspec tutorials/vars.yml
{
│   '/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/vars.yml': {
│   │   'variables_bash': {
│   │   │   'id': 'b6711492',
│   │   │   'full_id': 'b6711492-1cc4-491c-baba-5eba8416138d',
│   │   │   'description': 'Declare shell variables in bash',
│   │   │   'summary': '',
│   │   │   'schemafile': 'script.schema.json',
│   │   │   'executor': 'generic.local.bash',
│   │   │   'compiler': None,
│   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   'user': 'docs',
│   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492',
│   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash.sh',
│   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/stage',
│   │   │   'command': 'bash variables_bash_build.sh',
│   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash.out',
│   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash.err',
│   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/build-env.txt',
│   │   │   'buildspec_content': 'buildspecs:\n  variables_bash:\n    type: script\n    executor: generic.local.bash\n    description: Declare shell variables in bash\n    tags: [tutorials]\n    vars:\n      X: 1\n      Y: 2\n      literalstring: this is a literal string\n      singlequote: \\\'singlequote\\\'\n      doublequote: \\"doublequote\\"\n      current_user: "$(whoami)"\n      num_files: "`find $HOME -type f -maxdepth 1 | wc -l`"\n      multiline_string: |\n        Hello my name is Bob \\n\n        I am 30 years old\n\n\n    run: |\n      echo "$X+$Y="$(($X+$Y))\n      echo $literalstring\n      echo $singlequote\n      echo $doublequote\n      echo "current user:" $current_user\n      echo "number of files:" $num_files\n      echo -e $multiline_string\n',
│   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\nX="1"\nY="2"\nliteralstring="this is a literal string"\nsinglequote="\\\'singlequote\\\'"\ndoublequote="\\"doublequote\\""\ncurrent_user="$(whoami)"\nnum_files="`find $HOME -type f -maxdepth 1 | wc -l`"\nmultiline_string="Hello my name is Bob \\n\nI am 30 years old\n"\n# Content of run section\necho "$X+$Y="$(($X+$Y))\necho $literalstring\necho $singlequote\necho $doublequote\necho "current user:" $current_user\necho "number of files:" $num_files\necho -e $multiline_string\n',
│   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=variables_bash\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/stage/variables_bash.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_11it3oqj.log',
│   │   │   'metrics': {},
│   │   │   'check': {
│   │   │   │   'regex': None,
│   │   │   │   'returncode': None,
│   │   │   │   'runtime': None,
│   │   │   │   'file_regex': None,
│   │   │   │   'slurm_job_state': None,
│   │   │   │   'pbs_job_state': None,
│   │   │   │   'lsf_job_state': None,
│   │   │   │   'assert_ge': None,
│   │   │   │   'assert_gt': None,
│   │   │   │   'assert_le': None,
│   │   │   │   'assert_lt': None,
│   │   │   │   'assert_eq': None,
│   │   │   │   'assert_ne': None,
│   │   │   │   'contains': None,
│   │   │   │   'not_contains': None,
│   │   │   │   'is_symlink': None,
│   │   │   │   'exists': None,
│   │   │   │   'is_dir': None,
│   │   │   │   'is_file': None,
│   │   │   │   'file_count': None
│   │   │   },
│   │   │   'tags': 'tutorials',
│   │   │   'starttime': '2024/02/22 20:31:22',
│   │   │   'endtime': '2024/02/22 20:31:22',
│   │   │   'runtime': '0.010002',
│   │   │   'state': 'PASS',
│   │   │   'returncode': '0',
│   │   │   'output': '1+2=3\nthis is a literal string\n\\\'singlequote\\\'\n"doublequote"\ncurrent user: docs\nnumber of files: 5\nHello my name is Bob \n I am 30 years old\n',
│   │   │   'error': '',
│   │   │   'job': {},
│   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash_build.sh'
│   │   }
│   }
}

buildtest will report an error if an input buildspec is invalid filepath such as one below

$ buildtest it buildspec /tmp/buildspec.yml
buildspec: /tmp/buildspec.yml is not valid file
There are no buildspecs in cache based on input buildspecs: ['/tmp/buildspec.yml']

You can also pass multiple buildspes on the command line and fetch all records for a test. In example below we will fetch all records from buildspecs tutorials/vars.yml and tutorials/hello_world.yml

$ buildtest it buildspec --all tutorials/vars.yml tutorials/hello_world.yml
{
│   '/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/vars.yml': {
│   │   'variables_bash': [
│   │   │   {
│   │   │   │   'id': '26a15409',
│   │   │   │   'full_id': '26a15409-30d0-4457-9397-acb5c6632bcf',
│   │   │   │   'description': 'Declare shell variables in bash',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/variables_bash.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/stage',
│   │   │   │   'command': 'bash variables_bash_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/variables_bash.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/variables_bash.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  variables_bash:\n    type: script\n    executor: generic.local.bash\n    description: Declare shell variables in bash\n    tags: [tutorials]\n    vars:\n      X: 1\n      Y: 2\n      literalstring: this is a literal string\n      singlequote: \\\'singlequote\\\'\n      doublequote: \\"doublequote\\"\n      current_user: "$(whoami)"\n      num_files: "`find $HOME -type f -maxdepth 1 | wc -l`"\n      multiline_string: |\n        Hello my name is Bob \\n\n        I am 30 years old\n\n\n    run: |\n      echo "$X+$Y="$(($X+$Y))\n      echo $literalstring\n      echo $singlequote\n      echo $doublequote\n      echo "current user:" $current_user\n      echo "number of files:" $num_files\n      echo -e $multiline_string\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\nX="1"\nY="2"\nliteralstring="this is a literal string"\nsinglequote="\\\'singlequote\\\'"\ndoublequote="\\"doublequote\\""\ncurrent_user="$(whoami)"\nnum_files="`find $HOME -type f -maxdepth 1 | wc -l`"\nmultiline_string="Hello my name is Bob \\n\nI am 30 years old\n"\n# Content of run section\necho "$X+$Y="$(($X+$Y))\necho $literalstring\necho $singlequote\necho $doublequote\necho "current user:" $current_user\necho "number of files:" $num_files\necho -e $multiline_string\n',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=variables_bash\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/stage/variables_bash.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_7br16jf5.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:29:39',
│   │   │   │   'endtime': '2024/02/22 20:29:39',
│   │   │   │   'runtime': '0.0142',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': '1+2=3\nthis is a literal string\n\\\'singlequote\\\'\n"doublequote"\ncurrent user: docs\nnumber of files: 4\nHello my name is Bob \n I am 30 years old\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/26a15409/variables_bash_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': 'f432ceff',
│   │   │   │   'full_id': 'f432ceff-0348-4c4f-af7c-735fbc55ff0d',
│   │   │   │   'description': 'Declare shell variables in bash',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/variables_bash.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/stage',
│   │   │   │   'command': 'bash variables_bash_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/variables_bash.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/variables_bash.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  variables_bash:\n    type: script\n    executor: generic.local.bash\n    description: Declare shell variables in bash\n    tags: [tutorials]\n    vars:\n      X: 1\n      Y: 2\n      literalstring: this is a literal string\n      singlequote: \\\'singlequote\\\'\n      doublequote: \\"doublequote\\"\n      current_user: "$(whoami)"\n      num_files: "`find $HOME -type f -maxdepth 1 | wc -l`"\n      multiline_string: |\n        Hello my name is Bob \\n\n        I am 30 years old\n\n\n    run: |\n      echo "$X+$Y="$(($X+$Y))\n      echo $literalstring\n      echo $singlequote\n      echo $doublequote\n      echo "current user:" $current_user\n      echo "number of files:" $num_files\n      echo -e $multiline_string\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\nX="1"\nY="2"\nliteralstring="this is a literal string"\nsinglequote="\\\'singlequote\\\'"\ndoublequote="\\"doublequote\\""\ncurrent_user="$(whoami)"\nnum_files="`find $HOME -type f -maxdepth 1 | wc -l`"\nmultiline_string="Hello my name is Bob \\n\nI am 30 years old\n"\n# Content of run section\necho "$X+$Y="$(($X+$Y))\necho $literalstring\necho $singlequote\necho $doublequote\necho "current user:" $current_user\necho "number of files:" $num_files\necho -e $multiline_string\n',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=variables_bash\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/stage/variables_bash.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_uk9h6s8a.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:30:49',
│   │   │   │   'endtime': '2024/02/22 20:30:49',
│   │   │   │   'runtime': '0.009858',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': '1+2=3\nthis is a literal string\n\\\'singlequote\\\'\n"doublequote"\ncurrent user: docs\nnumber of files: 5\nHello my name is Bob \n I am 30 years old\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/f432ceff/variables_bash_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '77b12d9e',
│   │   │   │   'full_id': '77b12d9e-9876-4b84-8d1e-a268c1a4ee06',
│   │   │   │   'description': 'Declare shell variables in bash',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/variables_bash.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/stage',
│   │   │   │   'command': 'bash variables_bash_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/variables_bash.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/variables_bash.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  variables_bash:\n    type: script\n    executor: generic.local.bash\n    description: Declare shell variables in bash\n    tags: [tutorials]\n    vars:\n      X: 1\n      Y: 2\n      literalstring: this is a literal string\n      singlequote: \\\'singlequote\\\'\n      doublequote: \\"doublequote\\"\n      current_user: "$(whoami)"\n      num_files: "`find $HOME -type f -maxdepth 1 | wc -l`"\n      multiline_string: |\n        Hello my name is Bob \\n\n        I am 30 years old\n\n\n    run: |\n      echo "$X+$Y="$(($X+$Y))\n      echo $literalstring\n      echo $singlequote\n      echo $doublequote\n      echo "current user:" $current_user\n      echo "number of files:" $num_files\n      echo -e $multiline_string\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\nX="1"\nY="2"\nliteralstring="this is a literal string"\nsinglequote="\\\'singlequote\\\'"\ndoublequote="\\"doublequote\\""\ncurrent_user="$(whoami)"\nnum_files="`find $HOME -type f -maxdepth 1 | wc -l`"\nmultiline_string="Hello my name is Bob \\n\nI am 30 years old\n"\n# Content of run section\necho "$X+$Y="$(($X+$Y))\necho $literalstring\necho $singlequote\necho $doublequote\necho "current user:" $current_user\necho "number of files:" $num_files\necho -e $multiline_string\n',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=variables_bash\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/stage/variables_bash.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_o9s9s9qc.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:21',
│   │   │   │   'endtime': '2024/02/22 20:31:21',
│   │   │   │   'runtime': '0.010068',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': '1+2=3\nthis is a literal string\n\\\'singlequote\\\'\n"doublequote"\ncurrent user: docs\nnumber of files: 5\nHello my name is Bob \n I am 30 years old\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/77b12d9e/variables_bash_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '02dc085d',
│   │   │   │   'full_id': '02dc085d-b046-4476-bce4-f075d1e5125e',
│   │   │   │   'description': 'Declare shell variables in bash',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/variables_bash.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/stage',
│   │   │   │   'command': 'bash variables_bash_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/variables_bash.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/variables_bash.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  variables_bash:\n    type: script\n    executor: generic.local.bash\n    description: Declare shell variables in bash\n    tags: [tutorials]\n    vars:\n      X: 1\n      Y: 2\n      literalstring: this is a literal string\n      singlequote: \\\'singlequote\\\'\n      doublequote: \\"doublequote\\"\n      current_user: "$(whoami)"\n      num_files: "`find $HOME -type f -maxdepth 1 | wc -l`"\n      multiline_string: |\n        Hello my name is Bob \\n\n        I am 30 years old\n\n\n    run: |\n      echo "$X+$Y="$(($X+$Y))\n      echo $literalstring\n      echo $singlequote\n      echo $doublequote\n      echo "current user:" $current_user\n      echo "number of files:" $num_files\n      echo -e $multiline_string\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\nX="1"\nY="2"\nliteralstring="this is a literal string"\nsinglequote="\\\'singlequote\\\'"\ndoublequote="\\"doublequote\\""\ncurrent_user="$(whoami)"\nnum_files="`find $HOME -type f -maxdepth 1 | wc -l`"\nmultiline_string="Hello my name is Bob \\n\nI am 30 years old\n"\n# Content of run section\necho "$X+$Y="$(($X+$Y))\necho $literalstring\necho $singlequote\necho $doublequote\necho "current user:" $current_user\necho "number of files:" $num_files\necho -e $multiline_string\n',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=variables_bash\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/stage/variables_bash.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_37m3opqi.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:21',
│   │   │   │   'endtime': '2024/02/22 20:31:21',
│   │   │   │   'runtime': '0.010154',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': '1+2=3\nthis is a literal string\n\\\'singlequote\\\'\n"doublequote"\ncurrent user: docs\nnumber of files: 5\nHello my name is Bob \n I am 30 years old\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/02dc085d/variables_bash_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': 'b6711492',
│   │   │   │   'full_id': 'b6711492-1cc4-491c-baba-5eba8416138d',
│   │   │   │   'description': 'Declare shell variables in bash',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/stage',
│   │   │   │   'command': 'bash variables_bash_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  variables_bash:\n    type: script\n    executor: generic.local.bash\n    description: Declare shell variables in bash\n    tags: [tutorials]\n    vars:\n      X: 1\n      Y: 2\n      literalstring: this is a literal string\n      singlequote: \\\'singlequote\\\'\n      doublequote: \\"doublequote\\"\n      current_user: "$(whoami)"\n      num_files: "`find $HOME -type f -maxdepth 1 | wc -l`"\n      multiline_string: |\n        Hello my name is Bob \\n\n        I am 30 years old\n\n\n    run: |\n      echo "$X+$Y="$(($X+$Y))\n      echo $literalstring\n      echo $singlequote\n      echo $doublequote\n      echo "current user:" $current_user\n      echo "number of files:" $num_files\n      echo -e $multiline_string\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\nX="1"\nY="2"\nliteralstring="this is a literal string"\nsinglequote="\\\'singlequote\\\'"\ndoublequote="\\"doublequote\\""\ncurrent_user="$(whoami)"\nnum_files="`find $HOME -type f -maxdepth 1 | wc -l`"\nmultiline_string="Hello my name is Bob \\n\nI am 30 years old\n"\n# Content of run section\necho "$X+$Y="$(($X+$Y))\necho $literalstring\necho $singlequote\necho $doublequote\necho "current user:" $current_user\necho "number of files:" $num_files\necho -e $multiline_string\n',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=variables_bash\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/stage/variables_bash.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_11it3oqj.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:22',
│   │   │   │   'endtime': '2024/02/22 20:31:22',
│   │   │   │   'runtime': '0.010002',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': '1+2=3\nthis is a literal string\n\\\'singlequote\\\'\n"doublequote"\ncurrent user: docs\nnumber of files: 5\nHello my name is Bob \n I am 30 years old\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/vars/variables_bash/b6711492/variables_bash_build.sh'
│   │   │   }
│   │   ]
│   },
│   '/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/hello_world.yml': {
│   │   'hello_world': [
│   │   │   {
│   │   │   │   'id': 'c50ca9c8',
│   │   │   │   'full_id': 'c50ca9c8-51a9-4f42-8ee0-467f50626c23',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_s8gefenv.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:30:05',
│   │   │   │   'endtime': '2024/02/22 20:30:05',
│   │   │   │   'runtime': '0.00642',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/c50ca9c8/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': 'fcfe6e6f',
│   │   │   │   'full_id': 'fcfe6e6f-deba-425a-8170-cd3e54ca2670',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_4fcwbdk4.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:30:06',
│   │   │   │   'endtime': '2024/02/22 20:30:06',
│   │   │   │   'runtime': '0.00663',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/fcfe6e6f/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '0fee5d10',
│   │   │   │   'full_id': '0fee5d10-6f56-4ff7-8e0d-878be551f49e',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_74ip12e8.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:03',
│   │   │   │   'endtime': '2024/02/22 20:31:03',
│   │   │   │   'runtime': '0.006091',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/0fee5d10/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '4d82fcc3',
│   │   │   │   'full_id': '4d82fcc3-d5e1-4c2e-b100-c47c9e76fed2',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_l80p3550.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:10',
│   │   │   │   'endtime': '2024/02/22 20:31:10',
│   │   │   │   'runtime': '0.006085',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/4d82fcc3/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '00d65624',
│   │   │   │   'full_id': '00d65624-b8b7-4e3c-a088-6d38ffceca82',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_p0eksztg.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:29',
│   │   │   │   'endtime': '2024/02/22 20:31:29',
│   │   │   │   'runtime': '0.005745',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/00d65624/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '9d1f2b16',
│   │   │   │   'full_id': '9d1f2b16-6438-46dc-8d23-2d9a12dfd97f',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_p0eksztg.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:29',
│   │   │   │   'endtime': '2024/02/22 20:31:29',
│   │   │   │   'runtime': '0.00563',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/9d1f2b16/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': 'b865488b',
│   │   │   │   'full_id': 'b865488b-09f9-4ebc-bcab-b58f262128b9',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_p0eksztg.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:30',
│   │   │   │   'endtime': '2024/02/22 20:31:30',
│   │   │   │   'runtime': '0.006728',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/b865488b/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '8ffdf873',
│   │   │   │   'full_id': '8ffdf873-ca05-42b1-8b82-36ab74ed40e2',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_p0eksztg.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:29',
│   │   │   │   'endtime': '2024/02/22 20:31:29',
│   │   │   │   'runtime': '0.006291',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/8ffdf873/hello_world_build.sh'
│   │   │   },
│   │   │   {
│   │   │   │   'id': '769d0ca1',
│   │   │   │   'full_id': '769d0ca1-2122-4390-8f61-556f1259c29d',
│   │   │   │   'description': 'hello world example',
│   │   │   │   'summary': '',
│   │   │   │   'schemafile': 'script.schema.json',
│   │   │   │   'executor': 'generic.local.bash',
│   │   │   │   'compiler': None,
│   │   │   │   'hostname': 'build-23532485-project-280831-buildtest',
│   │   │   │   'user': 'docs',
│   │   │   │   'testroot': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1',
│   │   │   │   'testpath': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/hello_world.sh',
│   │   │   │   'stagedir': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/stage',
│   │   │   │   'command': 'bash hello_world_build.sh',
│   │   │   │   'outfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/hello_world.out',
│   │   │   │   'errfile': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/hello_world.err',
│   │   │   │   'buildenv': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/build-env.txt',
│   │   │   │   'buildspec_content': 'buildspecs:\n  hello_world:\n    executor: generic.local.bash\n    type: script\n    tags: tutorials\n    description: "hello world example"\n    run: echo "hello world!"\nmaintainers:\n- "@shahzebsiddiqui"\n',
│   │   │   │   'test_content': '#!/usr/bin/bash \nset -eo pipefail\n# Content of run section\necho "hello world!"',
│   │   │   │   'buildscript_content': '#!/bin/bash\n\n# Function to handle all signals and perform cleanup\nfunction cleanup() {\n    echo "Signal trapped. Performing cleanup before exiting."\n    exitcode=$?\n    echo "buildtest: command \\`$BASH_COMMAND\' failed (exit code: $exitcode)"\n    exit $exitcode\n}\n\n# Trap all signals and call the cleanup function\ntrap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTERM SIGTSTP SIGTTIN SIGTTOU\n\nexport BUILDTEST_TEST_NAME=hello_world\nexport BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1\nexport BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials\nexport BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/stage\n# source executor startup script\nsource /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh\n# Run generated script\nbash  /tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/stage/hello_world.sh\n# Get return code\nreturncode=$?\n# Exit with return code\nexit $returncode',
│   │   │   │   'logpath': '/tmp/tmpq07_ocbs/var/logs/buildtest_p0eksztg.log',
│   │   │   │   'metrics': {},
│   │   │   │   'check': {
│   │   │   │   │   'regex': None,
│   │   │   │   │   'returncode': None,
│   │   │   │   │   'runtime': None,
│   │   │   │   │   'file_regex': None,
│   │   │   │   │   'slurm_job_state': None,
│   │   │   │   │   'pbs_job_state': None,
│   │   │   │   │   'lsf_job_state': None,
│   │   │   │   │   'assert_ge': None,
│   │   │   │   │   'assert_gt': None,
│   │   │   │   │   'assert_le': None,
│   │   │   │   │   'assert_lt': None,
│   │   │   │   │   'assert_eq': None,
│   │   │   │   │   'assert_ne': None,
│   │   │   │   │   'contains': None,
│   │   │   │   │   'not_contains': None,
│   │   │   │   │   'is_symlink': None,
│   │   │   │   │   'exists': None,
│   │   │   │   │   'is_dir': None,
│   │   │   │   │   'is_file': None,
│   │   │   │   │   'file_count': None
│   │   │   │   },
│   │   │   │   'tags': 'tutorials',
│   │   │   │   'starttime': '2024/02/22 20:31:29',
│   │   │   │   'endtime': '2024/02/22 20:31:29',
│   │   │   │   'runtime': '0.005929',
│   │   │   │   'state': 'PASS',
│   │   │   │   'returncode': '0',
│   │   │   │   'output': 'hello world!\n',
│   │   │   │   'error': '',
│   │   │   │   'job': {},
│   │   │   │   'build_script': '/tmp/tmpq07_ocbs/var/tests/generic.local.bash/hello_world/hello_world/769d0ca1/hello_world_build.sh'
│   │   │   }
│   │   ]
│   }
}

Note

If you pass a valid filepath but file is not in cache you will get an error as follows

$ buildtest it buildspec $BUILDTEST_ROOT/README.rst
Unable to find any buildspecs in cache, please specify one of the following buildspecs: 
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/vars.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/pass_returncode.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/status_regex.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/regex_on_filename.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/runtime_status_test.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/explicit_state.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/exists.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/file_exists_with_number.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/file_and_dir_check.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/is_symlink.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/file_count.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/file_count_pattern.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/file_count_filetype.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/file_count_file_traverse_limit.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/test_status/mode.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/skip_tests.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/hello_world.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/general_tests/configuration/disk_usage.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/general_tests/configuration/ulimits.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/general_tests/configuration/systemd-default-target.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/general_tests/configuration/kernel_state.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/tags_example.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/python-hello.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/python-shell.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/summary_example.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/add_numbers.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/environment.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/csh_shell_examples.yml
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/tutorials/sleep.yml

Query Test Records via buildtest inspect query

The buildtest inspect query command can allow you to retrieve query certain fields from each test records that can be useful when you are inspecting a test. Currently, we can fetch content of output file, error file, testpath, and build script. Shown below are the list of available options for buildtest inspect query.

buildtest inspect --help
$ buildtest inspect query --help
usage: buildtest [options] [COMMANDS] inspect query [-h] [--pager]
                                                    [--theme Color Themes]
                                                    [-b] [-be] [-e] [-o] [-t]
                                                    [name [name ...]]

positional arguments:
  name                  Name of builder to query in report file

optional arguments:
  -h, --help            show this help message and exit
  --pager               Enable PAGING when viewing result
  --theme Color Themes  Specify a color theme, Pygments style to use when
                        displaying output. See
                        https://pygments.org/docs/styles/#getting-a-list-of-
                        available-styles for available themese
  -b, --buildscript     Print build script
  -be, --buildenv       Print content of build env
  -e, --error           Print error file
  -o, --output          Print output file
  -t, --testpath        Print content of testpath

The buildtest inspect query command expects positional arguments that are name of tests which you can get by running buildtest inspect list.

For instance, let’s query the test circle_area by running the following:

buildtest inspect query circle_area
$ buildtest inspect query circle_area
─────────────── circle_area/5baf7cb7-ce91-4adc-a8de-af2adebd7d4c ───────────────
Executor: generic.local.bash
Description: Calculate circle of area given a radius
State: PASS
Returncode: 0
Runtime: 0.031383 sec
Starttime: 2024/02/22 20:31:29
Endtime: 2024/02/22 20:31:29
Command: bash circle_area_build.sh
Test Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.sh
Build Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area_build.sh
Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.out
Error File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.err
Log File: /tmp/tmpq07_ocbs/var/logs/buildtest_uyob0fjj.log

buildtest will display metadata for each test. By default, buildtest will report the last run for each test that is specified as a positional argument.

You can retrieve content of output file via --output or short option -o. In this command, we retrieve the last run for circle_area and print content of output file

buildtest inspect query -o circle_area
$ buildtest inspect query -o circle_area
─────────────── circle_area/5baf7cb7-ce91-4adc-a8de-af2adebd7d4c ───────────────
Executor: generic.local.bash
Description: Calculate circle of area given a radius
State: PASS
Returncode: 0
Runtime: 0.031383 sec
Starttime: 2024/02/22 20:31:29
Endtime: 2024/02/22 20:31:29
Command: bash circle_area_build.sh
Test Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.sh
Build Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area_build.sh
Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.out
Error File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.err
Log File: /tmp/tmpq07_ocbs/var/logs/buildtest_uyob0fjj.log
─ Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/cir… ─
Circle Radius  2                                                                
Area of circle  12.566370614359172

If you want to see content of error file use the -e or --error flag. It would be useful to inspect content of build script and generated test, which can be retrieved using -t and --buildscript. Let’s query test circle_area and report all of the content fields

buildtest inspect query -o -e -t -b circle_area
$ buildtest inspect query -o -e -t -b circle_area
─────────────── circle_area/5baf7cb7-ce91-4adc-a8de-af2adebd7d4c ───────────────
Executor: generic.local.bash
Description: Calculate circle of area given a radius
State: PASS
Returncode: 0
Runtime: 0.031383 sec
Starttime: 2024/02/22 20:31:29
Endtime: 2024/02/22 20:31:29
Command: bash circle_area_build.sh
Test Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.sh
Build Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area_build.sh
Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.out
Error File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/circle_area.err
Log File: /tmp/tmpq07_ocbs/var/logs/buildtest_uyob0fjj.log
─ Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/cir… ─
Circle Radius  2                                                                
Area of circle  12.566370614359172                                              
                                                                                
─ Error File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circ… ─
                                                                                
─ Test File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circl… ─
#!/bin/bash                                                                     
                                                                                
python /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5b
─ Test File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circl… ─
#!/bin/bash                                                                     
                                                                                
# Function to handle all signals and perform cleanup                            
function cleanup() {                                                            
    echo "Signal trapped. Performing cleanup before exiting."                   
    exitcode=$?                                                                 
    echo "buildtest: command \`$BASH_COMMAND' failed (exit code: $exitcode)"    
    exit $exitcode                                                              
}                                                                               
                                                                                
# Trap all signals and call the cleanup function                                
trap cleanup SIGINT SIGTERM SIGHUP SIGQUIT SIGABRT SIGKILL SIGALRM SIGPIPE SIGTE
                                                                                
export BUILDTEST_TEST_NAME=circle_area                                          
export BUILDTEST_TEST_ROOT=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-
export BUILDTEST_BUILDSPEC_DIR=/home/docs/checkouts/readthedocs.org/user_builds/
export BUILDTEST_STAGE_DIR=/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-
# source executor startup script                                                
source /tmp/tmpq07_ocbs/var/executor/generic.local.bash/before_script.sh        
# Run generated script                                                          
/tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-shell/circle_area/5baf7cb7/
# Get return code                                                               
returncode=$?                                                                   
# Exit with return code                                                         
exit $returncode

We can query multiple tests using buildtest inspect query since each test is a positional argument. Any options specified to buildtest inspect query will be applied to all test. For instance, let’s fetch the output the of test names root_disk_usage and python_hello

buildtest inspect query -o root_disk_usage python_hello
$ buildtest inspect query -o root_disk_usage python_hello
────────────── python_hello/a56a8946-1a3e-4e91-8b11-16eafba84127 ───────────────
Executor: generic.local.bash
Description: Hello World python
State: PASS
Returncode: 0
Runtime: 0.03136 sec
Starttime: 2024/02/22 20:31:29
Endtime: 2024/02/22 20:31:29
Command: bash python_hello_build.sh
Test Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello.sh
Build Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello_build.sh
Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello.out
Error File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/python_hello/a56a8946/python_hello.err
Log File: /tmp/tmpq07_ocbs/var/logs/buildtest_uyob0fjj.log
─ Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/python-hello/pyt… ─
Hello World                                                                     
                                                                                
───────────── root_disk_usage/da3fc68a-4df1-404b-9c00-6b79264e46e1 ─────────────
Executor: generic.local.bash
Description: Check root disk usage and report if it exceeds threshold
State: PASS
Returncode: 0
Runtime: 0.0093 sec
Starttime: 2024/02/22 20:30:52
Endtime: 2024/02/22 20:30:52
Command: bash root_disk_usage_build.sh
Test Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/disk_usage/root_disk_usage/da3fc68a/root_disk_usage.sh
Build Script: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/disk_usage/root_disk_usage/da3fc68a/root_disk_usage_build.sh
Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/disk_usage/root_disk_usage/da3fc68a/root_disk_usage.out
Error File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/disk_usage/root_disk_usage/da3fc68a/root_disk_usage.err
Log File: /tmp/tmpq07_ocbs/var/logs/buildtest_gturbz24.log
─ Output File: /tmp/tmpq07_ocbs/var/tests/generic.local.bash/disk_usage/root_… ─
[OK] Root disk is below threshold of 90%

If you want to query specific test ID, you can specify name of test followed by / and test ID. You don’t need to specify the full ID however tab completion is available to help fill in the names. For example if you want to query test record for circle_area/8edce927-2ecc-4991-ac40-e376c03394b4 shown in tab completion you can type a first few characters to query the record

$ buildtest inspect query circle_area/
circle_area/08f20b50-d2e2-41ab-a75e-a7df75e5afcc  circle_area/8edce927-2ecc-4991-ac40-e376c03394b4  circle_area/d47b6ba8-71b6-4531-b8cd-b6ba9b5f0c6c
circle_area/237c3a96-fad0-4ab7-ab1f-3e7ed1816955  circle_area/baea2e9b-a187-4f9f-bcea-75e768ccb0e0  circle_area/e6652700-4cdb-4f6b-80c5-261e4f448876
circle_area/2c279160-1abf-4c70-957f-d9e4608f521b  circle_area/bf8f1762-ebf9-458e-92e2-af3fc6e73eac  circle_area/e7cc7138-a650-4cd8-aca8-b904f901a0da

$ buildtest inspect query circle_area/8ed
──────────────────────────────────────────────────────────────────────────────────────────── circle_area/8edce927-2ecc-4991-ac40-e376c03394b4 ─────────────────────────────────────────────────────────────────────────────────────────────
Executor: generic.local.bash
Description: Calculate circle of area given a radius
State: PASS
Returncode: 0
Runtime: 0.360774 sec
Starttime: 2021/12/23 12:37:25
Endtime: 2021/12/23 12:37:25
Command: bash --norc --noprofile -eo pipefail circle_area_build.sh
Test Script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/python-shell/circle_area/8edce927/circle_area.sh
Build Script: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/python-shell/circle_area/8edce927/circle_area_build.sh
Output File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/python-shell/circle_area/8edce927/circle_area.out
Error File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/tests/generic.local.bash/python-shell/circle_area/8edce927/circle_area.err
Log File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/var/logs/buildtest_c5dnun2l.log

buildtest will search for test ID using re.match so it is possible to apply a regular expression to seek out multiple test records. The tests must be enclosed in quotes " in-order to have a valid regular expression. Here are few examples that can be useful

# retrieve all test records for name `circle_area`
buildtest inspect query circle_area/

# retrieve test records starting with ID `8a` and `bc` for test name `exit1`
buildtest inspect query "exit1/(8a|bc)"

Using Alternate Report File

The buildtest report and buildtest inspect command will read from the report file tracked by buildtest which is stored in $BUILDTEST_ROOT/var/report.json. This single file can became an issue if you are running jobs through CI where you can potentially overwrite same file or if you want separate report files for each set of builds. Luckily we have an option to handle this using the buildtest -r <report_path> build -b <buildspec_path> option which can be used to specify an alternate location to report file.

buildtest will write the report file in the desired location, then you can specify the path to report file via buildtest -r <report_path> report and buildtest -r <report_path> inspect to load the report file when reporting tests.

The report file must be valid JSON file that buildtest understands in order to use buildtest report and buildtest inspect command. Shown below are some examples using the alternate report file using buildtest report and buildtest inspect command.

$ buildtest -r $BUILDTEST_ROOT/python.json report --format name,id
                      Report File: /Users/siddiq90/Documents/GitHubDesktop/buildtest/python.json
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                                                               ┃ id                                            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ circle_area                                                        │ a2814554                                      │
├────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────┤
│ python_hello                                                       │ dd447e43                                      │
└────────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────┘

You can view path to all report files via buildtest report list which keeps track of any new report files created when using buildtest build -r option.

$ buildtest report list
/tmp/tmpq07_ocbs/var/report.json
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/devel/python.json