Skip to content

Support shared assertions across case results (each_result / common_traces) #17

Description

@SchuylerGoodman

Problem

When multiple test cases in a spec all call the same operation, the harness spec test cases must repeat the same traces: block for every case result. This is verbose and error-prone.

Example

13 scalar_operators cases all produce the same 4 trace events. The harness spec repeats those 4 lines 13 times.

Proposed solution

A common_traces or each_result field at the results level that defines assertions valid for all results:

expected:
  outcome:
    Complete:
      each_result:
        traces:
          - $run: get_measurement
          - temperature: { $exists: true }
      results:
        - name: regex_match
          status: pass
          expected:
            - label: { $matches: "^sensor" }

This eliminates repetition while still proving operations ran.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions