Skip to content

"Run Keyword .*" not considering SKIP #3755

Closed

Description

@adiralashiva8

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

Activity

  1. mkorpela commented on Nov 16, 2020

    @mkorpela
    Member

    @adiralashiva8 thank you for the report!

  2. added this to the v4.0 milestone on Nov 18, 2020
  3. pekkaklarck commented on Nov 18, 2020

    @pekkaklarck
    Member

    We have two ways how to handle skip with these keywords:

    1. 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.

    2. 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?

  4. pekkaklarck commented on Nov 18, 2020

    @pekkaklarck
    Member

    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.

  5. pekkaklarck commented on Nov 18, 2020

    @pekkaklarck
    Member

    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!

  6. boakley commented on Nov 18, 2020

    @boakley
  7. pekkaklarck commented on Nov 24, 2020

    @pekkaklarck
    Member

    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.

  8. self-assigned this
    on Nov 26, 2020
  9. added a commit that references this issue on Dec 27, 2020
    de6c8b5
  10. added
    no notes
    and removed on Dec 9, 2025
  11. added theissue type on Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

beta 1no notespriority: high

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions