Next: , Previous: , Up: API  


1.10 (veritas runner)

1.10.1 Procedures

Procedure: discover-tests KEY: #:test-type #:scan-dir #:test-top-dir #:test-module #:dir

Walk the cleaned file tree dir and collect candidate test files.

Descends through scan-dir, test-top-dir and test-module, then hands the contents of a folder named test-type to flatten-test-files.

Procedure: parse-jobs value

Return the number of worker processes value asks for, or #f.

#f or an absent value means the run stays in one process. A value that is not a whole number of processes is an error rather than a silent fallback, because a CI job that asked for parallelism and got none should be told.

(parse-jobs "4")
⇒ 4
Procedure: parse-partition value

Return the (index . total) a partition string describes, or #f.

A partition is written "2/3": this machine runs the second of three slices. A malformed or impossible partition raises instead of quietly running everything, because that would hide a misconfigured CI job.

Procedure: partition-files files index total

Return the files of partition index of total from files.

The split is round-robin over files, so the same project always splits the same way and the partitions together are exactly files.

(partition-files '("a" "b" "c" "d" "e") 2 3)
⇒ ("b" "e")
Procedure: run-test-file KEY: #:test-file #:test-type #:entrypoint-function

Load one test file and call its entrypoint.

test-file is a path relative to the test root and test-type is the module prefix, so "math/algebra.scm" with unit loads (veritas unit math algebra). entrypoint-function names the zero-argument procedure to call in that module.

Procedure: run-tests

Find every test file under the scan root and run each one.

Behaviour comes from the environment:

  • VERITAS_SCAN_DIR: Root folder to scan. Defaults to "./".
  • VERITAS_TEST_TOP_DIR: The subfolder boundary identifier containing test suites. Defaults to "test".
  • VERITAS_ENTRYPOINT: The signature method executed inside test targets. Defaults to "spec".
  • VERITAS_TEST_MODULE: Top level test parent folder filter. Defaults to "veritas".
  • VERITAS_TEST_TYPE: Category discriminator keyword used during routing. Defaults to "unit".
  • VERITAS_SHUFFLE_FILES: Set to string "true" to shuffle execution sequences using a Fisher-Yates algorithm. Defaults to "true".
  • VERITAS_SEED: the seed every shuffle of this run uses, reported when a run is shuffled so a failing order can be replayed.
  • VERITAS_PARTITION: INDEX/TOTAL to run only one slice of the discovered files, which is how a run is split across CI machines.
  • VERITAS_JOBS: how many worker processes to run the discovered files in. Absent or 1 means one process, as before; 2 and up run one file per process and merge their output, their record of failures and their JUnit reports.

Next: (veritas shuffle), Previous: (veritas reporter), Up: API