-
Notifications
You must be signed in to change notification settings - Fork 32
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 TR-5932 branching rules evaluation for non-linear test parts #381
Fix TR-5932 branching rules evaluation for non-linear test parts #381
Conversation
if ( | ||
$ignoreBranchings === false && | ||
$numberOfBranchRules > 0 && | ||
$this->mustApplyBranchRules() || $branchRules->isNonLinearNavigationModeAllowed() |
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.
Just a sanity check.
Did you mean what you've written, or did you mean this instead?
$ignoreBranchings === false &&
$numberOfBranchRules > 0 &&
($this->mustApplyBranchRules() || $branchRules->isNonLinearNavigationModeAllowed())
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.
In either case, I strongly advise using parenthesis (even if the order of logical operations is correct) to emphasize the intended logic.
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.
I agree with you, let me improve that
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.
Oh. So, it was a wrong condition after all?
I mean, what you've applied now is totally different from the original condition where, should $branchRules->isNonLinearNavigationModeAllowed()
be true
the rest of the condition didn't matter.
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.
Now the question is: "why didn't the test cases fail with the original code"?
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.
We probably do not have proper coverage for those conditions. But this is quite a PISA emergency, I am not sure I can cover all the previous missing cases on this PR.
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.
That's fine. Just once again want to be 100%-sure your changes are intentional.
Quick reference of the changes between the two conditions we saw in this PR before and after my comment on this line: https://3v4l.org/G5cLN
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.
Yes, it is intentional, before the ||
operator outside of the parentheses would invalidate all the time all the other rules (which was passing cause of low test coverage), but it only makes sense to pass if other conditions are met too :)
Thanks for the heads up
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.
OK then.
I just didn't realize that from your initial response to my comment.
All clear now.
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.
FYI, $ignoreBranchings
and other parameters for this very method are never passed. They were introduced on 2020, but never used. I will not change them now to avoid inflate the PR, but that is also one of the reasons that condition is not caught on tests
https://oat-sa.atlassian.net/browse/TR-5932
Make branch rules work again between test part with nonlinear navigation
Related PR