Skip to content

Add session = true flag so steps run regardless of checkpoint skipping #35

@codesoda

Description

@codesoda

Problem

When resuming from a checkpoint via --from-checkpoint, all steps up to and including the checkpoint step are skipped. This includes session setup steps like starting a headed browser (browser start --headed), which means the browser is never started and subsequent steps that use browser open fall back to headless mode.

Example from a real test file:

[[steps]]
instruction = "Start the browser in headed mode by running: browser start --headed"

[[steps]]
instruction = "Query the database to verify it is completely empty..."

[[steps]]
checkpoint = "after-oauth"
instruction = "After the redirect back to the app..."

Running bugatti test --from-checkpoint after-oauth skips steps 1-3, restores the checkpoint, then continues from step 4 — but the browser was never started.

Proposed solution

Add a session = true flag on steps. Session steps always execute, even when marked as skipped by --from-checkpoint.

[[steps]]
session = true
instruction = "Start the browser in headed mode by running: browser start --headed"

Implementation

  1. test_file.rs — add #[serde(default)] pub session: bool to Step
  2. expand.rs — propagate session field to ExpandedStep
  3. executor.rs — change the skip guard from if step.skip to if step.skip && !step.session
  4. No changes needed to --from-checkpoint logic or checkpoint restore logic

Execution order with --from-checkpoint after-oauth

  1. Checkpoint restore runs (restores DB state)
  2. Step 1 (session = true) — executes browser start --headed
  3. Steps 2-3 — skipped normally
  4. Step 4+ — executes normally

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions