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


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.1/tutorials/job_dependency/ex1.yml: VALID
Total builder objects created: 3
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ jobA/94… │ script │ generic… │ None     │ None  │ None  │ no job   │ /home/… │
│          │        │          │          │       │       │ depende… │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ jobB/62… │ script │ generic… │ None     │ None  │ None  │ job      │ /home/… │
│          │        │          │          │       │       │ depende… │         │
│          │        │          │          │       │       │ on jobA  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ jobC/f3… │ script │ generic… │ None     │ None  │ None  │ job      │ /home/… │
│          │        │          │          │       │       │ depende… │         │
│          │        │          │          │       │       │ on jobA  │         │
│          │        │          │          │       │       │ and jobB │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
jobA/94612791: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobA/94612791
jobA/94612791: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobA/94612791/stage
jobA/94612791: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobA/94612791/jobA_build.sh
jobB/62312337: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobB/62312337
jobB/62312337: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobB/62312337/stage
jobB/62312337: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobB/62312337/jobB_build.sh
jobC/f36ce00c: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobC/f36ce00c
jobC/f36ce00c: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobC/f36ce00c/stage
jobC/f36ce00c: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobC/f36ce00c/jobC_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
jobC/f36ce00c Skipping job because it has job dependency on jobA/94612791 which is in state PENDING
jobB/62312337 Skipping job because it has job dependency on jobA/94612791 which is in state PENDING
jobA/94612791 does not have any dependencies adding test to queue
jobA/94612791: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobA/94612791/stage
jobA/94612791: Running Test via command: bash --norc --noprofile -eo pipefail jobA_build.sh
jobA/94612791: Test completed in 5.006941 seconds
jobA/94612791: Test completed with returncode: 0
jobA/94612791: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobA/94612791/jobA.out
jobA/94612791: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobA/94612791/jobA.err
In this iteration we are going to run the following tests: [jobA/94612791]
───────────────────────────────── Iteration 2 ──────────────────────────────────
jobC/f36ce00c Skipping job because it has job dependency on jobB/62312337 which is in state PENDING
jobB/62312337: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobB/62312337/stage
jobB/62312337: Running Test via command: bash --norc --noprofile -eo pipefail jobB_build.sh
jobB/62312337: Test completed in 2.007574 seconds
jobB/62312337: Test completed with returncode: 0
jobB/62312337: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobB/62312337/jobB.out
jobB/62312337: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobB/62312337/jobB.err
In this iteration we are going to run the following tests: [jobB/62312337]
───────────────────────────────── Iteration 3 ──────────────────────────────────
jobC/f36ce00c: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobC/f36ce00c/stage
jobC/f36ce00c: Running Test via command: bash --norc --noprofile -eo pipefail jobC_build.sh
jobC/f36ce00c: Test completed in 2.00735 seconds
jobC/f36ce00c: Test completed with returncode: 0
jobC/f36ce00c: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobC/f36ce00c/jobC.out
jobC/f36ce00c: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex1/jobC/f36ce00c/jobC.err
In this iteration we are going to run the following tests: [jobC/f36ce00c]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃               ┃        ┃ checks       ┃            ┃          ┃
┃              ┃               ┃        ┃ (ReturnCode, ┃            ┃          ┃
┃              ┃               ┃        ┃ Regex,       ┃            ┃          ┃
┃ builder      ┃ executor      ┃ status ┃ Runtime)     ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ jobB/6231233 │ generic.loca… │ PASS   │ N/A N/A N/A  │ 0          │ 2.007574 │
│ 7            │               │        │              │            │          │
├──────────────┼───────────────┼────────┼──────────────┼────────────┼──────────┤
│ jobC/f36ce00 │ generic.loca… │ PASS   │ N/A N/A N/A  │ 0          │ 2.00735  │
│ c            │               │        │              │            │          │
├──────────────┼───────────────┼────────┼──────────────┼────────────┼──────────┤
│ jobA/9461279 │ generic.loca… │ PASS   │ N/A N/A N/A  │ 0          │ 5.006941 │
│ 1            │               │        │              │            │          │
└──────────────┴───────────────┴────────┴──────────────┴────────────┴──────────┘



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


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


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.1/tutorials/job_dependency/ex2.yml: VALID
Total builder objects created: 3
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ test1/6… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will     │         │
│          │        │          │          │       │       │ pass     │         │
│          │        │          │          │       │       │ with     │         │
│          │        │          │          │       │       │ exit 1   │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ test2/a… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will run │         │
│          │        │          │          │       │       │ if test1 │         │
│          │        │          │          │       │       │ has      │         │
│          │        │          │          │       │       │ returnc… │         │
│          │        │          │          │       │       │ 1        │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ test3/e… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will run │         │
│          │        │          │          │       │       │ if test1 │         │
│          │        │          │          │       │       │ has      │         │
│          │        │          │          │       │       │ returnc… │         │
│          │        │          │          │       │       │ 1 and    │         │
│          │        │          │          │       │       │ test2    │         │
│          │        │          │          │       │       │ has      │         │
│          │        │          │          │       │       │ returnc… │         │
│          │        │          │          │       │       │ 2        │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
test1/67f20f1e: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test1/67f20f1e
test1/67f20f1e: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test1/67f20f1e/stage
test1/67f20f1e: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test1/67f20f1e/test1_build.sh
test2/a3e5b7a1: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test2/a3e5b7a1
test2/a3e5b7a1: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test2/a3e5b7a1/stage
test2/a3e5b7a1: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test2/a3e5b7a1/test2_build.sh
test3/e5473e43: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test3/e5473e43
test3/e5473e43: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test3/e5473e43/stage
test3/e5473e43: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test3/e5473e43/test3_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
test2/a3e5b7a1 Skipping job because it has job dependency on test1/67f20f1e 
test3/e5473e43 Skipping job because it has job dependency on test1/67f20f1e 
test1/67f20f1e does not have any dependencies adding test to queue
test1/67f20f1e: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test1/67f20f1e/stage
test1/67f20f1e: Running Test via command: bash --norc --noprofile -eo pipefail test1_build.sh
test1/67f20f1e: Test completed in 0.005588 seconds
test1/67f20f1e: Test completed with returncode: 1
test1/67f20f1e: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test1/67f20f1e/test1.out
test1/67f20f1e: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test1/67f20f1e/test1.err
In this iteration we are going to run the following tests: [test1/67f20f1e]
───────────────────────────────── Iteration 2 ──────────────────────────────────
test3/e5473e43 Skipping job because it has job dependency on test2/a3e5b7a1 
test2/a3e5b7a1: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test2/a3e5b7a1/stage
test2/a3e5b7a1: Running Test via command: bash --norc --noprofile -eo pipefail test2_build.sh
test2/a3e5b7a1: Test completed in 0.005425 seconds
test2/a3e5b7a1: Test completed with returncode: 2
test2/a3e5b7a1: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test2/a3e5b7a1/test2.out
test2/a3e5b7a1: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test2/a3e5b7a1/test2.err
In this iteration we are going to run the following tests: [test2/a3e5b7a1]
───────────────────────────────── Iteration 3 ──────────────────────────────────
test3/e5473e43: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test3/e5473e43/stage
test3/e5473e43: Running Test via command: bash --norc --noprofile -eo pipefail test3_build.sh
test3/e5473e43: Test completed in 0.005337 seconds
test3/e5473e43: Test completed with returncode: 1
test3/e5473e43: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test3/e5473e43/test3.out
test3/e5473e43: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex2/test3/e5473e43/test3.err
In this iteration we are going to run the following tests: [test3/e5473e43]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ test1/67f20f │ generic.loc… │ PASS   │ False False   │ 1          │ 0.005588 │
│ 1e           │              │        │ False         │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ test2/a3e5b7 │ generic.loc… │ PASS   │ False False   │ 2          │ 0.005425 │
│ a1           │              │        │ False         │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ test3/e5473e │ generic.loc… │ PASS   │ False False   │ 1          │ 0.005337 │
│ 43           │              │        │ False         │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


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


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.1/tutorials/job_dependency/ex3.yml: VALID
Total builder objects created: 4
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ pass_te… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will     │         │
│          │        │          │          │       │       │ always   │         │
│          │        │          │          │       │       │ pass     │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ fail_te… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will run │         │
│          │        │          │          │       │       │ if test  │         │
│          │        │          │          │       │       │ 'pass_t… │         │
│          │        │          │          │       │       │ is in    │         │
│          │        │          │          │       │       │ state    │         │
│          │        │          │          │       │       │ 'PASS'   │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ pass_an… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will run │         │
│          │        │          │          │       │       │ if       │         │
│          │        │          │          │       │       │ pass_te… │         │
│          │        │          │          │       │       │ is       │         │
│          │        │          │          │       │       │ 'PASS'   │         │
│          │        │          │          │       │       │ and      │         │
│          │        │          │          │       │       │ fail_te… │         │
│          │        │          │          │       │       │ is       │         │
│          │        │          │          │       │       │ 'FAIL'   │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ final_t… │ script │ generic… │ None     │ None  │ None  │ Test     │ /home/… │
│          │        │          │          │       │       │ will run │         │
│          │        │          │          │       │       │ after    │         │
│          │        │          │          │       │       │ 'pass_t… │         │
│          │        │          │          │       │       │ 'fail_t… │         │
│          │        │          │          │       │       │ and      │         │
│          │        │          │          │       │       │ 'pass_a… │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
pass_test/c35cf6f2: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_test/c35cf6f2
pass_test/c35cf6f2: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_test/c35cf6f2/stage
pass_test/c35cf6f2: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_test/c35cf6f2/pass_test_build.sh
fail_test/d047ef1f: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/fail_test/d047ef1f
fail_test/d047ef1f: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/fail_test/d047ef1f/stage
fail_test/d047ef1f: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/fail_test/d047ef1f/fail_test_build.sh
pass_and_fail_test/7886b2be: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_and_fail_test/7886b2be
pass_and_fail_test/7886b2be: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_and_fail_test/7886b2be/stage
pass_and_fail_test/7886b2be: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_and_fail_test/7886b2be/pass_and_fail_test_build.sh
final_test/df8bac44: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/final_test/df8bac44
final_test/df8bac44: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/final_test/df8bac44/stage
final_test/df8bac44: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/final_test/df8bac44/final_test_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
pass_and_fail_test/7886b2be Skipping job because it has job dependency on pass_test/c35cf6f2
fail_test/d047ef1f Skipping job because it has job dependency on pass_test/c35cf6f2
final_test/df8bac44 Skipping job because it has job dependency on pass_test/c35cf6f2 which is in state PENDING
pass_test/c35cf6f2 does not have any dependencies adding test to queue
pass_test/c35cf6f2: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_test/c35cf6f2/stage
pass_test/c35cf6f2: Running Test via command: bash --norc --noprofile -eo pipefail pass_test_build.sh
pass_test/c35cf6f2: Test completed in 2.006913 seconds
pass_test/c35cf6f2: Test completed with returncode: 0
pass_test/c35cf6f2: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_test/c35cf6f2/pass_test.out
pass_test/c35cf6f2: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_test/c35cf6f2/pass_test.err
In this iteration we are going to run the following tests: [pass_test/c35cf6f2]
───────────────────────────────── Iteration 2 ──────────────────────────────────
final_test/df8bac44 Skipping job because it has job dependency on fail_test/d047ef1f which is in state PENDING
pass_and_fail_test/7886b2be Skipping job because it has job dependency on fail_test/d047ef1f
fail_test/d047ef1f: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/fail_test/d047ef1f/stage
fail_test/d047ef1f: Running Test via command: bash --norc --noprofile -eo pipefail fail_test_build.sh
fail_test/d047ef1f: Test completed in 2.006946 seconds
fail_test/d047ef1f: Test completed with returncode: 0
fail_test/d047ef1f: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/fail_test/d047ef1f/fail_test.out
fail_test/d047ef1f: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/fail_test/d047ef1f/fail_test.err
In this iteration we are going to run the following tests: [fail_test/d047ef1f]
───────────────────────────────── Iteration 3 ──────────────────────────────────
final_test/df8bac44 Skipping job because it has job dependency on pass_and_fail_test/7886b2be
pass_and_fail_test/7886b2be: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_and_fail_test/7886b2be/stage
pass_and_fail_test/7886b2be: Running Test via command: bash --norc --noprofile -eo pipefail pass_and_fail_test_build.sh
pass_and_fail_test/7886b2be: Test completed in 2.007138 seconds
pass_and_fail_test/7886b2be: Test completed with returncode: 1
pass_and_fail_test/7886b2be: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_and_fail_test/7886b2be/pass_and_fail_test.out
pass_and_fail_test/7886b2be: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/pass_and_fail_test/7886b2be/pass_and_fail_test.err
pass_and_fail_test/7886b2be: Checking returncode - 1 is matched in list [1]
In this iteration we are going to run the following tests: [pass_and_fail_test/7886b2be]
───────────────────────────────── Iteration 4 ──────────────────────────────────
final_test/df8bac44: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/final_test/df8bac44/stage
final_test/df8bac44: Running Test via command: bash --norc --noprofile -eo pipefail final_test_build.sh
final_test/df8bac44: Test completed in 2.006944 seconds
final_test/df8bac44: Test completed with returncode: 0
final_test/df8bac44: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/final_test/df8bac44/final_test.out
final_test/df8bac44: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex3/final_test/df8bac44/final_test.err
In this iteration we are going to run the following tests: [final_test/df8bac44]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ fail_test/d0 │ generic.loc… │ FAIL   │ False False   │ 0          │ 2.006946 │
│ 47ef1f       │              │        │ False         │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ final_test/d │ generic.loc… │ PASS   │ N/A N/A N/A   │ 0          │ 2.006944 │
│ f8bac44      │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ pass_test/c3 │ generic.loc… │ PASS   │ False False   │ 0          │ 2.006913 │
│ 5cf6f2       │              │        │ False         │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ pass_and_fai │ generic.loc… │ PASS   │ True False    │ 1          │ 2.007138 │
│ l_test/7886b │              │        │ False         │            │          │
│ 2be          │              │        │               │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


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


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.1/tutorials/job_dependency/ex4.yml: VALID
Total builder objects created: 3
                            Builders by type=script                             
┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ builder  ┃ type   ┃ executor ┃ compiler ┃ nodes ┃ procs ┃ descrip… ┃ builds… ┃
┡━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ runtime… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will     │         │
│          │        │          │          │       │       │ sleep 5  │         │
│          │        │          │          │       │       │ second   │         │
│          │        │          │          │       │       │ but will │         │
│          │        │          │          │       │       │ fail due │         │
│          │        │          │          │       │       │ to       │         │
│          │        │          │          │       │       │ runtime  │         │
│          │        │          │          │       │       │ 2sec     │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ runtime… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will run │         │
│          │        │          │          │       │       │ when     │         │
│          │        │          │          │       │       │ runtime… │         │
│          │        │          │          │       │       │ is PASS  │         │
├──────────┼────────┼──────────┼──────────┼───────┼───────┼──────────┼─────────┤
│ runtime… │ script │ generic… │ None     │ None  │ None  │ This     │ /home/… │
│          │        │          │          │       │       │ test     │         │
│          │        │          │          │       │       │ will run │         │
│          │        │          │          │       │       │ when     │         │
│          │        │          │          │       │       │ runtime… │         │
│          │        │          │          │       │       │ is FAIL  │         │
└──────────┴────────┴──────────┴──────────┴───────┴───────┴──────────┴─────────┘
──────────────────────────────── Building Test ─────────────────────────────────
runtime_test/f6973466: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test/f6973466
runtime_test/f6973466: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test/f6973466/stage
runtime_test/f6973466: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test/f6973466/runtime_test_build.sh
runtime_test_pass/8ecffbf6: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_pass/8ecffbf6
runtime_test_pass/8ecffbf6: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_pass/8ecffbf6/stage
runtime_test_pass/8ecffbf6: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_pass/8ecffbf6/runtime_test_pass_build.sh
runtime_test_fail/d0b9de7a: Creating test directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_fail/d0b9de7a
runtime_test_fail/d0b9de7a: Creating the stage directory: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_fail/d0b9de7a/stage
runtime_test_fail/d0b9de7a: Writing build script: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_fail/d0b9de7a/runtime_test_fail_build.sh
──────────────────────────────── Running Tests ─────────────────────────────────
Spawning 1 processes for processing builders
───────────────────────────────── Iteration 1 ──────────────────────────────────
runtime_test/f6973466 does not have any dependencies adding test to queue
runtime_test_fail/d0b9de7a Skipping job because it has job dependency on runtime_test/f6973466
runtime_test_pass/8ecffbf6 Skipping job because it has job dependency on runtime_test/f6973466
runtime_test/f6973466: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test/f6973466/stage
runtime_test/f6973466: Running Test via command: bash --norc --noprofile -eo pipefail runtime_test_build.sh
runtime_test/f6973466: Test completed in 5.007088 seconds
runtime_test/f6973466: Test completed with returncode: 0
runtime_test/f6973466: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test/f6973466/runtime_test.out
runtime_test/f6973466: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test/f6973466/runtime_test.err
runtime_test/f6973466: Checking  mintime < runtime: 2.0 < 5.007088
In this iteration we are going to run the following tests: [runtime_test/f6973466]
───────────────────────────────── Iteration 2 ──────────────────────────────────
runtime_test_fail/d0b9de7a is cancelled because it depends on runtime_test/f6973466 to have state: FAIL but actual value is PASS
runtime_test_pass/8ecffbf6: Current Working Directory : /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_pass/8ecffbf6/stage
runtime_test_pass/8ecffbf6: Running Test via command: bash --norc --noprofile -eo pipefail runtime_test_pass_build.sh
runtime_test_pass/8ecffbf6: Test completed in 0.005672 seconds
runtime_test_pass/8ecffbf6: Test completed with returncode: 0
runtime_test_pass/8ecffbf6: Writing output file -  /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_pass/8ecffbf6/runtime_test_pass.out
runtime_test_pass/8ecffbf6: Writing error file - /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/tests/generic.local.bash/ex4/runtime_test_pass/8ecffbf6/runtime_test_pass.err
In this iteration we are going to run the following tests: [runtime_test_pass/8ecffbf6]
                                  Test Summary                                  
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃              ┃              ┃        ┃ checks        ┃            ┃          ┃
┃              ┃              ┃        ┃ (ReturnCode,  ┃            ┃          ┃
┃              ┃              ┃        ┃ Regex,        ┃            ┃          ┃
┃ builder      ┃ executor     ┃ status ┃ Runtime)      ┃ returncode ┃ runtime  ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
│ runtime_test │ generic.loc… │ PASS   │ N/A N/A N/A   │ 0          │ 0.005672 │
│ _pass/8ecffb │              │        │               │            │          │
│ f6           │              │        │               │            │          │
├──────────────┼──────────────┼────────┼───────────────┼────────────┼──────────┤
│ runtime_test │ generic.loc… │ PASS   │ False False   │ 0          │ 5.007088 │
│ /f6973466    │              │        │ True          │            │          │
└──────────────┴──────────────┴────────┴───────────────┴────────────┴──────────┘



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


Adding 2 test results to /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/report.json
Writing Logfile to: /home/docs/checkouts/readthedocs.org/user_builds/buildtest/checkouts/v1.1/var/logs/buildtest_qk9k4y4y.log