Pure: test reports folded into one shape, whatever wrote them.
A suite runner, in any language, leaves JUnit XML or TAP behind. Both fold into a Report:
{:report/format :junit | :tap | :mixed :report/cases [{:case/id :case/name :case/classname :case/status :case/time-s :case/message :case/output}] :report/totals {:passed n :failed n :error n :skipped n}}
JUnit arrives here as a plain element tree, {:tag :attrs :content :text}
(hive-compose.boundary.report owns the XML parser and the files); TAP as
text. Every entry point answers a hive-dsl Result: what cannot be read is
:report/malformed.
Pure: test reports folded into one shape, whatever wrote them.
A suite runner, in any language, leaves JUnit XML or TAP behind. Both fold
into a Report:
{:report/format :junit | :tap | :mixed
:report/cases [{:case/id :case/name :case/classname :case/status
:case/time-s :case/message :case/output}]
:report/totals {:passed n :failed n :error n :skipped n}}
JUnit arrives here as a plain element tree, {:tag :attrs :content :text}
(`hive-compose.boundary.report` owns the XML parser and the files); TAP as
text. Every entry point answers a hive-dsl Result: what cannot be read is
`:report/malformed`.(->report format cases)A Report of format holding cases, its totals counted from them.
A Report of `format` holding `cases`, its totals counted from them.
(detect-format content)The format of report content: :junit for XML, :tap when a line is a TAP
version, plan or test point, nil otherwise. Each line is read as
parse-tap reads it, cut to max-line characters, so no line costs more
than a bounded, linear scan.
The format of report `content`: :junit for XML, :tap when a line is a TAP version, plan or test point, nil otherwise. Each line is read as `parse-tap` reads it, cut to `max-line` characters, so no line costs more than a bounded, linear scan.
(failed-cases report)The cases of report that failed or errored.
The cases of `report` that failed or errored.
(from-junit-tree tree)Result<Report> from a JUnit element tree rooted at <testsuites> or
<testsuite>, nesting allowed. Missing attributes are tolerated; any other
root is :report/malformed.
Result<Report> from a JUnit element tree rooted at <testsuites> or <testsuite>, nesting allowed. Missing attributes are tolerated; any other root is `:report/malformed`.
(junit-case-id suite classname nm)<suite>/<classname>.<name>, leaving out the parts that are missing, and
the classname when it repeats the name (jest-junit writes both the same).
`<suite>/<classname>.<name>`, leaving out the parts that are missing, and the classname when it repeats the name (jest-junit writes both the same).
(malformed reason & {:as data})The Result of a report that cannot be read, reason saying why.
The Result of a report that cannot be read, `reason` saying why.
Characters the prefixed case ids of one TAP parse may take together,
every level's prefixing counted. A subtest's ids repeat its parent's
description, so a long description over many leaves would grow the
Report far past its input: past this it reads as a hostile report,
:tap/implausible-ids.
Characters the prefixed case ids of one TAP parse may take together, every level's prefixing counted. A subtest's ids repeat its parent's description, so a long description over many leaves would grow the Report far past its input: past this it reads as a hostile report, `:tap/implausible-ids`.
Characters of a TAP line that are read; the rest of a longer line is dropped, so no line costs more than a bounded, linear scan.
Characters of a TAP line that are read; the rest of a longer line is dropped, so no line costs more than a bounded, linear scan.
More tests than this missing from a plan reads as a broken plan line, not as that many errors.
More tests than this missing from a plan reads as a broken plan line, not as that many errors.
(merge-reports reports)One Report folding reports, the several files of one run: cases in
order, totals recounted, format :mixed when theirs differ.
One Report folding `reports`, the several files of one run: cases in order, totals recounted, format :mixed when theirs differ.
(parse-seconds s)A JUnit time attribute as seconds, nil when absent or unreadable. A comma
may be the decimal separator (0,123 is 0.123); thousands separators are
not supported, so 1,234 and 1,234.5 are nil rather than a guess.
A JUnit time attribute as seconds, nil when absent or unreadable. A comma may be the decimal separator (`0,123` is 0.123); thousands separators are not supported, so `1,234` and `1,234.5` are nil rather than a guess.
(parse-tap text)Result<Report> from TAP 13/14 text: a plan 1..N before or after the
tests, ok/not ok points with # SKIP/# TODO directives, a YAML
diagnostic block kept raw as its point's message, trailing # comments as
its output, subtests flattened into parent/child ids. A test the plan
promised and that never ran counts as :error, a subtest's plan included
(parent/test N); so does a subtest no test point closes (test N,
N past every number its level used), and Bail out! without a plan.
Text with no plan, no test point and no bail-out, a plan promising more
than max-missing tests beyond those that ran, or case ids holding more
than max-id-chars characters together, is :report/malformed.
Result<Report> from TAP 13/14 text: a plan `1..N` before or after the tests, `ok`/`not ok` points with `# SKIP`/`# TODO` directives, a YAML diagnostic block kept raw as its point's message, trailing `#` comments as its output, subtests flattened into `parent/child` ids. A test the plan promised and that never ran counts as :error, a subtest's plan included (`parent/test N`); so does a subtest no test point closes (`test N`, N past every number its level used), and `Bail out!` without a plan. Text with no plan, no test point and no bail-out, a plan promising more than `max-missing` tests beyond those that ran, or case ids holding more than `max-id-chars` characters together, is `:report/malformed`.
(passed? report)True when report holds no failed or errored case.
True when `report` holds no failed or errored case.
Kept local: hive-compose.schema belongs to the stack value objects.
Kept local: hive-compose.schema belongs to the stack value objects.
A report file left out of a run, and why: :reason is a keyword, the one
its read answered (a foreign :junit/unknown-root today), never a sentence.
A report file left out of a run, and why: `:reason` is a keyword, the one its read answered (a foreign :junit/unknown-root today), never a sentence.
Every status a case can end in, in reporting order.
Every status a case can end in, in reporting order.
(totals cases){status count} over cases, every status present.
{status count} over `cases`, every status present.
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 |