Skip to main content

Module local

Module local 

Source
Expand description

The DAG author’s local commands: schedr dags check and schedr dags test (see archive/PROJECT.md, Testing DAGs).

  • dags check <path> imports the DAG files with the real runner (parse mode, the per-file timeout) and applies the master’s checks, so whatever the master would refuse is reported here; exit 1 on any error. --against <url> then reads that server’s active workers and fails when this schedr is newer (by minor version) than any of them. A pass prints one ok: line. A version the master cannot parse does not fail the check.
  • dags test <dag> [--for] runs one real run in an in-process standalone with a temporary SQLite database: every task its own process, exactly as in production. It prints each task’s state as it changes, then the logs (prefixed with the task) and the outputs; exit 0 if the run succeeded, 1 otherwise.

Structs§

LocalRoot
The files of one root to check or test: a directory, or one file in its directory.

Constants§

TEST_RUN_TIMEOUT
How long dags test waits for its run (a hanging task is stopped by its own timeout).

Functions§

check_root
Parses a root’s files with the real runner and applies the master’s checks.
check_scripts
A script root’s schedr.toml files read and checked, as a worker reads them (M4.9): for a path in a configured script root (its scripts never imported, as a DAG check would), or outside the configured roots a schedr.toml or a directory holding one. The root is the configured script root, else the directory (the file’s own for a file). None for a DAG check: a path in a configured DAG root, or anything else.
run_local
Runs schedr dags check or schedr dags test.