def _single_job_schema()

in lib/validation.py [0:0]


def _single_job_schema():
    import voluptuous

    # The *wrapper_arguments* key to run.json maps to the following dict. None
    # of the values in this dict change at any point during the run; they are
    # mostly the same as the flags passed to *litani-add-job(1)* for this job.
    return {
        "job_id": str,
        # A globally-unique ID for this job.

        "command": str,
        # The command that litani will execute in a subshell.

        "ci_stage": str,
        # The name of the 'stage' that this job will execute in, used for
        # organizing the HTML dashboard.

        "verbose": bool,

        "timeout_ok": bool,
        # If true, then if this job times out, the outcome will be set to
        # 'success'.

        "pipeline_name": str,
        # The name of the 'pipeline' that this job will execute in, used for
        # organizing the HTML dashboard.

        "very_verbose": bool,

        "timeout_ignore": bool,
        # If true, then if this job times out, the outcome will be set to
        # 'fail_ignored'.

        "profile_memory": bool,
        # If true, then litani will regularly sample the memory usage of this
        # job's command while it runs. Samples are stored in the job's
        # *memory_trace*.

        "profile_memory_interval": int,
        # How frequently (in seconds) litani will profile the command's memory
        # use, if *profile_memory* is true.

        "cwd": voluptuous.Any(str, None),
        # The directory that litani will run the command in.

        "interleave_stdout_stderr": bool,
        # Whether the command's stderr will be sent to the stdout stream. If
        # true, the job's *stderr* key will be None and the *stdout* key will
        # contain lines from both the command's stdout and stderr.

        "pool": voluptuous.Any(str, None),
        # The pool that this job will execute in; if not null, then it must be a
        # key in the *pools* dict of the overall run.

        "tags": voluptuous.Any([str], None),
        # A list of user-specified tags. Litani mostly doesn't interpret these,
        # although the HTML dashboard generator does use some of them. Tags are
        # intended to help users find particular jobs for data analysis and can
        # contain arbitrary data.

        "timeout": voluptuous.Any(int, None),
        # The number of seconds that Litani will allow the job to run for before
        # sending SIGTERM followed by SIGKILL (see *signal(3)*).

        "inputs": voluptuous.Any([str], None),
        # The list of files that should be made up-to-date before the job will
        # run

        "outputs": voluptuous.Any([str], None),
        # The list of files that this job will make up-to-date after it
        # completes

        "description": voluptuous.Any(str, None),
        # A human-readable description of this job

        "status_file": voluptuous.Any(str, None),

        "stderr_file": voluptuous.Any(str, None),
        # A file to redirect stderr to, as well as buffering it internally

        "stdout_file": voluptuous.Any(str, None),
        # A file to redirect stdout to, as well as buffering it internally

        "ok_returns": voluptuous.Any([str], None),
        # A list of return codes. If the command exits with any of these return
        # codes (or 0), then the outcome will be set to 'success'.

        "outcome_table": voluptuous.Any(str, None),
        # A file to load an outcome table from.

        "phony_outputs": voluptuous.Any([str], None),
        # A list of outputs that Litani will not warn about if they were not
        # created by the job.

        "ignore_returns": voluptuous.Any([str], None),
        # A list of return codes. If the command exits with any of these return
        # codes (or 0), then the outcome will be set to 'fail_ignored'.

        "subcommand": voluptuous.Any("exec", "add-job"),
    }