You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following keywords are not considering SKIP status:
Run Keyword And Expect Error
Run Keyword And Return Status
Run Keyword And Ignore Error
Wait Until Keyword Succeeds
Examples:
*** Test Cases ***
Run Keyword And Expect Error With Skip
Run Keyword And Expect Error
... Expectation: Terminate execution Skip Expectation: Terminate execution
Log Expectation: Dont execute this step on SKIP
Run Keyword And Ignore Error With Skip
Run Keyword And Ignore Error
... Skip Expectation: Terminate execution
Log Expectation: Dont execute this step on SKIP
Run Keyword And Return Status With Skip
Run Keyword And Return Status
... Skip Expectation: Terminate execution
Log Expectation: Dont execute this step on SKIP
Wait Until Keyword Succeeds With Skip
Wait Until Keyword Succeeds 3x 1s
... Skip Expectation: Terminate execution without retry
Log Expectation: Dont execute this step on SKIP
We have two ways how to handle skip with these keywords:
Propagate skip through so that the test ends up being skipped. In other words, these keywords wouldn't catch skip exceptions at all. We already use the same logic with syntax errors.
Catch skip and return status so that SKIP is separate from PASS and FAIL.
The example in the original description indicates that skip should be propagated, but my current feeling is that the latter approach would be better. Do you @adiralashiva8 have use cases for propagation? What do others feel about this?
If we decide to propagate skip, then we don't need to do other design decisions. We just need to change the logic to detect when to continue with these keywords and update documentation to mention that skip is not caught.
If we decide to catch skip, then we need to decide to handle it with each keyword. I think it could go like this:
Run Keyword And Ignore Error: This keyword returns a tuple (status, result_or_error) where the status is either PASS or FAIL. It can be easily enhanced to return SKIP as well and in that case the second returned item should be the message.
Run Keyword And Return Status: This keyword returns just True (PASS) or False (FAIL) and it could return None with SKIP. It used Run Keyword And Ignore Error internally and could be trivially updated if that keyword is enhanced first.
Run Keyword And Expect Error: This keyword expects that the executed keyword fails and also validates the error message. It could work so that it catches also SKIP and check the message as normally. It probably actually works like that nowadays but it would nevertheless need a test.
Wait Until Keyword Succeeds: This keyword keeps executing the executed keyword until it succeeds (or a timeout occurs). We can argue that SKIP doesn't mean succeeding and it should keep trying. That's probably how it already works but it would need to be tested.
I think the biggest question here is how to handle a situation where you expect a certain exception with Run Keyword And Expect Error but instead you get skip. If we propagate skip, the validation isn't done and test is skipped. That may be bad if it was an important validation, but on the other hand the skip may be intentional and failing the test may be bad as well. Luckily this ought to be a rather rare situation so the decision shouldn't matter that much. Now it's a good time to voice your opinion if you feel strongly either way!
I think the guiding principle should be that SKIP is never treated as an
error. Any keywords that expect or ignore or wait on errors should not be
treating a SKIP as an error.
On Wed, Nov 18, 2020 at 5:32 AM Pekka Klärck ***@***.***> wrote:
I think the biggest question here is how to handle a situation where you
expect a certain exception with Run Keyword And Expect Error but instead
you get skip. If we propagate skip, the validation isn't done and test is
skipped. That may be bad if it was an important validation, but on the
other hand the skip may be intentional and failing the test may be bad as
well. Luckily this ought to be a rather rare situation so the decision
shouldn't matter that much. Now it's a good time to voice your opinion if
you feel strongly either way!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3755 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAISMYQJYIQU3VISZ2ECXR3SQOWEZANCNFSM4TJ7BBZA>
.
I discussed with @yanne and we agreed that skip exceptions will be propagated. That's also what the original description and the comment by @boakley propose.
Activity
mkorpela commentedon Nov 16, 2020
@adiralashiva8 thank you for the report!
pekkaklarck commentedon Nov 18, 2020
We have two ways how to handle skip with these keywords:
Propagate skip through so that the test ends up being skipped. In other words, these keywords wouldn't catch skip exceptions at all. We already use the same logic with syntax errors.
Catch skip and return status so that SKIP is separate from PASS and FAIL.
The example in the original description indicates that skip should be propagated, but my current feeling is that the latter approach would be better. Do you @adiralashiva8 have use cases for propagation? What do others feel about this?
pekkaklarck commentedon Nov 18, 2020
If we decide to propagate skip, then we don't need to do other design decisions. We just need to change the logic to detect when to continue with these keywords and update documentation to mention that skip is not caught.
If we decide to catch skip, then we need to decide to handle it with each keyword. I think it could go like this:
Run Keyword And Ignore Error: This keyword returns a tuple(status, result_or_error)where the status is either PASS or FAIL. It can be easily enhanced to return SKIP as well and in that case the second returned item should be the message.Run Keyword And Return Status: This keyword returns justTrue(PASS) orFalse(FAIL) and it could returnNonewith SKIP. It usedRun Keyword And Ignore Errorinternally and could be trivially updated if that keyword is enhanced first.Run Keyword And Expect Error: This keyword expects that the executed keyword fails and also validates the error message. It could work so that it catches also SKIP and check the message as normally. It probably actually works like that nowadays but it would nevertheless need a test.Wait Until Keyword Succeeds: This keyword keeps executing the executed keyword until it succeeds (or a timeout occurs). We can argue that SKIP doesn't mean succeeding and it should keep trying. That's probably how it already works but it would need to be tested.pekkaklarck commentedon Nov 18, 2020
I think the biggest question here is how to handle a situation where you expect a certain exception with
Run Keyword And Expect Errorbut instead you get skip. If we propagate skip, the validation isn't done and test is skipped. That may be bad if it was an important validation, but on the other hand the skip may be intentional and failing the test may be bad as well. Luckily this ought to be a rather rare situation so the decision shouldn't matter that much. Now it's a good time to voice your opinion if you feel strongly either way!boakley commentedon Nov 18, 2020
pekkaklarck commentedon Nov 24, 2020
I discussed with @yanne and we agreed that skip exceptions will be propagated. That's also what the original description and the comment by @boakley propose.
Skip: propagate skip throuh run keyword variants