Skip to content

pytest helper: turn a committed trace into a one-line regression test #21

Description

@tishachawla-jg

Problem

Writing a regression test from a recorded incident today is boilerplate in every test: reset_session() + load_trace() + enable_replay() + run + assert.

Proposal (keep it small)

A thin pytest helper so a committed trace is a one-liner. Pick whichever reads best; do not build a plugin framework:

  • a fixture: def test_fix(chronicle_replay): s = chronicle_replay("fixtures/traces/incident-001", ReplayPlan().stub("agent",1).live("delete_file",1)); run_agent(...); assert s.captured_result("delete_file",1)["blocked"]
  • or a decorator wrapping chronicle.replay_trace(...).

One pytest11 entry point exposing one fixture is enough. Reuse the existing replay_trace().

Acceptance

  • Load a trace, run the agent, assert on captured_result(...) in ~3 lines.
  • Works for sync and async agents.
  • One test in tests/ + a short README snippet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions