Which namespaces and vars run.
The parent builds a plan from static namespace info (plan); each worker
then decides per var, from real metadata, whether to run it
(volley.filters/decide).
Both sides follow kaocha.plugin.filter (matches?, merge-filters,
filter-testable, remove-missing-metadata-keys and the pre-load and
post-load hooks) so the same tests are picked as with Kaocha.
Kaocha filters a test tree (suite, namespace, var) in two passes per suite:
first with the suite's own :focus/:skip keys from tests.edn, then with
the global filters (the CLI flags), which see the suite's skip keys too.
apply-filters ports that over a static tree; volley.filters/decide is
the closed form of the same rules for one var, which is what workers
evaluate.
Which namespaces and vars run. The parent builds a plan from static namespace info (`plan`); each worker then decides per var, from real metadata, whether to run it (`volley.filters/decide`). Both sides follow `kaocha.plugin.filter` (`matches?`, `merge-filters`, `filter-testable`, `remove-missing-metadata-keys` and the `pre-load` and `post-load` hooks) so the same tests are picked as with Kaocha. Kaocha filters a test tree (suite, namespace, var) in two passes per suite: first with the suite's own `:focus`/`:skip` keys from tests.edn, then with the global filters (the CLI flags), which see the suite's skip keys too. `apply-filters` ports that over a static tree; `volley.filters/decide` is the closed form of the same rules for one var, which is what workers evaluate.
(apply-filters suites global)Run Kaocha's filter plugin over a static tree. suites are suite nodes
(see above; :skip? may be preset, e.g. by suite ids on the command line);
global is {:focus :skip :focus-meta :skip-meta}.
Mirrors the pre-load hook (suite-level focus/skip, pre-load), then
post-load (unmatched focus warning, two passes). Kaocha's focus-meta
pruning needs every test's real metadata, so keys no visible test
carries are returned as :unresolved for the workers to settle
(resolve-focus-meta). Returns {:suites [...filtered suite nodes with :skip? and :passes...] :loaded [suite-id] :unresolved [k] :warnings [str]}, where :loaded are the suites Kaocha would load (the ones the
pre-load step did not skip).
Run Kaocha's filter plugin over a static tree. `suites` are suite nodes
(see above; `:skip?` may be preset, e.g. by suite ids on the command line);
`global` is `{:focus :skip :focus-meta :skip-meta}`.
Mirrors the `pre-load` hook (suite-level focus/skip, `pre-load`), then
`post-load` (unmatched focus warning, two passes). Kaocha's focus-meta
pruning needs every test's real metadata, so keys no visible test
carries are returned as `:unresolved` for the workers to settle
(`resolve-focus-meta`). Returns `{:suites [...filtered suite nodes with
:skip? and :passes...] :loaded [suite-id] :unresolved [k] :warnings
[str]}`, where `:loaded` are the suites Kaocha would load (the ones the
`pre-load` step did not skip).(expected-tests {:keys [ns vars select] ns-meta :meta})How many tests plan entry entry should run: the vars the parser saw
that volley.filters/decide keeps in the run, selected or pending.
Tests other macros define are missed until the worker counts them
(:ns/tests).
How many tests plan entry `entry` should run: the vars the parser saw that `volley.filters/decide` keeps in the run, selected or pending. Tests other macros define are missed until the worker counts them (`:ns/tests`).
(plan config ns-infos cli-suites)Build the run plan.
config is normalized config, ns-infos the volley.discover/ns-info of
every source and test file, cli-suites the suite ids from the command
line (empty means all). Returns
{:suites [{:id :unit
:namespaces [{:ns 'my.app-test :file "test/my/app_test.clj"
:serial? false :select select-spec}]
:load-errors [{:file "test/bad_test.clj" :error "..."}]}]
:warnings [str]
:errors [str]}
Suites not named on the command line are left out, as are namespaces
that cannot hold a selected test. Namespaces are ordered by name.
:errors is non-empty when a requested suite does not exist (Kaocha's
"No such suite" message). select-spec is for decide.
When a focus-meta key is carried by no test the parser can see, every
spec gets :resolve-focus-meta [k] and the plan :preload [{:ns sym :suite id}], every namespace of the run's suites with its suite: the workers load all of them before
running anything and settle the keys with resolve-focus-meta.
Build the run plan.
`config` is normalized config, `ns-infos` the `volley.discover/ns-info` of
every source and test file, `cli-suites` the suite ids from the command
line (empty means all). Returns
{:suites [{:id :unit
:namespaces [{:ns 'my.app-test :file "test/my/app_test.clj"
:serial? false :select select-spec}]
:load-errors [{:file "test/bad_test.clj" :error "..."}]}]
:warnings [str]
:errors [str]}
Suites not named on the command line are left out, as are namespaces
that cannot hold a selected test. Namespaces are ordered by name.
`:errors` is non-empty when a requested suite does not exist (Kaocha's
"No such suite" message). `select-spec` is for `decide`.
When a focus-meta key is carried by no test the parser can see, every
spec gets `:resolve-focus-meta [k]` and the plan `:preload [{:ns sym
:suite id}]`, every namespace of the run's suites with its suite: the workers load all of them before
running anything and settle the keys with `resolve-focus-meta`.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |