Test Dependency

Note

This feature is subject to change

Buildtest can support test dependencies which allows one to specify condition before running a test. Let’s take a look at this next example, we have a buildspec with three tests jobA, jobB, and jobC. The test jobA will run immediately but now we introduce a new keyword needs which is a list of test names as dependency. We want test jobB to run after jobA is complete, and jobC to run once jobA and jobB is complete.

buildspecs:
  jobA:
    type: script
    executor: generic.local.bash
    description: no job dependency
    run: |
      echo "This job has no dependency"
      sleep 5

  jobB:
    type: script
    executor: generic.local.bash
    description: job dependency on jobA
    needs: [jobA]
    run: |
      echo "This job depends on jobA"
      sleep 2

  jobC:
    type: script
    executor: generic.local.bash
    description: job dependency on jobA and jobB
    needs: [jobA, jobB]
    run: |
      echo "This job depends on jobA and jobB"
      sleep 2

The needs property expects a list of strings, and values must match name of test. If you specify an invalid test name in needs property then buildtest will ignore the value. If multiple tests are specified in needs property then all test must finish prior to running test.

Let’s run this test, and take a note that buildtest will run test jobA, followed by jobB then jobC.

buildtest build -b tutorials/job_dependency/ex1.yml
$ buildtest build -b tutorials/job_dependency/ex1.yml
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-22529915-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/11/13 01:36:07                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.7                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.18                                                   │
│ Configuration File: /tmp/tmptsqn67rj/config.yml                              │
│ Test Directory:     /tmp/tmptsqn67rj/var/tests                               │
│ Report File:        /tmp/tmptsqn67rj/var/report.json                         │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tu ║
║ torials/job_dependency/ex1.yml                                               ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  1
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 1
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tutorials/job_dependency/ex1.yml: VALID
Total builder objects created: 3
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃          ┃        ┃          ┃          ┃       ┃       ┃ descript ┃ buildsp ┃
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ ion      ┃ ecs     ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ jobA/5ab │ script │ generic. │ None     │ None  │ None  │ no job   │ /home/d │
│ 436ef    │        │ local.ba │          │       │       │ dependen │ ocs/che │
│          │        │ sh       │          │       │       │ cy       │ ckouts/ │
│          │        │          │          │       │       │          │ readthe │
│          │        │          │          │       │       │          │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex1.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ jobB/1db │ script │ generic. │ None     │ None  │ None  │ job      │ /home/d │
│ 1c83a    │        │ local.ba │          │       │       │ dependen │ ocs/che │
│          │        │ sh       │          │       │       │ cy on    │ ckouts/ │
│          │        │          │          │       │       │ jobA     │ readthe │
│          │        │          │          │       │       │          │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex1.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ jobC/59f │ script │ generic. │ None     │ None  │ None  │ job      │ /home/d │
│ 92588    │        │ local.ba │          │       │       │ dependen │ ocs/che │
│          │        │ sh       │          │       │       │ cy on    │ ckouts/ │
│          │        │          │          │       │       │ jobA and │ readthe │
│          │        │          │          │       │       │ jobB     │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex1.ym │
│          │        │          │          │       │       │          │ l       │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
jobA/5ab436ef: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobA/5ab436ef
jobA/5ab436ef: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobA/5ab436ef/stage
jobA/5ab436ef: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobA/5ab436ef/jobA_build.sh
jobB/1db1c83a: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobB/1db1c83a
jobB/1db1c83a: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobB/1db1c83a/stage
jobB/1db1c83a: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobB/1db1c83a/jobB_build.sh
jobC/59f92588: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobC/59f92588
jobC/59f92588: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobC/59f92588/stage
jobC/59f92588: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobC/59f92588/jobC_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
jobA/5ab436ef does not have any dependencies adding test to queue
jobC/59f92588 Skipping job because it has job dependency on jobA/5ab436ef which is in state PENDING
jobB/1db1c83a Skipping job because it has job dependency on jobA/5ab436ef which is in state PENDING
Builders Eligible to Run
┏━━━━━━━━━━━━━━━┓
┃ Builder       ┃
┡━━━━━━━━━━━━━━━┩
│ jobA/5ab436ef │
└───────────────┘
jobA/5ab436ef: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobA/5ab436ef/stage
jobA/5ab436ef: Running Test via command: bash --norc --noprofile -eo pipefail jobA_build.sh
jobA/5ab436ef: Test completed in 5.008909 seconds
jobA/5ab436ef: Test completed with returncode: 0
jobA/5ab436ef: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobA/5ab436ef/jobA.out
jobA/5ab436ef: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobA/5ab436ef/jobA.err
───────────────────────────────── Iteration 2 ──────────────────────────────────
jobC/59f92588 Skipping job because it has job dependency on jobB/1db1c83a which is in state PENDING
Builders Eligible to Run
┏━━━━━━━━━━━━━━━┓
┃ Builder       ┃
┡━━━━━━━━━━━━━━━┩
│ jobB/1db1c83a │
└───────────────┘
jobB/1db1c83a: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobB/1db1c83a/stage
jobB/1db1c83a: Running Test via command: bash --norc --noprofile -eo pipefail jobB_build.sh
jobB/1db1c83a: Test completed in 2.007989 seconds
jobB/1db1c83a: Test completed with returncode: 0
jobB/1db1c83a: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobB/1db1c83a/jobB.out
jobB/1db1c83a: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobB/1db1c83a/jobB.err
───────────────────────────────── Iteration 3 ──────────────────────────────────
Builders Eligible to Run
┏━━━━━━━━━━━━━━━┓
┃ Builder       ┃
┡━━━━━━━━━━━━━━━┩
│ jobC/59f92588 │
└───────────────┘
jobC/59f92588: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobC/59f92588/stage
jobC/59f92588: Running Test via command: bash --norc --noprofile -eo pipefail jobC_build.sh
jobC/59f92588: Test completed in 2.007733 seconds
jobC/59f92588: Test completed with returncode: 0
jobC/59f92588: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobC/59f92588/jobC.out
jobC/59f92588: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex1/jobC/59f92588/jobC.err
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃               ┃        ┃ checks       ┃            ┃          ┃
┃              ┃               ┃        ┃ (ReturnCode, ┃            ┃          ┃
┃              ┃               ┃        ┃ Regex,       ┃            ┃          ┃
┃ builder      ┃ executor      ┃ status ┃ Runtime)     ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ jobC/59f9258 │ generic.local │ PASS   │ None None    │ 0          │ 2.007733 │
│ 8            │ .bash         │        │ None         │            │          │
├──────────────┼───────────────┼────────┼──────────────┼────────────┼──────────┤
│ jobA/5ab436e │ generic.local │ PASS   │ None None    │ 0          │ 5.008909 │
│ f            │ .bash         │        │ None         │            │          │
├──────────────┼───────────────┼────────┼──────────────┼────────────┼──────────┤
│ jobB/1db1c83 │ generic.local │ PASS   │ None None    │ 0          │ 2.007989 │
│ a            │ .bash         │        │ None         │            │          │
└──────────────┴───────────────┴────────┴──────────────┴────────────┴──────────┘



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


Adding 3 test results to /tmp/tmptsqn67rj/var/report.json
Writing Logfile to: /tmp/tmptsqn67rj/var/logs/buildtest_r29840yw.log

Test Dependency by returncode

In this next example, we can control behavior of job dependency based on returncode for a given test. This test has three tests: test1, test2 and test3. The first test will exit with returncode 1 but this test will pass because we have set state: PASS to override the status check. The next test test2 requires test1 to have a returncode of 1 in order to satisfy dependency. The returncode property expects a valid returncode and it can be a list of returncode similar to how one specify returncode under the status property see Return Code Matching. The needs property can support multiple test with returncode, in test3 we require test1 to have returncode 1 while test2 has a returncode of 2. We expect test2 to return a returncode of 2 because of exit 2 statement so we expect all three tests to run.

buildspecs:
  test1:
    type: script
    executor: generic.local.bash
    description: This test will pass with exit 1
    run: exit 1
    status:
      state: PASS

  test2:
    type: script
    executor: generic.local.bash
    description: This test will run if test1 has returncode 1
    run: exit 2
    status:
      state: PASS
    needs:
      - test1:
          returncode: 1

  test3:
    type: script
    executor: generic.local.bash
    description: This test will run if test1 has returncode 1 and test2 has returncode 2
    run: exit 1
    status:
      state: PASS
    needs:
      - test1:
          returncode: 1
      - test2:
          returncode: 2

Let’s build this test and take note of execution order of test.

buildtest build -b tutorials/job_dependency/ex2.yml
$ buildtest build -b tutorials/job_dependency/ex2.yml
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-22529915-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/11/13 01:36:17                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.7                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.18                                                   │
│ Configuration File: /tmp/tmptsqn67rj/config.yml                              │
│ Test Directory:     /tmp/tmptsqn67rj/var/tests                               │
│ Report File:        /tmp/tmptsqn67rj/var/report.json                         │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tu ║
║ torials/job_dependency/ex2.yml                                               ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  1
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 1
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tutorials/job_dependency/ex2.yml: VALID
Total builder objects created: 3
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃          ┃        ┃          ┃          ┃       ┃       ┃ descript ┃ buildsp ┃
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ ion      ┃ ecs     ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ test1/9a │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ 42a43b   │        │ local.ba │          │       │       │ test     │ ocs/che │
│          │        │ sh       │          │       │       │ will     │ ckouts/ │
│          │        │          │          │       │       │ pass     │ readthe │
│          │        │          │          │       │       │ with     │ docs.or │
│          │        │          │          │       │       │ exit 1   │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex2.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ test2/4e │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ b4fd7f   │        │ local.ba │          │       │       │ test     │ ocs/che │
│          │        │ sh       │          │       │       │ will run │ ckouts/ │
│          │        │          │          │       │       │ if test1 │ readthe │
│          │        │          │          │       │       │ has      │ docs.or │
│          │        │          │          │       │       │ returnco │ g/user_ │
│          │        │          │          │       │       │ de 1     │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex2.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ test3/69 │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ 5a5f1a   │        │ local.ba │          │       │       │ test     │ ocs/che │
│          │        │ sh       │          │       │       │ will run │ ckouts/ │
│          │        │          │          │       │       │ if test1 │ readthe │
│          │        │          │          │       │       │ has      │ docs.or │
│          │        │          │          │       │       │ returnco │ g/user_ │
│          │        │          │          │       │       │ de 1 and │ builds/ │
│          │        │          │          │       │       │ test2    │ buildte │
│          │        │          │          │       │       │ has      │ st/chec │
│          │        │          │          │       │       │ returnco │ kouts/v │
│          │        │          │          │       │       │ de 2     │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex2.ym │
│          │        │          │          │       │       │          │ l       │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
test1/9a42a43b: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test1/9a42a43b
test1/9a42a43b: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test1/9a42a43b/stage
test1/9a42a43b: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test1/9a42a43b/test1_build.sh
test2/4eb4fd7f: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test2/4eb4fd7f
test2/4eb4fd7f: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test2/4eb4fd7f/stage
test2/4eb4fd7f: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test2/4eb4fd7f/test2_build.sh
test3/695a5f1a: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test3/695a5f1a
test3/695a5f1a: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test3/695a5f1a/stage
test3/695a5f1a: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test3/695a5f1a/test3_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
test3/695a5f1a Skipping job because it has job dependency on test1/9a42a43b 
test2/4eb4fd7f Skipping job because it has job dependency on test1/9a42a43b 
test1/9a42a43b does not have any dependencies adding test to queue
Builders Eligible to Run
┏━━━━━━━━━━━━━━━━┓
┃ Builder        ┃
┡━━━━━━━━━━━━━━━━┩
│ test1/9a42a43b │
└────────────────┘
test1/9a42a43b: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test1/9a42a43b/stage
test1/9a42a43b: Running Test via command: bash --norc --noprofile -eo pipefail test1_build.sh
test1/9a42a43b failed to submit job with returncode: 1
─────────────────────── Error Message for test1/9a42a43b ───────────────────────

test1/9a42a43b: Detected failure in running test, will attempt to retry test: 1 times
test1/9a42a43b: Run - 1/1
test1/9a42a43b: Running Test via command: bash --norc --noprofile -eo pipefail test1_build.sh
test1/9a42a43b: failed to submit job with returncode: 1
test1/9a42a43b: Test completed in 0.014753 seconds
test1/9a42a43b: Test completed with returncode: 1
test1/9a42a43b: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test1/9a42a43b/test1.out
test1/9a42a43b: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test1/9a42a43b/test1.err
───────────────────────────────── Iteration 2 ──────────────────────────────────
test3/695a5f1a Skipping job because it has job dependency on test2/4eb4fd7f 
Builders Eligible to Run
┏━━━━━━━━━━━━━━━━┓
┃ Builder        ┃
┡━━━━━━━━━━━━━━━━┩
│ test2/4eb4fd7f │
└────────────────┘
test2/4eb4fd7f: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test2/4eb4fd7f/stage
test2/4eb4fd7f: Running Test via command: bash --norc --noprofile -eo pipefail test2_build.sh
test2/4eb4fd7f failed to submit job with returncode: 2
─────────────────────── Error Message for test2/4eb4fd7f ───────────────────────

test2/4eb4fd7f: Detected failure in running test, will attempt to retry test: 1 times
test2/4eb4fd7f: Run - 1/1
test2/4eb4fd7f: Running Test via command: bash --norc --noprofile -eo pipefail test2_build.sh
test2/4eb4fd7f: failed to submit job with returncode: 2
test2/4eb4fd7f: Test completed in 0.01578 seconds
test2/4eb4fd7f: Test completed with returncode: 2
test2/4eb4fd7f: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test2/4eb4fd7f/test2.out
test2/4eb4fd7f: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test2/4eb4fd7f/test2.err
───────────────────────────────── Iteration 3 ──────────────────────────────────
Builders Eligible to Run
┏━━━━━━━━━━━━━━━━┓
┃ Builder        ┃
┡━━━━━━━━━━━━━━━━┩
│ test3/695a5f1a │
└────────────────┘
test3/695a5f1a: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test3/695a5f1a/stage
test3/695a5f1a: Running Test via command: bash --norc --noprofile -eo pipefail test3_build.sh
test3/695a5f1a failed to submit job with returncode: 1
─────────────────────── Error Message for test3/695a5f1a ───────────────────────

test3/695a5f1a: Detected failure in running test, will attempt to retry test: 1 times
test3/695a5f1a: Run - 1/1
test3/695a5f1a: Running Test via command: bash --norc --noprofile -eo pipefail test3_build.sh
test3/695a5f1a: failed to submit job with returncode: 1
test3/695a5f1a: Test completed in 0.014799 seconds
test3/695a5f1a: Test completed with returncode: 1
test3/695a5f1a: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test3/695a5f1a/test3.out
test3/695a5f1a: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex2/test3/695a5f1a/test3.err
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ test2/4eb4fd │ generic.loca │ PASS   │ None None     │ 2          │ 0.01578  │
│ 7f           │ l.bash       │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ test1/9a42a4 │ generic.loca │ PASS   │ None None     │ 1          │ 0.014753 │
│ 3b           │ l.bash       │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ test3/695a5f │ generic.loca │ PASS   │ None None     │ 1          │ 0.014799 │
│ 1a           │ l.bash       │        │ None          │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 3 test results to /tmp/tmptsqn67rj/var/report.json
Writing Logfile to: /tmp/tmptsqn67rj/var/logs/buildtest_9v99sdpg.log

Test Dependency by state

You can specify state as a property to check for test state when specify test dependency. In this next example, we have have four tests pass_test, fail_test, pass_and_fail_test, and final_test. The first test will be a PASS because we have state: PASS. The test fail_test depends on pass_test only if it has state: PASS, if value is mismatch then test will be skipped. Note that buildtest will skip test until next iteration if test is not executed, however if test is complete then buildtest will cancel dependent test. We can specify multiple test dependencies with state property such as test pass_and_fail_test which expects pass_test to have state: PASS and fail_test to have state: FAIL. In test final_test, shows how you can combine the format, the needs property is a list of object where each element is name of test. If no properties are associated with test name then buildtest will wait until job is complete to execute test. In this example, the test expects both pass_test and fail_test to run while pass_and_fail_test must have returncode of 1.

buildspecs:
  pass_test:
    type: script
    executor: generic.local.bash
    description: This test will always pass
    status:
      state: PASS
    run: |
      echo "This test will pass"
      sleep 2

  fail_test:
    type: script
    executor: generic.local.bash
    description: This test will run if test 'pass_test' is in state 'PASS'
    status:
      state: FAIL
    needs:
      - pass_test:
          state: PASS
    run: |
      echo "This test will fail"
      sleep 2

  pass_and_fail_test:
    type: script
    executor: generic.local.bash
    description: This test will run if pass_test is 'PASS' and fail_test is 'FAIL'
    needs:
      - pass_test:
          state: PASS
      - fail_test:
          state: FAIL
    run: |
      sleep 2
      exit 1
    status:
      returncode: 1

  final_test:
    type: script
    executor: generic.local.bash
    description: Test will run after 'pass_test', 'fail_test', and 'pass_and_fail_test'
    needs:
      - pass_test
      - fail_test
      - pass_and_fail_test:
          returncode: 1
    run: |
      sleep 2
      echo "Hello world"

Let’s build this test and take note all tests are run.

buildtest build -b tutorials/job_dependency/ex3.yml
$ buildtest build -b tutorials/job_dependency/ex3.yml
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-22529915-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/11/13 01:36:18                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.7                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.18                                                   │
│ Configuration File: /tmp/tmptsqn67rj/config.yml                              │
│ Test Directory:     /tmp/tmptsqn67rj/var/tests                               │
│ Report File:        /tmp/tmptsqn67rj/var/report.json                         │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tu ║
║ torials/job_dependency/ex3.yml                                               ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  1
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 1
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tutorials/job_dependency/ex3.yml: VALID
Total builder objects created: 4
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃          ┃        ┃          ┃          ┃       ┃       ┃ descript ┃ buildsp ┃
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ ion      ┃ ecs     ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ pass_tes │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ t/bee79c │        │ local.ba │          │       │       │ test     │ ocs/che │
│ 38       │        │ sh       │          │       │       │ will     │ ckouts/ │
│          │        │          │          │       │       │ always   │ readthe │
│          │        │          │          │       │       │ pass     │ docs.or │
│          │        │          │          │       │       │          │ g/user_ │
│          │        │          │          │       │       │          │ builds/ │
│          │        │          │          │       │       │          │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex3.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ fail_tes │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ t/a4c7d0 │        │ local.ba │          │       │       │ test     │ ocs/che │
│ 00       │        │ sh       │          │       │       │ will run │ ckouts/ │
│          │        │          │          │       │       │ if test  │ readthe │
│          │        │          │          │       │       │ 'pass_te │ docs.or │
│          │        │          │          │       │       │ st' is   │ g/user_ │
│          │        │          │          │       │       │ in state │ builds/ │
│          │        │          │          │       │       │ 'PASS'   │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex3.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ pass_and │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ _fail_te │        │ local.ba │          │       │       │ test     │ ocs/che │
│ st/3a84a │        │ sh       │          │       │       │ will run │ ckouts/ │
│ 8d3      │        │          │          │       │       │ if       │ readthe │
│          │        │          │          │       │       │ pass_tes │ docs.or │
│          │        │          │          │       │       │ t is     │ g/user_ │
│          │        │          │          │       │       │ 'PASS'   │ builds/ │
│          │        │          │          │       │       │ and      │ buildte │
│          │        │          │          │       │       │ fail_tes │ st/chec │
│          │        │          │          │       │       │ t is     │ kouts/v │
│          │        │          │          │       │       │ 'FAIL'   │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex3.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ final_te │ script │ generic. │ None     │ None  │ None  │ Test     │ /home/d │
│ st/87950 │        │ local.ba │          │       │       │ will run │ ocs/che │
│ d1a      │        │ sh       │          │       │       │ after    │ ckouts/ │
│          │        │          │          │       │       │ 'pass_te │ readthe │
│          │        │          │          │       │       │ st',     │ docs.or │
│          │        │          │          │       │       │ 'fail_te │ g/user_ │
│          │        │          │          │       │       │ st', and │ builds/ │
│          │        │          │          │       │       │ 'pass_an │ buildte │
│          │        │          │          │       │       │ d_fail_t │ st/chec │
│          │        │          │          │       │       │ est'     │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex3.ym │
│          │        │          │          │       │       │          │ l       │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
pass_test/bee79c38: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_test/bee79c38
pass_test/bee79c38: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_test/bee79c38/stage
pass_test/bee79c38: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_test/bee79c38/pass_test_build.sh
fail_test/a4c7d000: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/fail_test/a4c7d000
fail_test/a4c7d000: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/fail_test/a4c7d000/stage
fail_test/a4c7d000: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/fail_test/a4c7d000/fail_test_build.sh
pass_and_fail_test/3a84a8d3: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_and_fail_test/3a84a8d3
pass_and_fail_test/3a84a8d3: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_and_fail_test/3a84a8d3/stage
pass_and_fail_test/3a84a8d3: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_and_fail_test/3a84a8d3/pass_and_fail_test_build.sh
final_test/87950d1a: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/final_test/87950d1a
final_test/87950d1a: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/final_test/87950d1a/stage
final_test/87950d1a: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/final_test/87950d1a/final_test_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
final_test/87950d1a Skipping job because it has job dependency on pass_test/bee79c38 which is in state PENDING
pass_and_fail_test/3a84a8d3 Skipping job because it has job dependency on pass_test/bee79c38
pass_test/bee79c38 does not have any dependencies adding test to queue
fail_test/a4c7d000 Skipping job because it has job dependency on pass_test/bee79c38
Builders Eligible to Run
┏━━━━━━━━━━━━━━━━━━━━┓
┃ Builder            ┃
┡━━━━━━━━━━━━━━━━━━━━┩
│ pass_test/bee79c38 │
└────────────────────┘
pass_test/bee79c38: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_test/bee79c38/stage
pass_test/bee79c38: Running Test via command: bash --norc --noprofile -eo pipefail pass_test_build.sh
pass_test/bee79c38: Test completed in 2.007806 seconds
pass_test/bee79c38: Test completed with returncode: 0
pass_test/bee79c38: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_test/bee79c38/pass_test.out
pass_test/bee79c38: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_test/bee79c38/pass_test.err
───────────────────────────────── Iteration 2 ──────────────────────────────────
final_test/87950d1a Skipping job because it has job dependency on fail_test/a4c7d000 which is in state PENDING
pass_and_fail_test/3a84a8d3 Skipping job because it has job dependency on fail_test/a4c7d000
Builders Eligible to Run
┏━━━━━━━━━━━━━━━━━━━━┓
┃ Builder            ┃
┡━━━━━━━━━━━━━━━━━━━━┩
│ fail_test/a4c7d000 │
└────────────────────┘
fail_test/a4c7d000: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/fail_test/a4c7d000/stage
fail_test/a4c7d000: Running Test via command: bash --norc --noprofile -eo pipefail fail_test_build.sh
fail_test/a4c7d000: Test completed in 2.007779 seconds
fail_test/a4c7d000: Test completed with returncode: 0
fail_test/a4c7d000: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/fail_test/a4c7d000/fail_test.out
fail_test/a4c7d000: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/fail_test/a4c7d000/fail_test.err
───────────────────────────────── Iteration 3 ──────────────────────────────────
final_test/87950d1a Skipping job because it has job dependency on pass_and_fail_test/3a84a8d3
   Builders Eligible to Run    
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder                     ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ pass_and_fail_test/3a84a8d3 │
└─────────────────────────────┘
pass_and_fail_test/3a84a8d3: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_and_fail_test/3a84a8d3/stage
pass_and_fail_test/3a84a8d3: Running Test via command: bash --norc --noprofile -eo pipefail pass_and_fail_test_build.sh
pass_and_fail_test/3a84a8d3 failed to submit job with returncode: 1
──────────────── Error Message for pass_and_fail_test/3a84a8d3 ─────────────────

pass_and_fail_test/3a84a8d3: Detected failure in running test, will attempt to retry test: 1 times
pass_and_fail_test/3a84a8d3: Run - 1/1
pass_and_fail_test/3a84a8d3: Running Test via command: bash --norc --noprofile -eo pipefail pass_and_fail_test_build.sh
pass_and_fail_test/3a84a8d3: failed to submit job with returncode: 1
pass_and_fail_test/3a84a8d3: Test completed in 4.019885 seconds
pass_and_fail_test/3a84a8d3: Test completed with returncode: 1
pass_and_fail_test/3a84a8d3: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_and_fail_test/3a84a8d3/pass_and_fail_test.out
pass_and_fail_test/3a84a8d3: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/pass_and_fail_test/3a84a8d3/pass_and_fail_test.err
pass_and_fail_test/3a84a8d3: Checking returncode - 1 is matched in list [1]
───────────────────────────────── Iteration 4 ──────────────────────────────────
Builders Eligible to Run
┏━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder             ┃
┡━━━━━━━━━━━━━━━━━━━━━┩
│ final_test/87950d1a │
└─────────────────────┘
final_test/87950d1a: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/final_test/87950d1a/stage
final_test/87950d1a: Running Test via command: bash --norc --noprofile -eo pipefail final_test_build.sh
final_test/87950d1a: Test completed in 2.007993 seconds
final_test/87950d1a: Test completed with returncode: 0
final_test/87950d1a: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/final_test/87950d1a/final_test.out
final_test/87950d1a: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex3/final_test/87950d1a/final_test.err
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ pass_test/be │ generic.loca │ PASS   │ None None     │ 0          │ 2.007806 │
│ e79c38       │ l.bash       │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ final_test/8 │ generic.loca │ PASS   │ None None     │ 0          │ 2.007993 │
│ 7950d1a      │ l.bash       │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ fail_test/a4 │ generic.loca │ FAIL   │ None None     │ 0          │ 2.007779 │
│ c7d000       │ l.bash       │        │ None          │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ pass_and_fai │ generic.loca │ PASS   │ True None     │ 1          │ 4.019885 │
│ l_test/3a84a │ l.bash       │        │ None          │            │          │
│ 8d3          │              │        │               │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



Passed Tests: 3/4 Percentage: 75.000%
Failed Tests: 1/4 Percentage: 25.000%


Adding 4 test results to /tmp/tmptsqn67rj/var/report.json
Writing Logfile to: /tmp/tmptsqn67rj/var/logs/buildtest_65ubsris.log

In this next example, we have three tests the first test will runtime_test will sleep for 5 seconds but it will fail due to runtime requirement of 2sec. The next two tests runtime_test_pass and runtime_test_fail both depend on runtime_test however due to condition only one of them can be run because runtime_test_pass expects runtime_test to have state: PASS while runtime_test_fail expects runtime_test to have state: FAIL. This type of workflow can be used if you want to run a set of test based on one condition while running a different set of test based on the negative condition.

buildspecs:
  runtime_test:
    type: script
    executor: generic.local.bash
    description: This test will sleep 5 second but will fail due to runtime 2sec
    status:
      runtime:
        min: 2.0
    run: sleep 5

  runtime_test_pass:
    type: script
    executor: generic.local.bash
    description: This test will run when runtime_test_pass is PASS
    needs:
      - runtime_test:
          state: PASS
    run: echo "Performing some action when test PASS"

  runtime_test_fail:
    type: script
    executor: generic.local.bash
    description: This test will run when runtime_test_pass is FAIL
    needs:
      - runtime_test:
          state: FAIL
    run: echo "Performing some action when test FAIL"

Let’s build this test and take note that we only run two tests and runtime_test_fail was skipped because test runtime_test has a state: PASS.

buildtest build -b tutorials/job_dependency/ex4.yml
$ buildtest build -b tutorials/job_dependency/ex4.yml
╭───────────────────────────── buildtest summary ──────────────────────────────╮
│                                                                              │
│ User:               docs                                                     │
│ Hostname:           build-22529915-project-280831-buildtest                  │
│ Platform:           Linux                                                    │
│ Current Time:       2023/11/13 01:36:29                                      │
│ buildtest path:     /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ buildtest version:  1.7                                                      │
│ python path:        /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│ python version:     3.8.18                                                   │
│ Configuration File: /tmp/tmptsqn67rj/config.yml                              │
│ Test Directory:     /tmp/tmptsqn67rj/var/tests                               │
│ Report File:        /tmp/tmptsqn67rj/var/report.json                         │
│ Command:            /home/docs/checkouts/readthedocs.org/user_builds/buildte │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
───────────────────────────  Discovering Buildspecs ────────────────────────────
                             Discovered buildspecs                              
╔══════════════════════════════════════════════════════════════════════════════╗
║ buildspec                                                                    ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tu ║
║ torials/job_dependency/ex4.yml                                               ║
╚══════════════════════════════════════════════════════════════════════════════╝


Total Discovered Buildspecs:  1
Total Excluded Buildspecs:  0
Detected Buildspecs after exclusion:  1
────────────────────────────── Parsing Buildspecs ──────────────────────────────
Valid Buildspecs: 1
Invalid Buildspecs: 0
/home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.7/tutorials/job_dependency/ex4.yml: VALID
Total builder objects created: 3
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃          ┃        ┃          ┃          ┃       ┃       ┃ descript ┃ buildsp ┃
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ ion      ┃ ecs     ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ runtime_ │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ test/029 │        │ local.ba │          │       │       │ test     │ ocs/che │
│ 3e3dd    │        │ sh       │          │       │       │ will     │ ckouts/ │
│          │        │          │          │       │       │ sleep 5  │ readthe │
│          │        │          │          │       │       │ second   │ docs.or │
│          │        │          │          │       │       │ but will │ g/user_ │
│          │        │          │          │       │       │ fail due │ builds/ │
│          │        │          │          │       │       │ to       │ buildte │
│          │        │          │          │       │       │ runtime  │ st/chec │
│          │        │          │          │       │       │ 2sec     │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex4.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ runtime_ │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ test_pas │        │ local.ba │          │       │       │ test     │ ocs/che │
│ s/70eff3 │        │ sh       │          │       │       │ will run │ ckouts/ │
│ 25       │        │          │          │       │       │ when     │ readthe │
│          │        │          │          │       │       │ runtime_ │ docs.or │
│          │        │          │          │       │       │ test_pas │ g/user_ │
│          │        │          │          │       │       │ s is     │ builds/ │
│          │        │          │          │       │       │ PASS     │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex4.ym │
│          │        │          │          │       │       │          │ l       │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ runtime_ │ script │ generic. │ None     │ None  │ None  │ This     │ /home/d │
│ test_fai │        │ local.ba │          │       │       │ test     │ ocs/che │
│ l/b18102 │        │ sh       │          │       │       │ will run │ ckouts/ │
│ 0c       │        │          │          │       │       │ when     │ readthe │
│          │        │          │          │       │       │ runtime_ │ docs.or │
│          │        │          │          │       │       │ test_pas │ g/user_ │
│          │        │          │          │       │       │ s is     │ builds/ │
│          │        │          │          │       │       │ FAIL     │ buildte │
│          │        │          │          │       │       │          │ st/chec │
│          │        │          │          │       │       │          │ kouts/v │
│          │        │          │          │       │       │          │ 1.7/tut │
│          │        │          │          │       │       │          │ orials/ │
│          │        │          │          │       │       │          │ job_dep │
│          │        │          │          │       │       │          │ endency │
│          │        │          │          │       │       │          │ /ex4.ym │
│          │        │          │          │       │       │          │ l       │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
runtime_test/0293e3dd: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test/0293e3dd
runtime_test/0293e3dd: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test/0293e3dd/stage
runtime_test/0293e3dd: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test/0293e3dd/runtime_test_build.sh
runtime_test_pass/70eff325: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_pass/70eff325
runtime_test_pass/70eff325: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_pass/70eff325/stage
runtime_test_pass/70eff325: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_pass/70eff325/runtime_test_pass_build.sh
runtime_test_fail/b181020c: Creating test directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_fail/b181020c
runtime_test_fail/b181020c: Creating the stage directory: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_fail/b181020c/stage
runtime_test_fail/b181020c: Writing build script: /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_fail/b181020c/runtime_test_fail_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
runtime_test/0293e3dd does not have any dependencies adding test to queue
runtime_test_pass/70eff325 Skipping job because it has job dependency on runtime_test/0293e3dd
runtime_test_fail/b181020c Skipping job because it has job dependency on runtime_test/0293e3dd
Builders Eligible to Run 
┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder               ┃
┡━━━━━━━━━━━━━━━━━━━━━━━┩
│ runtime_test/0293e3dd │
└───────────────────────┘
runtime_test/0293e3dd: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test/0293e3dd/stage
runtime_test/0293e3dd: Running Test via command: bash --norc --noprofile -eo pipefail runtime_test_build.sh
runtime_test/0293e3dd: Test completed in 5.007943 seconds
runtime_test/0293e3dd: Test completed with returncode: 0
runtime_test/0293e3dd: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test/0293e3dd/runtime_test.out
runtime_test/0293e3dd: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test/0293e3dd/runtime_test.err
runtime_test/0293e3dd: Checking  mintime < runtime: 2.0 < 5.007943
───────────────────────────────── Iteration 2 ──────────────────────────────────
runtime_test_fail/b181020c is cancelled because it depends on runtime_test/0293e3dd to have state: FAIL but actual value is PASS
   Builders Eligible to Run   
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Builder                    ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ runtime_test_pass/70eff325 │
└────────────────────────────┘
runtime_test_pass/70eff325: Current Working Directory : /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_pass/70eff325/stage
runtime_test_pass/70eff325: Running Test via command: bash --norc --noprofile -eo pipefail runtime_test_pass_build.sh
runtime_test_pass/70eff325: Test completed in 0.006571 seconds
runtime_test_pass/70eff325: Test completed with returncode: 0
runtime_test_pass/70eff325: Writing output file -  /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_pass/70eff325/runtime_test_pass.out
runtime_test_pass/70eff325: Writing error file - /tmp/tmptsqn67rj/var/tests/generic.local.bash/ex4/runtime_test_pass/70eff325/runtime_test_pass.err
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ runtime_test │ generic.loca │ PASS   │ None None     │ 0          │ 0.006571 │
│ _pass/70eff3 │ l.bash       │        │ None          │            │          │
│ 25           │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ runtime_test │ generic.loca │ PASS   │ None None     │ 0          │ 5.007943 │
│ /0293e3dd    │ l.bash       │        │ True          │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 2 test results to /tmp/tmptsqn67rj/var/report.json
Writing Logfile to: /tmp/tmptsqn67rj/var/logs/buildtest_okbp4wfv.log