Add Ansible-style Scenario Recap to Report Output#4494
Merged
cidrblock merged 6 commits intoansible:mainfrom Aug 2, 2025
Merged
Add Ansible-style Scenario Recap to Report Output#4494cidrblock merged 6 commits intoansible:mainfrom
cidrblock merged 6 commits intoansible:mainfrom
Conversation
- Add scenario recap section matching Ansible play recap format - Include action counts and completion state statistics per scenario - Apply conditional ANSI coloring following Molecule's theme - Use 79-character padded headers for consistency - Dynamically build state counts from SCENARIO_RECAP_STATE_ORDER constant
4720cf9 to
dbfe7c0
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new Ansible-style "Scenario Recap" section to Molecule's report output. The enhancement provides users with a consolidated summary of scenario execution results, displaying action counts and completion state statistics per scenario with conditional ANSI coloring.
- Adds scenario recap functionality with Ansible-style formatting and coloring
- Updates report headers from "Summary" to "DETAILS" and adds "SCENARIO RECAP" section
- Refactors completion state constants for consistency and reusability
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/molecule/reporting.py |
Updates main report function with new header format and integrates scenario recap |
src/molecule/ansi_output.py |
Implements format_scenario_recap() method with Ansible-style formatting and conditional coloring |
src/molecule/constants.py |
Adds new constants for scenario recap state ordering and completion state colors |
tests/unit/test_reporting.py |
Adds comprehensive test coverage for scenario recap functionality |
tests/integration/test_command.py |
Updates integration tests for new report format with helper functions |
.config/dictionary.txt |
Updates spell check dictionary with new test-related terms |
8483e68 to
73aa972
Compare
1f11e10 to
d2317bf
Compare
Author
|
I'm going to merge this, it just an addition to the UI. The next PR is gonna change the output again and assert against it. Reporting is still an opt in experimental feature so there should no impact to the logic and flow. If concerned LMK |
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
Introduces a new "Scenario recap" section to Molecule's report output that matches Ansible's play recap format. This enhancement provides users with a consolidated view of scenario execution results, displaying action counts and completion state statistics per scenario with conditional ANSI coloring.
Motivation
Changes by File
src/molecule/reporting.pyreport()functionformat_scenario_recap()call in report floworiginal_stderrfor proper stream handlingsrc/molecule/ansi_output.pyformat_scenario_recap()method toAnsiOutputclassSCENARIO_RECAP_STATE_ORDERconstantactions=X) before completion statessrc/molecule/constants.pySCENARIO_RECAP_STATE_ORDERtuple for display orderCOMPLETION_STATE_PRIORITY_ORDERtuple for state rankingCOMPLETION_STATE_COLORSmapping for consistent color applicationtests/unit/test_reporting.pyformat_scenario_recap()methodtests/integration/test_command.pynormalize_report_whitespace()helper for robust test comparisonsOutput Example
Testing