Liking cljdoc? Tell your friends :D

hive-compose.pipeline.why

compose why test=T [run=R] (hc-10): find the failed case in the run results hc-8 wrote, read the traces carrying its test id (ITraceQuery), the container logs of its run in the case's window (the engine's -logs), and the stack plan, fold them into a FailureBundle (hive-compose.promote.why) and write it beside the run: <state-dir>/runs/<run>/why/<case>.md and .edn.

ctx: the ops/stacks context (:engine :settings :state) plus :trace-query an ITraceQuery (e.g. hive-compose.adapter.tempo/make-query); absent, the bundle has no traces and says so :state-dir where runs/ lives; default the state file's directory :note! optional (fn [{:test-id :run :summary :files}]) told about every bundle written (a memory note); its failure is reported, never thrown :why/tail log lines read per compose project (default 2000) :why/slack-ms window slack (default why/default-slack-ms)

`compose why test=T [run=R]` (hc-10): find the failed case in the run
results hc-8 wrote, read the traces carrying its test id (ITraceQuery),
the container logs of its run in the case's window (the engine's `-logs`),
and the stack plan, fold them into a FailureBundle
(`hive-compose.promote.why`) and write it beside the run:
<state-dir>/runs/<run>/why/<case>.md and .edn.

ctx: the ops/stacks context (:engine :settings :state) plus
  :trace-query  an ITraceQuery (e.g. `hive-compose.adapter.tempo/make-query`);
                absent, the bundle has no traces and says so
  :state-dir    where runs/ lives; default the state file's directory
  :note!        optional (fn [{:test-id :run :summary :files}]) told about
                every bundle written (a memory note); its failure is
                reported, never thrown
  :why/tail     log lines read per compose project (default 2000)
  :why/slack-ms window slack (default `why/default-slack-ms`)
raw docstring

case-namesclj

(case-names res c)

Every name test t may give case c of cell result res: its id, its name, classname.name, the id without its suite prefix, and <suite>/<project>/<id or leaf>.

Every name test `t` may give case `c` of cell result `res`: its id, its
name, classname.name, the id without its suite prefix, and
<suite>/<project>/<id or leaf>.
sourceraw docstring

cell-caseclj

(cell-case res)

The case a failed cell result res stands for when no failed case of its report explains it (its runner was OOM-killed, died or timed out before it reported): id <suite>/<project>, the cell's status, and as message the OOM finding's line, else what the runner exited with. Nil for a passed cell or one whose report holds a failed case.

The case a failed cell result `res` stands for when no failed case of its
report explains it (its runner was OOM-killed, died or timed out before
it reported): id `<suite>/<project>`, the cell's status, and as message
the OOM finding's line, else what the runner exited with. Nil for a
passed cell or one whose report holds a failed case.
sourceraw docstring

clip-charsclj

What the CLI engine keeps of a command's output (its last chars): logs that long were probably cut, and the bundle says so.

What the CLI engine keeps of a command's output (its last chars): logs that
long were probably cut, and the bundle says so.
sourceraw docstring

default-tailclj

source

fetch-logsclj

(fetch-logs ctx run tail window slack-ms)

{:logs {service text} :errors [..] :clipped [project]}: the log lines of every project of run inside window +- slack-ms (at most tail per service), split by service; a service name is prefixed with its compose project when two projects of the run hold it. A project whose output reached clip-chars is listed under :clipped.

{:logs {service text} :errors [..] :clipped [project]}: the log lines of
every project of `run` inside `window` +- `slack-ms` (at most `tail` per
service), split by service; a service name is prefixed with its compose
project when two projects of the run hold it. A project whose output
reached `clip-chars` is listed under :clipped.
sourceraw docstring

fetch-tracesclj

(fetch-traces tq queries)

{:traces [Trace] :query q :errors [..]}: the traces of the first of queries that finds any, each read whole. No query finding one answers :traces [].

{:traces [Trace] :query q :errors [..]}: the traces of the first of
`queries` that finds any, each read whole. No query finding one answers
:traces [].
sourceraw docstring

find-caseclj

(find-case results test)

Result<{:result :case}>: the case test names among results (cell results), a failed or errored one before a passed one, then the newest run (latest :finished-at, then run id). A failed cell with no failed case (cell-case, e.g. an OOM-killed runner) is named by <suite>/<project> when no case of that name exists. :compose/unknown-test lists the failed cases there are.

Result<{:result :case}>: the case `test` names among `results` (cell
results), a failed or errored one before a passed one, then the newest
run (latest :finished-at, then run id). A failed cell with no failed case
(`cell-case`, e.g. an OOM-killed runner) is named by `<suite>/<project>`
when no case of that name exists. :compose/unknown-test lists the failed
cases there are.
sourceraw docstring

locateclj

(locate ctx {:keys [test run]})

Result<{:result :case :skipped}>: the case test names in the results under the state dir (of run when given).

Result<{:result :case :skipped}>: the case `test` names in the results
under the state dir (of `run` when given).
sourceraw docstring

logs-profileclj

(logs-profile {:keys [project dir files env]} [start end] slack-ms)

The profile compose logs of project row p runs with: timestamps on, and bounded to window widened by slack-ms (--since/--until), so the engine's output clip never drops the case's own lines.

The profile `compose logs` of project row `p` runs with: timestamps on,
and bounded to `window` widened by `slack-ms` (`--since`/`--until`), so
the engine's output clip never drops the case's own lines.
sourceraw docstring

max-tracesclj

Traces fetched whole for one case.

Traces fetched whole for one case.
sourceraw docstring

run-projectsclj

(run-projects ctx run)

[{:project :dir :files}] of the compose projects run run holds in the stack state: its consumers and its private instances (shared ones run under their provider's own project and are included too, as their logs hold the run's requests).

[{:project :dir :files}] of the compose projects run `run` holds in the
stack state: its consumers and its private instances (shared ones run
under their provider's own project and are included too, as their logs
hold the run's requests).
sourceraw docstring

state-dirclj

(state-dir ctx)

Where runs/ lives: :state-dir, else the state file's directory.

Where runs/ lives: `:state-dir`, else the state file's directory.
sourceraw docstring

trace-queriesclj

(trace-queries res c [start end])

The searches tried in order for case c of cell result res, the first answering any trace wins: span test.id = the case (its leaf id, then its full id), span hive.test.id = the case, then test.id = the cell's test id (<suite>/<project>, the runner's own baggage). Each also names hive.run.id = the run.

The searches tried in order for case `c` of cell result `res`, the first
answering any trace wins: span test.id = the case (its leaf id, then its
full id), span hive.test.id = the case, then test.id = the cell's test id
(<suite>/<project>, the runner's own baggage). Each also names
hive.run.id = the run.
sourceraw docstring

why!clj

(why! ctx {:keys [test run] :as opts})

Result<FailureBundle> of test test (a case id, <suite>/<project>/<case>, or a name the case goes by) in run run (default: the newest run holding it, a failed case first). Writes <state-dir>/runs/<run>/why/<case>.md and .edn and answers the bundle with :why/files {:md :edn} and, when a source failed, :why/gaps (what could not be read: traces, logs, note).

Result<FailureBundle> of test `test` (a case id, `<suite>/<project>/<case>`,
or a name the case goes by) in run `run` (default: the newest run holding
it, a failed case first). Writes <state-dir>/runs/<run>/why/<case>.md and
.edn and answers the bundle with :why/files {:md :edn} and, when a source
failed, :why/gaps (what could not be read: traces, logs, note).
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