-
Notifications
You must be signed in to change notification settings - Fork 71
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
Retry failed Scenario
s (#212)
#223
Conversation
# Conflicts: # CHANGELOG.md # README.md # book/src/introduction.md # book/src/output/json.md # book/src/output/junit.md # book/src/output/multiple.md # book/src/quickstart.md # book/src/writing/hooks.md # codegen/CHANGELOG.md # codegen/src/lib.rs # codegen/src/world.rs # src/codegen.rs # src/cucumber.rs # src/lib.rs # src/writer/summarize.rs # tests/after_hook.rs # tests/cli.rs # tests/json.rs # tests/junit.rs # tests/output.rs # tests/wait.rs
Scenario
s (#212)Scenario
s (#212)
FCM
|
src/event.rs
Outdated
|
||
/// [`Scenario`] execution being finished. | ||
/// | ||
/// [`Scenario`]: gherkin::Scenario | ||
Finished, | ||
Finished(Option<Retries>), |
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.
@ilslv maybe decomposition would be better here?
pub struct RetryableScenario<World> {
pub event: Scenation<World>,
pub retries: Option<Retries>,
}
So we don't pollute the Scenario
enum variants with Option.
src/runner/basic.rs
Outdated
@@ -121,6 +272,7 @@ type Failed = bool; | |||
pub struct Basic< | |||
World, | |||
F = WhichScenarioFn, | |||
R = RetryOptionsFn, |
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.
@ilslv maybe we could just Box<dyn FnMut>
here instead of introducing yet another type parameter? Doesn't seem to be critical.
src/runner/basic.rs
Outdated
|
||
let at = | ||
rest.strip_prefix(".after").and_then(|after| { | ||
after.strip_prefix('(').and_then(|after| { |
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.
@ilslv would be nice to refactor tags parsing into a separate function on RetryOptions
, and so cover it with unit tests.
…ailed-tests # Conflicts: # src/event.rs # src/runner/basic.rs
src/writer/summarize.rs
Outdated
@@ -55,7 +63,7 @@ impl Stats { | |||
/// [`Step`]: gherkin::Step | |||
#[must_use] | |||
pub const fn total(&self) -> usize { | |||
self.passed + self.skipped + self.failed | |||
self.passed + self.skipped + self.failed + self.retried |
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.
@ilslv I'm unsure that total should count retried scenarios, which are already part of passed or failed ones. This way we will lie about actual count of steps.
Resolves #212
Superseeds #214
Synopsis
For now there is no way to retry failed
Scenario
s.Solution
Implement ability to implement retries of failed
Scenario
s with:@retry
/@retry(3)
/@retry.after(3s)
/@retry(5).after(all)
--retry=3
/--retry-after=30ms
/--retry-after=all
Checklist
Draft:
prefixDraft:
prefix is removed