Add scenario reports and artifact policies#20
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class scenario run reporting (JSON + JUnit) and introduces new controls for failure artifact capture and report artifact attachment, while extending scenario path resolution (recursive globs) and sharding (stable hash strategy). This fits into the CLI scenario execution pipeline by wrapping planning/execution with report/event coordinators and enriching scenario identity metadata for correlation.
Changes:
- Add JSON and JUnit scenario run reports for
run --file/run --path, including failure-shape preservation across planning/execution errors. - Add artifact policy controls:
--capture-on(failure artifacts generation) and--attach-artifacts(report attachment policy), plus deterministicscenario_idpropagation in events/results. - Add recursive glob discovery (
**/*.json) and--shard-strategy index|hashfor stable sharding.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Luotsi.Cli/Scenarios/ScenarioValidator.cs | Adjusts validation order to reject empty/whitespace actions before trimming. |
| Luotsi.Cli/Scenarios/ScenarioReports.cs | Introduces report models + writers (JSON + JUnit) and report coordination around scenario planning/execution. |
| Luotsi.Cli/Scenarios/ScenarioExecutorFactory.cs | Threads failure artifact capture policy into ScenarioExecutor creation. |
| Luotsi.Cli/Scenarios/ScenarioExecutor.cs | Adds deterministic scenario_id to events/results and makes failure artifact capture best-effort + policy-controlled. |
| Luotsi.Cli/Scenarios/ScenarioEvents.cs | Adds shard strategy metadata and ensures terminal run events are emitted even on planning failures. |
| Luotsi.Cli/Scenarios/ScenarioCatalog.cs | Adds recursive glob resolution, shard strategy support (index/hash), and stable shard hashing. |
| Luotsi.Cli/Scenarios/ScenarioBatchExecutorFactory.cs | Threads failure artifact capture policy into batch executor creation. |
| Luotsi.Cli/Scenarios/ScenarioBatchExecutor.cs | Propagates catalog metadata (file/id) into batch item results and includes shard strategy in batch result. |
| Luotsi.Cli/Cli/Routing/ScenarioQueryFactory.cs | Parses/normalizes --shard-strategy into ScenarioQuery. |
| Luotsi.Cli/Cli/Routing/ScenarioCommandDispatcher.cs | Wires up report coordinator, capture/attach policies, and planning-failure event/report flows for run. |
| Luotsi.Cli/Cli/Help.cs | Documents new run options and glob-capable --path. |
| Luotsi.Cli/Cli/Composition/AppHostedCommandCompositionBuilder.cs | Registers ScenarioRunReportCoordinatorFactory in composition root. |
| Luotsi.Cli.Tests/TestSupport.cs | Enhances FakeDeviceHost to record/throw failure artifact capture for policy/capture-failure tests. |
| Luotsi.Cli.Tests/ScenarioExecutorTests.cs | Adds coverage for recursive globs, report outputs (JSON/JUnit), planning/execution failure report shapes, artifact policies, and hash sharding. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run --fileandrun --pathValidation
dotnet test Luotsi.Cli.Tests\Luotsi.Cli.Tests.csprojdotnet build -c Releasegit diff --check