Skip to content

Add scenario setup and teardown lifecycle#21

Merged
slideep merged 1 commit into
mainfrom
codex/scenario-lifecycle
May 19, 2026
Merged

Add scenario setup and teardown lifecycle#21
slideep merged 1 commit into
mainfrom
codex/scenario-lifecycle

Conversation

@slideep
Copy link
Copy Markdown
Contributor

@slideep slideep commented May 19, 2026

Summary

  • add scenario setup and teardown lifecycle sections around existing steps
  • emit/report lifecycle phase for setup, main, and teardown steps
  • run teardown after setup/main failures while preserving the first failure as authoritative
  • make scenario discovery/action filtering and validation lifecycle-aware

Validation

  • dotnet test Luotsi.Cli.Tests\Luotsi.Cli.Tests.csproj
  • dotnet build -c Release
  • git diff --check

Copilot AI review requested due to automatic review settings May 19, 2026 08:41
Comment thread Luotsi.Cli/Scenarios/ScenarioExecutor.cs
Comment thread Luotsi.Cli/Scenarios/ScenarioExecutor.cs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds scenario lifecycle support (setup / main steps / teardown) to the Luotsi scenario runner, including phase-aware reporting/events and ensuring teardown runs even after setup/main failures.

Changes:

  • Introduces setup and teardown sections in ScenarioFile and makes validation/catalog discovery lifecycle-aware.
  • Executes scenario lifecycle with phase reporting in JSONL events and scenario reports.
  • Extends test fakes and adds coverage for lifecycle ordering, phase reporting, and “first failure wins” behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Luotsi.Cli/Scenarios/ScenarioValidator.cs Validates setup/main/teardown steps in order; updates “observe from previous step” rule to be lifecycle-aware.
Luotsi.Cli/Scenarios/ScenarioExecutor.cs Runs setup + main with teardown always attempted; emits per-step phase and reports phase in step results.
Luotsi.Cli/Scenarios/ScenarioEvents.cs Extends scenario event payload with phase field.
Luotsi.Cli/Scenarios/ScenarioCatalog.cs Includes lifecycle steps in catalog action discovery and step counting; adds ScenarioStepPhases.
Luotsi.Cli/Models/Contracts.cs Extends ScenarioFile contract to include Setup and Teardown.
Luotsi.Cli.Tests/TestSupport.cs Enhances FakeDeviceHost to support lifecycle-related assertions and injected failures.
Luotsi.Cli.Tests/ScenarioExecutorTests.cs Adds tests for lifecycle ordering, validation, teardown-after-failure, and phase reporting.

Comment thread Luotsi.Cli/Scenarios/ScenarioExecutor.cs
Comment thread Luotsi.Cli/Scenarios/ScenarioExecutor.cs
Comment thread Luotsi.Cli/Scenarios/ScenarioCatalog.cs
@slideep slideep merged commit 0b953a6 into main May 19, 2026
13 checks passed
@slideep slideep deleted the codex/scenario-lifecycle branch May 19, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants