convex-tasty-streaming
Safe HaskellSafe-Inferred
LanguageHaskell2010

Convex.Tasty.Streaming.TMSummary

Synopsis

Documentation

data ThreatModelSummary Source #

Structured summary of a threat-model test case.

Constructors

ThreatModelSummary 

Instances

Instances details
FromJSON ThreatModelSummary Source # 
Instance details

Defined in Convex.Tasty.Streaming.TMSummary

ToJSON ThreatModelSummary Source # 
Instance details

Defined in Convex.Tasty.Streaming.TMSummary

Generic ThreatModelSummary Source # 
Instance details

Defined in Convex.Tasty.Streaming.TMSummary

Associated Types

type Rep ThreatModelSummary :: Type -> Type #

Show ThreatModelSummary Source # 
Instance details

Defined in Convex.Tasty.Streaming.TMSummary

Eq ThreatModelSummary Source # 
Instance details

Defined in Convex.Tasty.Streaming.TMSummary

type Rep ThreatModelSummary Source # 
Instance details

Defined in Convex.Tasty.Streaming.TMSummary

type Rep ThreatModelSummary = D1 ('MetaData "ThreatModelSummary" "Convex.Tasty.Streaming.TMSummary" "convex-tasty-streaming-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ThreatModelSummary" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tmsName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "tmsTested") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "tmsTotal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "tmsPassed") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "tmsFailed") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "tmsSkipped") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "tmsErrors") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))))

data TMStore Source #

Mutable storage for threat-model summaries, owned by the reporter.

newtype TMRecorder Source #

A recorder closure passed to test bodies via Tasty's option system. The default no-op makes summaries silently dropped when the streaming reporter is not active.

Constructors

TMRecorder 

Fields

newtype TMStoreOption Source #

Internal option carrying the live store. Set by defaultMainStreaming alongside the recorder so the reporter can read summaries back out.

Constructors

TMStoreOption (Maybe TMStore) 

data TraceRecorder Source #

Callback for recording iteration traces as pre-serialized JSON. Arguments: group name, category ("positive"/"negative"), pre-serialized trace JSON. Default is a no-op (zero overhead when streaming is not active).

When trEnabled returns True, test bodies use the expensive traced code path (building IterationTrace values with UTxO snapshots, transaction summaries, and JSON serialisation). When it returns False (the IsOption default), the cheap runActions path is used instead, avoiding all that work.

trEnabled is an IO action so that the decision can be deferred until the streaming reporter has parsed --no-trace and written the shared IORef.

Constructors

TraceRecorder 

Fields

newTMStore :: IO TMStore Source #

Allocate fresh storage. Call once per reporter run.

storeRecorder :: TMStore -> TMRecorder Source #

Build a recorder that writes into the given store.

lookupThreatModelSummary :: TMStore -> String -> IO (Maybe ThreatModelSummary) Source #

Look up a summary by key (does not delete).