-
Notifications
You must be signed in to change notification settings - Fork 403
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
add reducing method MERGE_FEATURES_WITH_RETEST_MARKING_FLACKY #986
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #986 +/- ##
============================================
- Coverage 97.94% 97.39% -0.55%
- Complexity 557 587 +30
============================================
Files 54 55 +1
Lines 1166 1228 +62
Branches 106 109 +3
============================================
+ Hits 1142 1196 +54
- Misses 9 14 +5
- Partials 15 18 +3
Continue to review full report at Codecov.
|
4605327
to
953274f
Compare
953274f
to
3826b3f
Compare
Some checks are failing. Also no functional description provided |
@damianszczepanik Hi! I have updated the description. As for failing, it is coverage problem. But I have checked and covered failed but still have an issues. For example Step class is fully covered but it shows |
@@ -131,6 +135,18 @@ public String getFormattedDuration() { | |||
return Util.formatDuration(duration); | |||
} | |||
|
|||
public boolean isStatus(Status status) { |
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.
method which start from isXXX should only perform fast checking and here I see some logic
* | ||
* @author Vitaliya Ryabchuk (aqaexplorer@github) | ||
*/ | ||
public interface Embedded { |
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.
it looks more like a class than interface
@@ -43,4 +43,5 @@ public String getLabel() { | |||
public boolean isPassed() { | |||
return this == PASSED; | |||
} | |||
|
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.
nothing has changed here, revert the file
setEmbeddingsInAfterHookIfPresent(target, candidate, targetFailed); | ||
} | ||
|
||
void setErrorMessage(Resultsable targetFailed, Stream<Resultsable> candidateResultsableStream) { |
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.
copyErrorMessage - what do you think?
Resultsable getFailedResultsable(Stream<Resultsable> resultsableStream) { | ||
return resultsableStream.filter(resultsable -> resultsable.getResult().getStatus() == FAILED) | ||
.findFirst() | ||
.orElseThrow(() -> new NoSuchElementException("No hook or step with failed status was found")); |
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.
when this exception may be thrown?
are you catching such exception anywhere?
MemberModifier.field(Step.class, "match").set(step, match); | ||
MemberModifier.field(Match.class, "location").set(match, location); | ||
|
||
MemberModifier.field(Step.class, "before").set(step, |
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.
no need to use try-catch when using Deencapsulation.setField
|
||
Stream<Resultsable> mergeResultsable(Element element) { | ||
Stream<Hook> candidateHooks = concat(stream(element.getBefore()), stream(element.getAfter())); | ||
return concat(candidateHooks, getStepsWithStepHooks(element)); |
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.
sometimes with static import ...
Resultsable[] before = previous.getSteps()[i].getBefore(); | ||
Resultsable[] after = previous.getSteps()[i].getAfter(); | ||
Stream<Resultsable> hooks = concat(stream(before), stream(after)); | ||
stream = Stream.concat(stream, hooks); |
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.
... sometimes not
for (int i = 0; i <= previous.getSteps().length - 1; i++) { | ||
Resultsable[] before = previous.getSteps()[i].getBefore(); | ||
Resultsable[] after = previous.getSteps()[i].getAfter(); | ||
Stream<Resultsable> hooks = concat(stream(before), stream(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.
is it proper to concat before and after ?
} | ||
|
||
@Override | ||
protected void replace(Feature feature, Element[] elements, int i, Element current, int indexOfPreviousResult, |
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.
Works as MERGE_FEATURES_WITH_RETEST reducing method plus marking as FLACKY tests that after rerun were passed. Before merging it checks that scenario was failed and now it's passed and mark it as flacky (add @Flacky tag). Also it gets an exception from firstly failed scenario and sets it to passed scenario in the same step/hook so you can analyze the reason but not to fail test suite. Plus it will also move any attachments to passed scenario in the same step/hook as in firstly failed scenario from firstly failed scenario AFTER HOOK (The common cucumber solution to embed screenshot in after hook if scenario failed)