Skip to content

Conversation

cidrblock
Copy link
Contributor

Overview

Molecule now displays a concise execution summary for every run, providing immediate visibility into scenario outcomes with proper log levels and color coding.

New Behavior

Before: Summary only shown when --report flag was used

# No summary without --report flag

After: Always displays execution summary with appropriate log level

INFO     Molecule executed 1 scenario (1 successful)
WARNING  Molecule executed 1 scenario (1 missing files)  
ERROR    Molecule executed 3 scenarios (1 failed, 1 missing files, and 1 successful)

Key Features

  • Always visible: Summary appears regardless of --report flag usage
  • Proper log levels: ERROR for failures, WARNING for missing files, INFO for success
  • Color-coded details: Individual state counts use appropriate colors while maintaining clean formatting
  • Improved messaging: Uses "executed" terminology and clarifies "missing files" vs ambiguous "missing"
  • Oxford comma formatting: Grammatically correct lists for multiple states
  • Priority ordering: Most critical issues (failures) appear first in multi-state summaries

Implementation Details

The --report flag now controls detailed output sections only, while the one-line summary is always shown. This required restructuring the reporting module to eliminate circular imports and separate data definitions from rendering logic.

Module Structure Changes:

  • Split reporting.py into reporting/definitions.py (data structures) and reporting/rendering.py (I/O)
  • Updated imports across codebase to use specific modules
  • Eliminated circular import warnings

Backward Compatibility

All existing functionality preserved. The --report flag continues to control detailed output sections as before, with the addition of the always-visible summary line.

@cidrblock cidrblock requested a review from a team as a code owner August 8, 2025 14:16
@cidrblock cidrblock requested a review from Qalthos August 8, 2025 14:25
@cidrblock cidrblock closed this Aug 11, 2025
@cidrblock cidrblock reopened this Aug 11, 2025
@cidrblock cidrblock force-pushed the feature_one_line_summary branch from 7526394 to 8927f58 Compare August 11, 2025 12:48
@Qalthos Qalthos force-pushed the feature_one_line_summary branch from 6244b65 to 54fadb4 Compare August 11, 2025 15:29
@cidrblock cidrblock merged commit d51a77a into ansible:main Aug 11, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants