IF Commons GitHub

evidence

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-docs FR-022, 0001-docs FR-009, 0001-docs FR-027

The evidence the site shows beside the code (docs 0001-docs FR-009 to FR-011): the results of the tests, the issues kept as typed code, and the tickets of GitHub, read from files that CI (or a person) leaves in a folder, so that the same files give the same pages. The results are CTRF (the Common Test Report Format: <library>.ctrf.json, one file for each library, written by ifc test run --report ctrf), with the requirements each test proves in extra.requirements; meta.json says which commit they are of. The package reads the format and imports no library that makes it (0011-documentation FR-026). Nothing here runs a test or reaches a network: a missing folder is "no run recorded", and a file that cannot be read is a finding.

Source: commons/docs/src/evidence.ts

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

Evidenceinterfaceno test imports it
interface Evidence

Everything the site knows of quality.

MemberTypeWhat it is
packageReportPackageReport | undefinedWhat the package weighs, from the report of its packer (docs 0001-docs FR-032), where one is kept.
usagesreadonly ConsumerUsage[]What each consumer repository reaches of the package, from usage.<consumer>.json.
resultsReadonlyMap<string, LibraryResults>
runRunMeta | undefined
issuesreadonly TypedIssue[]
ticketsreadonly Ticket[]
recordedbooleanWhether a folder of results was given and read (a run is recorded), as opposed to none.
statusReadonlyMap<string, LibraryStatus>What each library's job says of its tests, by library.
buildBuildInfo | undefined
workflowsreadonly WorkflowRuns[]The workflows and their recent runs; none where runs.json is not there.
runsErrorstring | undefinedWhy the runs could not be read, where runs.json says so.
historyreadonly HistoryRun[]The runs of the evidence that were kept (docs 0001-docs FR-016), oldest first.
coverageReadonlyMap<string, LibraryCoverage>The line coverage of each library whose tests were run with it (docs 0001-docs FR-022).
mutationReadonlyMap<string, LibraryMutation>The mutation run of each library that has one (docs 0001-docs FR-027).
findingsreadonly FindingsFile[]The findings of the runs of the workflows, from the history branch, oldest first (docs 0001-docs FR-030).
acceptances{ readonly accepted: readonly Acceptance[]; readonly problems: readonly string[]; }The accepted risks of the repository and what was wrong with their files (docs 0001-docs FR-030).
isOpenconstno test imports it
const isOpen: (i: Pick<IssueLike, "status">) => boolean

Whether an issue's status is one that is still to be dealt with.

LibraryResultsinterfaceno test imports it
interface LibraryResults

The results of one library's suite.

MemberTypeWhat it is
librarystringThe library, by the name of its folder (repository for the tests of the repository itself).
testsreadonly TestResult[]
passednumber
failednumber
skippednumber
othernumberTests that were planned and not run (pending, todo, other).
NONEconstno test imports it
const NONE: Evidence

No evidence: nothing recorded.

parseCtrffunction
function parseCtrf(library: string, text: string, prefix: string): { readonly value: LibraryResults; } | { readonly error: string; }

The results of a CTRF file: its tests, or why it cannot be read.

ParameterWhat it is
librarythe library the file is of
textthe file's text
prefixwhat is put before a test's path to make it a path from the repository's root

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

parseTicketsfunction
function parseTickets(text: string): { readonly value: readonly Ticket[]; } | { readonly error: string; }

The tickets of a snapshot of the GitHub issues of a repository (a JSON array as the API gives it; pull requests are left out).

ParameterWhat it is
textthe snapshot

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

readEvidencefunction
function readEvidence(root: string, source: EvidenceSource | undefined, found: Finding[], dirOf?: (library: string) => string): Evidence

The evidence the configuration names, read from its files.

ParameterWhat it is
rootthe repository's root, absolute
sourcewhat the configuration gives
foundwhere findings are added
dirOfthe folder of a library, from the repository's root (commons/core; "" for the repository itself)

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

requirementsInfunction
function requirementsIn(text: string): string[]

The requirement keys a text names, as 0009-example FR-001.

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

standingfunction
function standing(tests: readonly TestResult[]): "failing" | "none" | "partly" | "proved"

What the tests of a requirement come to: not run (none recorded), failing, proved (every one passed) or partly (some skipped or planned).

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

TestResultinterfaceno test imports it
interface TestResult

One test of a run.

MemberTypeWhat it is
namestringIts name, as proves makes it: the requirements, a colon and what it says.
statusTestStatus
durationMsnumber
filestringIts file, from the repository's root.
requirementsreadonly string[]The requirements it proves, as 0009-example FR-001.
riskstring
runtimestring
retriesnumber
messagestring | undefinedWhy it failed, cut short; for a failed test only.
TestStatustypeno test imports it
type TestStatus = "passed" | "failed" | "skipped" | "pending" | "other";

How a test ended, in CTRF's words.

Ticketinterfaceno test imports it
interface Ticket

A ticket of GitHub, as its API gives it, read from a snapshot.

MemberTypeWhat it is
numbernumber
titlestring
state"closed" | "open"
urlstring
labelsreadonly string[]
bodystring
librariesreadonly string[]The libraries it is about (a label lib:<name>, or a path of commons/<name>/ in its words).
requirementsreadonly string[]The requirements it names, as 0009-example FR-001.
TypedIssueinterfaceno test imports it
interface TypedIssue extends IssueLike

An issue kept as typed code, with the library it is of.

MemberTypeWhat it is
librarystring
scopestring | undefinedThe path of its set in the library, where the library has more than one.
idnumber
slugstring
titlestring
summarystring
severitystring
prioritystring
goals?readonly string[]
status{ readonly kind: string; readonly reason?: string | undefined; readonly by?: string | undefined; readonly of?: number | undefined; readonly until?: string | undefined; readonly proof?: readonly { readonly [k: string]: unknown; readonly kind: string; }[] | undefined; }
size?string
cites?readonly string[]The requirements it is about, as 0043-sql-invariants FR-002.
evidence?readonly { readonly [k: string]: unknown; readonly kind: string; }[]
links?readonly { readonly kind: string; readonly to: number; }[]
raisedstring

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