Skip to main content

Crate icedwright_trace

Crate icedwright_trace 

Source
Expand description

The icedwright trace format.

A trace is a .iwtrace zip holding every step a test took:

meta.json          format, test, crate, versions, windows, theme, scale, failure, frames dropped
steps.jsonl        one Step per line
blobs/<hash>.yaml  semantic trees, each stored once
blobs/<hash>.png   frames, each stored once
source/<file>      the test source files steps point at
attachments/<name> files the test attached, such as a failure screenshot
real.json          real-clock timings, which comparisons skip

TraceWriter takes plain values and writes the same bytes for the same steps on every run: instants are offsets from boot, ids are renumbered in order of first appearance, and the archive has fixed timestamps, member order and compression settings. When a trace would pass its size cap, frames are dropped in a fixed order; trees and steps never are. TraceReader reads it back, and compare finds where two traces first differ.

Structs§

Attempt
One evaluation of an expect.
BadBlobHash
Why a string is not a BlobHash.
BlobHash
The blake3 hash of a blob’s bytes, printed as 64 lowercase hex digits.
BlobRef
A content-addressed blob whose media type is part of its type, so a tree ref cannot be read as a frame. Only the writer makes them, and reading a trace back.
BootInstant
The real instant the harness booted at, as the platform’s Instant Debug text spells it, so instants printed inside message text can be rewritten as offsets from boot.
ByteSize
A size in bytes.
LogLine
One line of a step’s call log.
Png
An encoded PNG image, and the media marker for frame blobs.
RawSubscriptionId
The harness’s id for a subscription.
RawTaskId
The harness executor’s id for a task.
RawWidgetId
The counter value inside an iced widget::Id::unique().
RawWindowId
The counter value inside an iced window::Id.
RealSpan
When a step ran on the real clock, measured from the start of the test.
RealTiming
A step’s real timing, kept in real.json, which comparisons skip.
RealTimings
Everything in real.json.
SelectorText
A selector in its canonical printed form. It is made only from a CanonicalSelector, so it always parses.
SourceLocation
A place in the test’s source.
Step
One call the test made on the harness: an action, an expect, a clock advance, a task release or a window change. Times are measured from boot.
StepBuilder
One open step. Recording into it after end does not compile, because end takes it by value.
StepDifference
The first step at which two traces differ.
StepIndex
The position of a step in its trace.
SubscriptionOrdinal
A subscription, numbered in the order the trace first saw it.
TaskOrdinal
A task, numbered in the order the trace first saw it.
TraceConfig
How a harness traces. The environment overrides only the mode, output directory and size cap.
TraceEvent
An input event the harness delivered, with its window renumbered.
TraceMessage
A message, as its normalised Debug text.
TraceMeta
What a trace is of, filled in by the harness.
TraceReader
A trace read back from its archive. Steps and metadata are read when it opens; blobs, sources and real timings are read on demand.
TraceStart
What the app looked like when the harness booted, before any step.
TraceTask
A change in a task’s life.
TraceWriter
Builds a trace step by step and writes the archive. It takes plain values and knows nothing about iced; the harness’s step observer drives it. A step is open between begin_step and StepBuilder::end.
WidgetOrdinal
A widget with a generated id, numbered in the order the trace first saw it.
WindowMeta
A window the trace saw.
WindowOrdinal
A window, numbered in the order the trace first saw it.
WriteSummary
What TraceWriter::write wrote.

Enums§

Captured
Whether a widget captured an input event, as iced’s event::Status reports it.
Difference
Where two traces first differ.
FramePolicy
Which steps keep frames. Frames are rendered the same way under every policy.
StepChange
How a step differs between two traces.
StepKind
What the test asked for in a step. Action, assertion, task control and window change kinds are stored by name.
StepOutcome
How a step ended.
TraceError
Everything that can go wrong configuring, writing or reading a trace.
TraceMode
When a trace file is written. Recording is the same in every mode, so the mode never changes what the app does.
TraceOrigin
What produced a message.
TraceTaskChange
What happened to a task.
Yaml
Marks a blob holding a semantic tree as YAML text.

Constants§

FORMAT
The format this crate writes and the newest it reads.

Traits§

CanonicalSelector
Implemented by a locator, whose canonical printed form always parses back to it.
Media
A kind of blob a trace stores. Sealed: the format has exactly these.
RawId
A raw id from a process-wide counter. The ordinal it renumbers to follows from its type.

Functions§

check_attachment_name
Refuses an attachment name that is not a plain file name, as TraceWriter::attach would.
compare
Compares two traces member by member, skipping real.json, and reports the first step that differs, then the metadata, then any other member by name. None means they are the same apart from real timings.