[#45] Fixed metrics doubling when formatter used with other formatters.#47
Merged
AlexSkrypnyk merged 1 commit intomainfrom Nov 25, 2025
Merged
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis pull request fixes a metrics duplication bug that occurred when the progress_fail formatter was used alongside other formatters. The solution introduces a dedicated TotalStatistics service for progress_fail instead of sharing the global statistics service, and includes a regression test to verify the fix. Changes
Sequence Diagram(s)sequenceDiagram
participant Behat as Behat Runner
participant ProgFormatter as Progress Formatter
participant ProgFailFormatter as Progress_Fail Formatter
participant SharedStats as Shared Statistics<br/>(Old Behavior)
participant DedicatedStats as Dedicated Statistics<br/>(New Behavior)
rect rgb(200, 220, 240)
Note over Behat,DedicatedStats: Old Behavior (Metrics Doubled)
end
Behat->>ProgFormatter: test scenarios
ProgFormatter->>SharedStats: increment counts
Behat->>ProgFailFormatter: test scenarios
ProgFailFormatter->>SharedStats: increment counts (duplicates!)
Note over SharedStats: Both formatters share same counters
rect rgb(220, 240, 200)
Note over Behat,DedicatedStats: New Behavior (Metrics Correct)
end
Behat->>ProgFormatter: test scenarios
ProgFormatter->>SharedStats: increment counts
Behat->>ProgFailFormatter: test scenarios
ProgFailFormatter->>DedicatedStats: increment counts (isolated)
Note over DedicatedStats: Each formatter has own statistics
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
Comment |
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.
Closes #45
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.