IF Commons GitHub

pure/render

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-quality-evidence FR-013

The renderings of a quality record on demand (commons 0001-quality-evidence FR-013, FR-014, FR-017, FR-018, FR-020): JUnit XML, CTRF, SARIF and TAP over the cases of a QualityRecord, and the three documents of ISO/IEC/IEEE 29119-3 (the test completion report, the test status report and a test incident report for each failure, cancellation and not_run). None is kept as evidence; each is a function of the record (and of the grade given) alone, with no clock, so rendering twice gives the same bytes.

What 0008-test-evidence already renders is reused: the TAP of the cases that ran is tap14, the time helpers are its. What it cannot hold, a case that did not run, is added: its count wherever the counts of passed and failed are (FR-013), CTRF's status other (FR-019), a JUnit skipped of type not_run, a SARIF result at level warning. Every rendering that shows evidence shows its grade (FR-014).

import { ctrfDocument } from "./render.ts";
// const q = readQuality(text);
// if (q.kind === "ok") console.log(ctrfDocument(q.value, "E4"));

Source: commons/quality/src/pure/render.ts

9 of 14 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

countsLinefunctionno test imports it
function countsLine(q: QualityRecord): string

The counts as one line, with the count of not_run beside passed and failed (FR-013).

ctrfDocumentfunction
function ctrfDocument(q: QualityRecord, grade?: Grade): string

The run as a CTRF document (FR-018): the case bodies as they are in the record, not_run as status other (FR-019), the grade shown.

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

junitfunction
function junit(q: QualityRecord, grade?: Grade): string

The run as JUnit XML: a testsuite per file and runtime, a testcase per case with its grade among its properties, failure, error (cancelled) or skipped (skip, todo and, with type="not_run" and its reason, a case that did not run). JUnit has no word for not_run, so the count is a property of the run (ifc.not_run) beside the grade.

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

NO_RULEconstno test imports it
const NO_RULE: "ifc.test.no-requirement"

The rule of a failed case that proves no requirement and belongs to no rule of a check.

sariffunction
function sarif(q: QualityRecord, grade?: Grade): string

The run as SARIF 2.1.0: each failed or cancelled case an error result and each case that did not run a warning, at its file and, where it has one, its line, with its rule (a check's rule id, else its first requirement) (FR-020); the counts, not_run included, and the grade as the run's properties.

Imported by 30 tests of the run (30 passed, 0 failed): the library's results

tapfunction
function tap(q: QualityRecord, grade?: Grade): string

The run as TAP version 14: tap14 of 0008-test-evidence for the cases that ran, then, as comments, the count of not_run beside the others, each case that did not run with its reason, and the grade.

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

completionReportfunction
function completionReport(q: QualityRecord, grade?: Grade): string

The test completion report of ISO/IEC/IEEE 29119-3 for a run (FR-017), as Markdown: the summary with the counts and the count of not_run, the requirements proved with the grade beside the count (FR-014), and the cases that did not pass.

Imported by 24 tests of the run (24 passed, 0 failed): the library's results

statusReportfunction
function statusReport(q: QualityRecord, grade?: Grade): string

The test status report of ISO/IEC/IEEE 29119-3 for a run in progress or ended (FR-017): where it stands, in a few lines.

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

IncidentReporttypeno test imports it
type IncidentReport = { readonly case: string; readonly text: string };

A test incident report of ISO/IEC/IEEE 29119-3 for one case that failed, was cancelled or did not run (FR-017).

incidentReportsfunction
function incidentReports(q: QualityRecord, grade?: Grade): readonly IncidentReport[]

The test incident reports of a run, one for each failure, cancellation and not_run (FR-017).

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

RenderFormattypeno test imports it
type RenderFormat = "junit" | "ctrf" | "sarif" | "tap" | "completion" | "status" | "incident";

The reports a render can write.

RENDER_FORMATSconst
const RENDER_FORMATS: readonly RenderFormat[]

Every format render knows, in the order it lists them.

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

isRenderFormatfunctionno test imports it
function isRenderFormat(text: string): text is RenderFormat

Whether a text is a format.

renderfunction
function render(q: QualityRecord, format: RenderFormat, grade?: Grade): string

A record rendered as one format (the incident reports joined, each beginning with its title).

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.