Repository navigation
Conversation
Signed-off-by: Lukas Kaempf <lukkaempf@gmail.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add meaningful assertions or golden-output coverage for scenario and backwards-compatibility cases.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Adds scenario IDs and names to JSON and JUnit test reports while preserving existing behavior for tests without scenarios.
Changes:
- Propagates scenario metadata from the runner.
- Serializes scenario fields in JSON reports.
- Uses scenario-aware display names in JUnit output.
Review note: Report tests should assert generated content, including named, unnamed, and no-scenario cases.
| File | Description |
|---|---|
pkg/runner/runner.go |
Populates scenario metadata. |
pkg/report/junit.go |
Includes scenario names in JUnit output. |
pkg/report/json.go |
Serializes scenario fields in JSON. |
pkg/model/report.go |
Adds scenario fields and display-name formatting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Lukas Kaempf <lukkaempf@gmail.com>
This branch has not been deployed
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.

Explanation
When a test defines scenarios, Chainsaw runs the test once per scenario. The terminal output already shows which scenario is running, but the generated reports did not.
This PR fixes that by carrying the scenario name and scenario id through to the report output. It is an additive, backwards-compatible change: tests without scenarios produce exactly the same reports as before.
Proposed Changes
model.TestReportgainsScenarioIdandScenarioName, plus aDisplayName()helper that returns<test-name> [<scenario-name>]when a scenario is set, and the plain test name otherwise.runnerpopulates both fields when building the test report. The scenario name comes fromnames.Scenario(...), so unnamed scenarios fall back toscenario #N, consistent with the terminal logger.Proof Manifests
Before
After
Same run with
--report-format JUNIT-TESTChecklist