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
{{ message }}
Repository navigation
Document that failing test setup stops execution even if continue-on-failure mode is active #4404
When support for controlling the continue-on-failure mode was added (#2285), we didn't think how tests setups should behave when the mode is activated. Currently if you have a test like
*** Test Cases ***Example[Tags] robot:continue-on-failure[Setup] Setup Keyword
Keyword In Body
Another Keyword
and the Setup Keyword fails, keywords in the test body aren't run. That can be considered inconsistent because continue-on-failure mode is explicitly enabled, but I actually like this behavior. You can have some action in setup so that execution ends if it fails, but keywords in the body that are validating that everything went as expected would all be run if the setup succeeds. This would also add some new functionality to setups that are otherwise not really different from normal keywords.
What do others (especially @oboehmer) think about this? Should we stop execution after a failing setup also when continue-on-failure mode is on? If yes, we just need to add some tests for the current behavior and mention this in the User Guide. If not, then we need to change the code as well.
A problem with changing the code is that the change would be backwards incompatible. It's a bit questionable could we do it without a deprecation in RF 5.1 but deprecation adds more work.
If we decide to make setups special so that failures in them stop execution even if continue-on-failure mode is on, it would be a good motivation to add setups for keywords as well. Then with each keyword you could have an "action part" that can make the keyword fail but all validation keywords in the body would be run if the "action part" succeeds. That could be considered surprising/inconsistent if you use robot:recursive-continue-on-failure that is supposed to enable continuability everywhere, but having an opt-out possibility could be convenient. You wouldn't need to use keyword setups if you didn't want that behavior. Anyway, possible keyword setups are a topic for a separate issue.
I asked this also on Slack and everyone there agreed that the current behavior is good. Setups have a somewhat different semantics than normal keywords and always stopping test if a setup fails makes sense. @oboehmer already provided a PR adding tests for the behavior as well as documenting it in the User Guide.
changed the title [-]Decide how test setup should behave when continue-on-failure mode is active[/-][+]Document that failing test setup stops execution even if continue-on-failure mode is active[/+]on Jul 14, 2022
Activity
pekkaklarck commentedon Jul 14, 2022
If we decide to make setups special so that failures in them stop execution even if continue-on-failure mode is on, it would be a good motivation to add setups for keywords as well. Then with each keyword you could have an "action part" that can make the keyword fail but all validation keywords in the body would be run if the "action part" succeeds. That could be considered surprising/inconsistent if you use
robot:recursive-continue-on-failurethat is supposed to enable continuability everywhere, but having an opt-out possibility could be convenient. You wouldn't need to use keyword setups if you didn't want that behavior. Anyway, possible keyword setups are a topic for a separate issue.Document and test that failing setups stops test even if continue-on-…
pekkaklarck commentedon Jul 14, 2022
I asked this also on Slack and everyone there agreed that the current behavior is good. Setups have a somewhat different semantics than normal keywords and always stopping test if a setup fails makes sense. @oboehmer already provided a PR adding tests for the behavior as well as documenting it in the User Guide.
[-]Decide how test setup should behave when continue-on-failure mode is active[/-][+]Document that failing test setup stops execution even if continue-on-failure mode is active[/+]