-
Notifications
You must be signed in to change notification settings - Fork 669
Add Ansible-style Scenario Recap to Report Output #4494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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 |
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.py
report()
functionformat_scenario_recap()
call in report floworiginal_stderr
for proper stream handlingsrc/molecule/ansi_output.py
format_scenario_recap()
method toAnsiOutput
classSCENARIO_RECAP_STATE_ORDER
constantactions=X
) before completion statessrc/molecule/constants.py
SCENARIO_RECAP_STATE_ORDER
tuple for display orderCOMPLETION_STATE_PRIORITY_ORDER
tuple for state rankingCOMPLETION_STATE_COLORS
mapping for consistent color applicationtests/unit/test_reporting.py
format_scenario_recap()
methodtests/integration/test_command.py
normalize_report_whitespace()
helper for robust test comparisonsOutput Example
Testing