| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Conformance.EvidencePage
Contents
Description
The conformance evidence page is a function of four inputs and nothing
else: the requirement inventory (rows.json), the application model
revision (conformance/model-revision), and one snapshot of run output
for one stated code revision — the conformance run receipts and the
backend contract suite's per-adapter results, copied from the CI runs
that produced them.
No state is typed into the page. A requirement reads executed or
partial only through effectiveState, from a receipt whose base is the
snapshot's stated base; every other requirement is listed by its
requirement text under the plan rows.json declares. A snapshot whose
receipts or results name another base, were recorded on a dirty tree,
name an unknown requirement, or report a contract case list that is not
the same for every adapter is refused rather than rendered.
The documentation check renders the page again from the committed inputs and compares it byte for byte with the committed page and its speech companion; any difference fails the check.
Synopsis
- data Snapshot = Snapshot {
- snapBase :: !Text
- snapSources :: ![Source]
- snapReceipts :: ![Receipt]
- snapReceiptFiles :: ![FilePath]
- snapContract :: ![ContractResult]
- snapContractFiles :: ![FilePath]
- data Source = Source {
- sourceWorkflow :: !Text
- sourceRun :: !Text
- sourceArtifact :: !Text
- data ContractResult = ContractResult {
- crBase :: !Text
- crDirty :: !Bool
- crAdapter :: !Text
- crEvidence :: !ContractEvidence
- crCase :: !Text
- crKind :: !Text
- crRequirement :: !Text
- crOutcome :: !ContractOutcome
- data ContractEvidence
- data ContractOutcome
- = ContractPassed
- | ContractFailed !Text
- | ContractNotSupported !Text
- loadSnapshot :: FilePath -> IO (Either String Snapshot)
- data RenderedPage = RenderedPage {
- renderedPage :: !Text
- renderedSpeech :: !ByteString
- renderEvidencePage :: Text -> [Row] -> Snapshot -> Either String RenderedPage
- runEvidencePage :: FilePath -> Bool -> IO ()
Snapshot
Everything one snapshot directory holds.
Constructors
| Snapshot | |
Fields
| |
Instances
| Show Snapshot Source # | |
Defined in Conformance.EvidencePage | |
| Eq Snapshot Source # | |
Defined in Conformance.EvidencePage | |
Where the snapshot's files were copied from: one CI run's artifact.
Constructors
| Source | |
Fields
| |
Instances
| FromJSON Source Source # | |
Defined in Conformance.EvidencePage | |
| Show Source Source # | |
Defined in Conformance.EvidencePage | |
| Eq Source Source # | |
Defined in Conformance.EvidencePage | |
data ContractResult Source #
One line of the contract suite's results file.
Constructors
| ContractResult | |
Fields
| |
Instances
| FromJSON ContractResult Source # | |
Defined in Conformance.EvidencePage Methods parseJSON :: Value -> Parser ContractResult parseJSONList :: Value -> Parser [ContractResult] omittedField :: Maybe ContractResult | |
| Show ContractResult Source # | |
Defined in Conformance.EvidencePage Methods showsPrec :: Int -> ContractResult -> ShowS Source # show :: ContractResult -> String Source # showList :: [ContractResult] -> ShowS Source # | |
| Eq ContractResult Source # | |
Defined in Conformance.EvidencePage Methods (==) :: ContractResult -> ContractResult -> Bool Source # (/=) :: ContractResult -> ContractResult -> Bool Source # | |
data ContractEvidence Source #
The evidence class of one contract-suite run. There is no public chain.
Constructors
| ContractTestAdapter | |
| ContractDevNet |
Instances
data ContractOutcome Source #
One contract case's result on one adapter.
Constructors
| ContractPassed | |
| ContractFailed !Text | |
| ContractNotSupported !Text |
Instances
| Show ContractOutcome Source # | |
Defined in Conformance.EvidencePage Methods showsPrec :: Int -> ContractOutcome -> ShowS Source # show :: ContractOutcome -> String Source # showList :: [ContractOutcome] -> ShowS Source # | |
| Eq ContractOutcome Source # | |
Defined in Conformance.EvidencePage Methods (==) :: ContractOutcome -> ContractOutcome -> Bool Source # (/=) :: ContractOutcome -> ContractOutcome -> Bool Source # | |
loadSnapshot :: FilePath -> IO (Either String Snapshot) Source #
Read a snapshot directory: snapshot.json (the stated base and the
CI runs the files were copied from), receipts/ (the conformance run's
receipt artifact, as downloaded) and contract/ (the contract suite's
results files, one JSON object per line).
Rendering
data RenderedPage Source #
The page and its speech companion, as the site publishes them.
Constructors
| RenderedPage | |
Fields
| |
renderEvidencePage :: Text -> [Row] -> Snapshot -> Either String RenderedPage Source #
Render the evidence page, or refuse the snapshot naming why. The first argument is the application model revision.
The command
runEvidencePage :: FilePath -> Bool -> IO () Source #
Render the published evidence page from the repository at root:
conformance/rows.json, conformance/model-revision and the snapshot
conformanceevidencepage. With write the page and its (unstamped)
speech companion are written. Otherwise the committed page must equal
the rendering byte for byte and the committed speech must carry exactly
the rendered sections, or the command exits non-zero naming the
disagreement.