-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
pekkaklarck
merged 43 commits into
robotframework:master
from
oboehmer:2285-continue-tag
Jun 24, 2021
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
a2d666c
allow test case to continue on failure based on tag
oboehmer dc8f9d7
fix test to check for log
oboehmer d2ccc34
remove redundant var assignment
oboehmer 7619435
minor cleanup
oboehmer 2d129ce
added robot:continue-on-failure for loops
oboehmer 51fe90a
add tags attribute to BodyRunner object, this fixes keyword tags
oboehmer 0552cd3
move tests into new suite
oboehmer 5a27dda
merge test and user kw tags before run
oboehmer 4c1c127
add _tags to ForInRunner object used for continue-on-failure handling
oboehmer d99306e
cosmetic cleanup
oboehmer 89bde5b
additional test cases for for loop
oboehmer 9c23912
added more test cases
oboehmer 5b4c052
allow continuable failures to continue even if robot:no-continue-on-f…
oboehmer eb3690c
add documentation
oboehmer 531964a
Merge branch 'master' into 2285-continue-tag
oboehmer 0f16b72
Merge remote-tracking branch 'upstream/master' into 2285-continue-tag
oboehmer d4a24ea
align ForInRunner signature to Bodyrunner's
oboehmer f3b2f48
cosmetic changes to tests
oboehmer ebe9f5a
minor doc correction
oboehmer c9453cd
another minor doc correction
oboehmer 6878199
reformat according to black guideline
oboehmer e37d4ad
documented the behaviour that no-continue-on-failure does not change …
oboehmer 0293f8c
Merge branch 'master' into 2285-continue-tag
oboehmer d59aa9e
cosmetic/naming changes
oboehmer e1e1d3e
Merge branch 'master' into 2285-continue-tag
oboehmer 26c3166
Address review comments
oboehmer 84573ee
updated docs
oboehmer 9c0e7f2
Merge branch '2285-continue-tag' of github.com:oboehmer/robotframewor…
oboehmer c5952a8
refactor implementation to leverage context instead of tags in Runners
oboehmer 03ca263
change user_keyword signature
oboehmer a16fb7f
simplify errors.can_continue() signature
oboehmer 4f3bb73
change var name in continue_on_failure
oboehmer b67c780
introduce recursive behaviour with dedicated -recursive tag
oboehmer c13d1cf
suppress internal tags to not show by default
oboehmer 26130f7
add integration tests and docs for internal tag suppression
oboehmer 9b3f83b
cosmetic naming change of suppress logic
oboehmer 49d1d5b
document recursive behaviour
oboehmer b72ad12
add tests to verify set tags functionality
oboehmer 4bc2f88
test commit
oboehmer 36902f5
test changes as per review comments
oboehmer c27f3cb
doc changes as per review comments
oboehmer c7a1491
minor code changes as per review comments
oboehmer 7013791
reverted back to non-dash notation in doc
oboehmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
*** Settings *** | ||
Suite Setup Run Tests ${EMPTY} running/continue_on_failure_tag.robot | ||
Resource atest_resource.robot | ||
|
||
*** Test Cases *** | ||
Continue in test with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in test with Set Tags | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in user keyword with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in test with tag and UK without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in test with tag and nested UK with and without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in test with tag and two nested UK with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in FOR loop with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in FOR loop with Set Tags | ||
Check Test Case ${TESTNAME} | ||
|
||
No continue in FOR loop without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in FOR loop in UK with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in FOR loop in UK without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in IF with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in IF with set and remove tag | ||
Check Test Case ${TESTNAME} | ||
|
||
No continue in IF without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in IF in UK with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
No continue in IF in UK without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Continue in Run Keywords with tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Recursive continue in test with tag and two nested UK without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Recursive continue in test with Set Tags and two nested UK without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Recursive continue in test with tag and two nested UK with and without tag | ||
Check Test Case ${TESTNAME} | ||
|
||
Recursive continue in user keyword | ||
Check Test Case ${TESTNAME} | ||
|
||
No recursive continue in user keyword | ||
Check Test Case ${TESTNAME} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,263 @@ | ||
*** Variables *** | ||
${HEADER} Several failures occurred: | ||
|
||
*** Test Cases *** | ||
Continue in test with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) 1\n\n | ||
... 2) 2 | ||
[Tags] robot:continue-on-failure | ||
Fail 1 | ||
Fail 2 | ||
Log This should be executed | ||
|
||
Continue in test with Set Tags | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) 1\n\n | ||
... 2) 2 | ||
Set Tags robot:continue-on-failure | ||
Fail 1 | ||
Fail 2 | ||
Log This should be executed | ||
|
||
Continue in user keyword with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw1a\n\n | ||
... 2) kw1b | ||
Failure in user keyword with tag | ||
Fail This should not be executed | ||
|
||
Continue in test with tag and UK without tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw2a\n\n | ||
... 2) This should be executed | ||
[Tags] robot:continue-on-failure | ||
Failure in user keyword without tag | ||
Fail This should be executed | ||
|
||
Continue in test with tag and nested UK with and without tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw1a\n\n | ||
... 2) kw1b\n\n | ||
... 3) kw2a\n\n | ||
... 4) This should be executed | ||
[Tags] robot:continue-on-failure | ||
Failure in user keyword with tag run_kw=Failure in user keyword without tag | ||
Fail This should be executed | ||
|
||
Continue in test with tag and two nested UK with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw1a\n\n | ||
... 2) kw1b\n\n | ||
... 3) kw1a\n\n | ||
... 4) kw1b\n\n | ||
... 5) This should be executed | ||
[Tags] robot:continue-on-failure | ||
Failure in user keyword with tag run_kw=Failure in user keyword with tag | ||
Fail This should be executed | ||
|
||
Continue in FOR loop with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) loop-1\n\n | ||
... 2) loop-2\n\n | ||
... 3) loop-3 | ||
[Tags] robot:continue-on-failure | ||
FOR ${val} IN 1 2 3 | ||
Fail loop-${val} | ||
END | ||
|
||
Continue in FOR loop with Set Tags | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) loop-1\n\n | ||
... 2) loop-2\n\n | ||
... 3) loop-3 | ||
FOR ${val} IN 1 2 3 | ||
Set Tags robot:continue-on-failure | ||
Fail loop-${val} | ||
END | ||
|
||
No continue in FOR loop without tag | ||
[Documentation] FAIL loop-1 | ||
FOR ${val} IN 1 2 3 | ||
Fail loop-${val} | ||
END | ||
|
||
Continue in FOR loop in UK with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw-loop-1\n\n | ||
... 2) kw-loop-2\n\n | ||
... 3) kw-loop-3 | ||
FOR loop in in user keyword with tag | ||
|
||
Continue in FOR loop in UK without tag | ||
[Documentation] FAIL kw-loop-1 | ||
FOR loop in in user keyword without tag | ||
|
||
Continue in IF with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) 1\n\n | ||
... 2) 2\n\n | ||
... 3) 3\n\n | ||
... 4) 4 | ||
[Tags] robot:continue-on-failure | ||
IF 1==1 | ||
Fail 1 | ||
Fail 2 | ||
END | ||
IF 1==2 | ||
No Operation | ||
ELSE | ||
Fail 3 | ||
Fail 4 | ||
END | ||
|
||
Continue in IF with set and remove tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) 1\n\n | ||
... 2) 2\n\n | ||
... 3) 3 | ||
Set Tags robot:continue-on-failure | ||
IF 1==1 | ||
Fail 1 | ||
Fail 2 | ||
END | ||
Remove Tags robot:continue-on-failure | ||
IF 1==2 | ||
No Operation | ||
ELSE | ||
Fail 3 | ||
Fail this is not executed | ||
END | ||
|
||
No continue in IF without tag | ||
[Documentation] FAIL 1 | ||
IF 1==1 | ||
Fail 1 | ||
Fail This should not be executed | ||
END | ||
|
||
Continue in IF in UK with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw1a\n\n | ||
... 2) kw1b\n\n | ||
... 3) kw1c\n\n | ||
... 4) kw1d | ||
IF in user keyword with tag | ||
|
||
No continue in IF in UK without tag | ||
[Documentation] FAIL kw1a | ||
IF in user keyword without tag | ||
|
||
Continue in Run Keywords with tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) 1\n\n | ||
... 2) 2 | ||
[Tags] robot:continue-on-failure | ||
Run Keywords Fail 1 AND Fail 2 | ||
|
||
Recursive continue in test with tag and two nested UK without tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw2a\n\n | ||
... 2) kw2b\n\n | ||
... 3) kw2a\n\n | ||
... 4) kw2b\n\n | ||
... 5) This should be executed | ||
[Tags] robot:continue-on-failure-recursive | ||
Failure in user keyword without tag run_kw=Failure in user keyword without tag | ||
Fail This should be executed | ||
|
||
Recursive continue in test with Set Tags and two nested UK without tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw2a\n\n | ||
... 2) kw2b\n\n | ||
... 3) kw2a\n\n | ||
... 4) kw2b\n\n | ||
... 5) This should be executed | ||
Set Tags robot:continue-on-failure-recursive | ||
Failure in user keyword without tag run_kw=Failure in user keyword without tag | ||
Fail This should be executed | ||
|
||
Recursive continue in test with tag and two nested UK with and without tag | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw1a\n\n | ||
... 2) kw1b\n\n | ||
... 3) kw2a\n\n | ||
... 4) kw2b\n\n | ||
... 5) This should be executed | ||
[Tags] robot:continue-on-failure-recursive | ||
Failure in user keyword with tag run_kw=Failure in user keyword without tag | ||
Fail This should be executed | ||
|
||
Recursive continue in user keyword | ||
[Documentation] FAIL ${HEADER}\n\n | ||
... 1) kw1a\n\n | ||
... 2) kw1b\n\n | ||
... 3) kw2a\n\n | ||
... 4) kw2b | ||
Failure in user keyword with recursive tag run_kw=Failure in user keyword without tag | ||
Fail This should not be executed | ||
|
||
No recursive continue in user keyword | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
[Documentation] FAIL kw2a | ||
Failure in user keyword without tag run_kw=Failure in user keyword with recursive tag | ||
Fail This should not be executed | ||
|
||
*** Keywords *** | ||
|
||
Failure in user keyword with tag | ||
[Arguments] ${run_kw}=No Operation | ||
oboehmer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[Tags] robot:continue-on-failure | ||
Fail kw1a | ||
Fail kw1b | ||
Log This should be executed | ||
Run Keyword ${run_kw} | ||
|
||
Failure in user keyword without tag | ||
[Arguments] ${run_kw}=No Operation | ||
Fail kw2a | ||
Fail kw2b | ||
Run Keyword ${run_kw} | ||
|
||
Failure in user keyword with recursive tag | ||
[Arguments] ${run_kw}=No Operation | ||
[Tags] robot:continue-on-failure-recursive | ||
Fail kw1a | ||
Fail kw1b | ||
Log This should be executed | ||
Run Keyword ${run_kw} | ||
|
||
FOR loop in in user keyword with tag | ||
[Tags] robot:continue-on-failure | ||
FOR ${val} IN 1 2 3 | ||
Fail kw-loop-${val} | ||
END | ||
|
||
FOR loop in in user keyword without tag | ||
FOR ${val} IN 1 2 3 | ||
Fail kw-loop-${val} | ||
END | ||
|
||
IF in user keyword with tag | ||
[Tags] robot:continue-on-failure | ||
IF 1==1 | ||
Fail kw1a | ||
Fail kw1b | ||
END | ||
IF 1==2 | ||
No Operation | ||
ELSE | ||
Fail kw1c | ||
Fail kw1d | ||
END | ||
|
||
IF in user keyword without tag | ||
IF 1==1 | ||
Fail kw1a | ||
Fail kw1b | ||
END | ||
IF 1==2 | ||
No Operation | ||
ELSE | ||
Fail kw1c | ||
Fail kw1d | ||
END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*** Settings *** | ||
Force Tags force | ||
Force Tags force robot:just-an-example | ||
|
||
*** Test Cases *** | ||
Incl-1 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.