Skip to content

Add robot:stop-on-failure / recursive-stop-on-failure to disable continue-on-failure in teardown/template - #4313

Merged
pekkaklarck merged 18 commits into
robotframework:masterfrom
oboehmer:4303-stop-on-failure
Jun 9, 2022
Merged

pekkaklarck merged 18 commits into
robotframework:masterfrom
oboehmer:4303-stop-on-failure

Conversation

@oboehmer

Copy link
Copy Markdown
Contributor

This PR adds two new tags to control the continue-on-failure behaviour in teardown or test template, addressing #4303

@pekkaklarck pekkaklarck left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but there seems to be a bug in handling nested usage of robot:recursive-continue-on-failure and robot:recursive-stop-on-failure. Handling situation where these tags are set in test level when failure occurs in teardown could possibly be changed as well.

I didn't look at the tests yet. Changes above require changes to them anyway.

This feature will also need documentation.

Comment thread src/robot/running/context.py Resolved
Comment thread src/robot/running/context.py Resolved
Comment thread src/robot/errors.py Resolved
@oboehmer
oboehmer requested a review from pekkaklarck June 1, 2022 13:50
Comment thread src/robot/running/context.py Resolved
Comment thread src/robot/running/context.py Resolved
oboehmer added 3 commits June 2, 2022 19:21
- continuable kws are not impacted by stop-on-failure
- move check for teardown context into context.continue_on_failure()
- adjust tests
@oboehmer
oboehmer requested a review from pekkaklarck June 3, 2022 11:24

The `robot:stop-on-failure` and its recursive variant
`robot:recursive-stop-on-failure` can also be used to alter
the default continue behavior of Teardowns and Templates:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming suitable sections exist, it would be good to add links to sections about teardowns and templates.

@oboehmer oboehmer Jun 8, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.. it reads a bit strange, though.. not sure if rst allows something like[text](link)

@pekkaklarck

Copy link
Copy Markdown
Member

Latest changes look great! My (hopefully) final comments/questions:

  1. Are there tests for the nested continue/stop usage? For example, setting recursive-continue-on-failure on test level and then later overriding it with (recursive-)stop-on-failure? There are many tests but I didn't notice one covering this.
  2. Related the above, test names could possibly be enhanced a bit to make it easier to see what's actually tested by looking at tests on atest/robot side. Perhaps the somewhat large suite could also be split into smaller pieces. I know it's hard to keep tests easy to understand when there are so many of them!
  3. I added some comments about the documentation. Hopefully you can take a look at them.

@pekkaklarck
pekkaklarck merged commit bb1dee7 into robotframework:master Jun 9, 2022
@pekkaklarck

Copy link
Copy Markdown
Member

Huge thanks for a great PR @oboehmer!

@oboehmer
oboehmer deleted the 4303-stop-on-failure branch June 9, 2022 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants