Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.test-contract

Language-neutral test-runner CONTRACT shared across vis language packs.

ONE vocabulary for selecting and reporting tests, modeled on lazytest's CLI (NoahTheDuke/lazytest): single test, many namespaces, ignore by name or by metadata tag. A future python / js language pack returns the SAME shaped result map and accepts the SAME selector keys, so the agent learns the words once and they carry across languages.

The selector vocabulary and the result shape are DEFINED with clojure.spec (::selectors, ::result). selector-keys / result-keys are DERIVED from those specs (via s/form) so the spec is the single source of truth - a key never drifts out of sync with its documentation.

SELECTOR keys (all optional; the Python dict the tool receives): :ns string OR vector of namespace strings - which namespace(s) to run. One string = a single ns; a vector = many. (lazytest -n) :only vector of test-name strings - run ONLY these tests/vars within the selected namespace(s). (lazytest -v / source :focus) :include vector of metadata-tag strings - run only tests carrying one of these tags, e.g. "integration". (lazytest -i) :exclude vector of metadata-tag strings - skip tests carrying one of these tags, e.g. "slow". (lazytest -e)

PRECEDENCE (copied verbatim from lazytest):

  • :exclude OVERRIDES :include (a test tagged both is skipped).
  • source-level :skip OVERRIDES :focus.

RESULT keys (the uniform map every pack returns): :language "clojure" | "python" | ... :mode "repl" | "cli" - which execution path ran :framework "clojure.test" | "lazytest" | ... (repl path) :tool "clj" | "lein" | "bb" | ... (cli path) :ns the namespace(s) run :total test count actually run :pass passing count :fail failing + erroring count :selected count chosen by the selectors (before skips) :skipped count filtered out by :exclude / source :skip :failures [{:ns :test :message :file :line} ...] :errors the erroring-test subset of :failures :output captured run log (framework report + error/exception traces)

Language-neutral test-runner CONTRACT shared across vis language packs.

ONE vocabulary for selecting and reporting tests, modeled on lazytest's CLI
(NoahTheDuke/lazytest): single test, many namespaces, ignore by name or by
metadata tag. A future python / js language pack returns the SAME shaped
result map and accepts the SAME selector keys, so the agent learns the
words once and they carry across languages.

The selector vocabulary and the result shape are DEFINED with clojure.spec
(`::selectors`, `::result`). `selector-keys` / `result-keys` are DERIVED from
those specs (via `s/form`) so the spec is the single source of truth - a key
never drifts out of sync with its documentation.

SELECTOR keys (all optional; the Python dict the tool receives):
  :ns       string OR vector of namespace strings - which namespace(s) to
            run. One string = a single ns; a vector = many. (lazytest -n)
  :only     vector of test-name strings - run ONLY these tests/vars within
            the selected namespace(s). (lazytest -v / source :focus)
  :include  vector of metadata-tag strings - run only tests carrying one of
            these tags, e.g. "integration". (lazytest -i)
  :exclude  vector of metadata-tag strings - skip tests carrying one of
            these tags, e.g. "slow". (lazytest -e)

PRECEDENCE (copied verbatim from lazytest):
  - :exclude OVERRIDES :include (a test tagged both is skipped).
  - source-level :skip OVERRIDES :focus.

RESULT keys (the uniform map every pack returns):
  :language  "clojure" | "python" | ...
  :mode      "repl" | "cli"        - which execution path ran
  :framework "clojure.test" | "lazytest" | ... (repl path)
  :tool      "clj" | "lein" | "bb" | ... (cli path)
  :ns        the namespace(s) run
  :total     test count actually run
  :pass      passing count
  :fail      failing + erroring count
  :selected  count chosen by the selectors (before skips)
  :skipped   count filtered out by :exclude / source :skip
  :failures  [{:ns :test :message :file :line} ...]
  :errors    the erroring-test subset of :failures
  :output    captured run log (framework report + error/exception traces)
raw docstring

normalize-selectorsclj

(normalize-selectors m)

Normalize a raw selector map (the Python dict the tool received) into the canonical shape {:nses [str] :only [str] :include [str] :exclude [str]}. :ns accepts a string OR a vector; :namespace / :namespaces are aliases for :ns.

Normalize a raw selector map (the Python dict the tool received) into the
canonical shape `{:nses [str] :only [str] :include [str] :exclude [str]}`.
:ns accepts a string OR a vector; :namespace / :namespaces are aliases for :ns.
sourceraw docstring

result-keysclj

The uniform result-map keys every language pack's runner returns. Derived from the ::result spec.

The uniform result-map keys every language pack's runner returns. Derived
from the `::result` spec.
sourceraw docstring

selected?clj

(selected? {:keys [only include exclude]} test-name tags)

Apply the lazytest precedence to one test, given normalized selectors. test-name is the test/var name string; tags the set of metadata-tag strings on it. Returns true when the test should RUN. exclude wins over include/only; only narrows by name; include gates by tag when present.

Apply the lazytest precedence to one test, given normalized selectors.
`test-name` is the test/var name string; `tags` the set of metadata-tag
strings on it. Returns true when the test should RUN. exclude wins over
include/only; only narrows by name; include gates by tag when present.
sourceraw docstring

selector-keysclj

The optional selector keys a runner tool accepts on its opts dict. Derived from the ::selectors spec.

The optional selector keys a runner tool accepts on its opts dict. Derived
from the `::selectors` spec.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close