IF Commons GitHub

logical/conformance

Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0008-integrations-plugins FR-005, 0008-integrations-plugins FR-006, 0008-integrations-plugins FR-007, 0008-integrations-plugins FR-008

The conformance suites of the extension points (commons integrations 0008-integrations-plugins): what every connector and every standards plugin must satisfy, as pure functions from the extension and its fixtures to findings. A plugin package runs them in its own tests and asserts that the findings are empty.

The suites use no test framework: a finding is data (ConformanceFinding) with the extension's id, so that a registry can refuse an extension that does not conform.

Source: commons/integrations/src/logical/conformance.ts

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

ConformanceFindingtypeno test imports it
type ConformanceFinding = { readonly extension: string; readonly rule: string; readonly message: string };

What a suite found wrong.

ConnectorFixturetypeno test imports it
type ConnectorFixture = {
  readonly name: string;
  readonly port: ReadPort;
  readonly now: Instant;
  readonly expect: {
    readonly account?: string;
    readonly posture?: Readonly<Record<string, string | number | boolean>>;
    readonly labels?: Readonly<Record<string, number>>;
    readonly policies?: Readonly<Record<string, PostureStatus>>;
  };
};

A recorded run of a connector: the port it reads, the moment, and what is expected of the result.

conformConnectorfunction
function conformConnector(c: Connector, fixtures: readonly ConnectorFixture[]): Promise<readonly ConformanceFinding[]>

The conformance of a connector over its fixtures: sound governance, a description that agrees with it, at least one fixture, a probe that answers, an observation that names the connector, keeps no denied field, is the same when observed twice, and meets each fixture's expectations.

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

PluginSamplestypeno test imports it
type PluginSamples = { readonly valid: readonly string[]; readonly garbage: readonly string[] };

What a plugin is checked with: texts of its syntax that parse, from the issuer's published examples or generated, never real data.

conformPluginfunction
function conformPlugin(p: StandardsPlugin, samples: PluginSamples): readonly ConformanceFinding[]

The conformance of a standards plugin: its codec parses each valid sample, serializes it and reads the result back to the same tree (round trip); it fails each garbage text as a syntax error that holds no part of the text; and its standards are registered with a licence that has terms.

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

findingsHoldNoValuefunction
function findingsHoldNoValue(fs: readonly Finding[], tree: Interchange): boolean

The findings of a validation, with none of their messages holding a value of the payload: the check a plugin's validation must pass.

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

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