-
Notifications
You must be signed in to change notification settings - Fork 254
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
fix(formatter): On concurrent execution, execute formatter at end of Scenario #645
Conversation
2985202
to
ec38975
Compare
one test is broken, |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #645 +/- ##
==========================================
- Coverage 83.21% 79.79% -3.42%
==========================================
Files 28 41 +13
Lines 3413 4044 +631
==========================================
+ Hits 2840 3227 +387
- Misses 458 697 +239
- Partials 115 120 +5 ☔ View full report in Codecov by Sentry. |
@@ -233,6 +233,21 @@ func (s *Storage) MustGetPickleStepResultsByPickleID(pickleID string) (psrs []mo | |||
return psrs | |||
} | |||
|
|||
// MustGetPickleStepResultsByPickleIDUntilStep will retrieve pickle step results by pickle id | |||
// from 0..stepID for that pickle. | |||
func (s *Storage) MustGetPickleStepResultsByPickleIDUntilStep(pickleID string, untilStepID string) (psrs []models.PickleStepResult) { |
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.
This only needed to be done for the Pretty formatter, so I wasn't sure if I should just do it after MustGetPickleStepResultsByPickleID
in fmt_pretty.go
, or create a function for it.
I've opted to create a function with a pretty bad name, so let me know if yous are happy with this.
…io when running concurrently
7f26697
to
db14449
Compare
Thank you! |
if this is a new formatter please, can we please have fmt-output-test cases in line with the other formatters please . consistent test patterns help other commiters helps avoid entropy |
@Johnlon it isn't really a new formatter and instead is a wrapper of current formatters. All it does is delay the execution of the wrapped formatter until the end of the scenario, and this delayed execution is tested. In an additional PR, I could put time into testing that the output of a wrapped formatter is as we would expect, but given the wrapper only provides behavioural changes, testing the behaviour as I've done here and using the output tests already in place is enough. |
@tigh-latte Thanks so much for adding this, I've been able to re-enable concurrency in my tests because of it! |
🤔 What's changed?
Add a new formatter type which only executes when
Flush
is called. Use this formatter when running concurrently.Then while running concurrently, after the
suite
is copied for a scenario, we overwrite the copy'sFormatter
to use this newOnFlushWrap
formatter.At the end of
runPickle
, if we canFlush
, we do.⚡️ What's your motivation?
Fixes #643 , Scenario output is only printed at end of
runPickle
func when running concurrently.🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Any feedback on the general approach to solving this would be good.
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.