Skip to content

Enable continuable failures via robot:continue-on-failure test or kw tag #3925

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

Merged
merged 43 commits into from
Jun 24, 2021

Conversation

oboehmer
Copy link
Contributor

@oboehmer oboehmer commented Apr 7, 2021

This PR implements one of the features in #2285 , the ability to control continuable failures via test or keyword tags.
We introduce robot:continue-on-failure as a test or user-keyword tag to denote all failures within the test (and within all user keywords executed within) or within a user-keyword to be continuable.

@oboehmer oboehmer closed this Apr 7, 2021
@oboehmer oboehmer changed the title 2285 continue tag Enable continuable failures via robot:continue-on-failure test or kw tag Apr 11, 2021
@oboehmer
Copy link
Contributor Author

Finished with the code, please review, @pekkaklarck

@oboehmer oboehmer reopened this Apr 11, 2021
@codecov-io
Copy link

codecov-io commented Apr 11, 2021

Codecov Report

Merging #3925 (e37d4ad) into master (f726539) will decrease coverage by 0.07%.
The diff coverage is 61.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3925      +/-   ##
==========================================
- Coverage   75.15%   75.09%   -0.06%     
==========================================
  Files         222      222              
  Lines       18816    18831      +15     
  Branches     3076     3079       +3     
==========================================
- Hits        14140    14139       -1     
- Misses       4148     4157       +9     
- Partials      528      535       +7     
Impacted Files Coverage Δ
src/robot/errors.py 65.15% <20.00%> (-1.52%) ⬇️
src/robot/running/bodyrunner.py 36.83% <60.00%> (+0.11%) ⬆️
src/robot/running/userkeywordrunner.py 57.36% <80.00%> (+0.95%) ⬆️
src/robot/running/suiterunner.py 76.93% <100.00%> (ø)
src/robot/utils/robotinspect.py 47.62% <0.00%> (-19.04%) ⬇️
src/robot/version.py 55.56% <0.00%> (-11.11%) ⬇️
src/robot/libdocpkg/datatypes.py 94.57% <0.00%> (-1.08%) ⬇️
src/robot/utils/importer.py 83.81% <0.00%> (-0.95%) ⬇️
src/robot/libdocpkg/robotbuilder.py 87.21% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f726539...e37d4ad. Read the comment docs.

@oboehmer
Copy link
Contributor Author

@pekkaklarck , I understand you're now looking at 4.1 features. Would you consider this one to be part of 4.1? Please let me know what you think of the approach and the implementation.

main discussion point is how to treat continuable keywords in such a scenario:

*** test Cases ***
test
    [Tags]    robot:no-continue-on-failure
    Run Keyword and Continue on Failure    Should be Equal   3   4
    Log to console     continued

I feel we should still continue, i.e. not change the semantic of continuable keywords.

@pekkaklarck
Copy link
Member

Yeah, this definitely fits well for RF 4.1. Tuesday we'll have one week from RF 4.0.3 and I believe that's enough time to see are there new critical regressions. That means we can start RF 4.1 work for real. I have a training course on Tuesday, though, so most likely it'll be Wednesday before I really get started.

@codecov-commenter
Copy link

codecov-commenter commented Jun 19, 2021

Codecov Report

Merging #3925 (e1e1d3e) into master (c53f34e) will decrease coverage by 0.06%.
The diff coverage is 61.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3925      +/-   ##
==========================================
- Coverage   75.11%   75.05%   -0.05%     
==========================================
  Files         222      222              
  Lines       18840    18855      +15     
  Branches     3083     3086       +3     
==========================================
  Hits        14150    14150              
- Misses       4163     4172       +9     
- Partials      527      533       +6     
Impacted Files Coverage Δ
src/robot/errors.py 65.15% <20.00%> (-1.52%) ⬇️
src/robot/running/bodyrunner.py 36.83% <60.00%> (+0.11%) ⬆️
src/robot/running/userkeywordrunner.py 57.36% <80.00%> (+0.95%) ⬆️
src/robot/running/suiterunner.py 76.93% <100.00%> (ø)
src/robot/utils/robotinspect.py 47.62% <0.00%> (-19.04%) ⬇️
src/robot/version.py 55.56% <0.00%> (-11.11%) ⬇️
src/robot/utils/importer.py 83.81% <0.00%> (-0.95%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc57664...e1e1d3e. Read the comment docs.

Copy link
Member

@pekkaklarck pekkaklarck left a comment

Choose a reason for hiding this comment

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

I only looked at code at this point and it mostly looks pretty good. For things that should still be changed see individual comments.

The main problem now is that we apparently haven't yet agreed on how to handle nested robot:continue-on-failure usage (see my comment to issue #2285). The current implementation gets the default value from the test case, but doesn't look at possible parent user keywords. I think that's a bit odd and we either should either look at all parents or none. This might be best to discuss further on Slack and once we have agreed on the design then document it here and in comments of #2285.

Copy link
Member

@pekkaklarck pekkaklarck left a comment

Choose a reason for hiding this comment

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

Awesome work with code, tests and docs! I added several comments about various smallish things that can still be enhanced but this now looks really good.

@@ -199,16 +197,16 @@ Recursive Continue in test without tag and two nested UK with and without recurs
Failure in user keyword with recursive tag run_kw=Failure in user keyword without tag
Fail This should not be executed

Recursive Continue in test without tag and two nested UK without and with recursive tag
No recursive continue in user keyword
Copy link
Member

Choose a reason for hiding this comment

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

Is this name accurate? Doesn't the test validate recursive continue works also with nested keywords?

@pekkaklarck pekkaklarck merged commit 5fa06d1 into robotframework:master Jun 24, 2021
pekkaklarck added a commit that referenced this pull request Jun 24, 2021
Code in master was changed to fix #3398 before merging #3925 in a way
that caused this failure.
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.

4 participants