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
There have been several requests to be able to mark tests skipped: #812, #837, #964, #1732, #2064. Some of them use different term than skip (e.g. warn or blacklist) but the basic idea is similar.
So far all such requests have been rejected because Robot Framework already has a concept of non-critical tests and non-critical failures with a clear error message can be used to emulate skipping. I'm not inherently against skipping, though, and see that explicit SKIP status would often be more clear than non-critical FAIL. Many other test tool also has such status and being compatible with them would be nice.
I'm not planning to implement this functionality in the foreseeable future, but I wanted to open an issue about it to have a place where to discuss it. The main problem with implementation is that it would be quite a big task. The first step would be designing how the functionality actually should work. At least these things should be taken into account:
How to mark a test skipped. Possibilities include:
Based on tags from the command line.
Using a BuiltIn keyowrd.
Using a custom exception in a test library.
How skipped tests affect statistics?
How skipped tests affect overall execution result? What should the report background be if there are passed and skipped tests in a suite? What if there are only skipped?
I encourage people interested about the skip status to comment here or possibly start a discussion on the robotframework-users mailing list or on the new Slack community. If we can agree with the overall design, someone can then start actually implementing the functionality.
Reacted by Timo Stollenwerk, Windel Bouwman, Selena, Moritz 'Morty' Strübe, f46io, Sergey Batalov and Alexey Kazancev
I have a need for this 'SKIPPED' status. This happen when robot is hooked with test case management system (TCMS) when executing a test run and some cases have already 'PASSED'; therefore, no need to run that particular cases anymore; thus, robot should mark as 'SKIPPED'
In my case BuiltIn keyword is needed due to its flexibility. If it was a custom exception, I wonder if external libraries can 'raise' that.
I think the simplest solution is a built-in keyword (eg: Skip test), which works via a custom exception that can also be used by libraries.
Then, I would add another column in the statistics so we now have Total (including skipped), Pass, Fail, and Skipped. Beyond that, skipped tests shouldn't affect anything else -- they don't change the color, don't change the overall status, etc.
Reacted by sebastianciupinski and Chandra Sekhar Pola
I completely agree with boakley above in the way I would like this to work.
There are 2 things to address in the solution when I compile in my mind what
the user community is asking. Namely first skipping a testcase, second reporting.
Skipping the testcase is the real important part, that’s the functionality users want.
:It would be nice if the status of the testcases were reported as SKIP, but that is not
100% necessary. What I mean is, at the very minimum, implement the ability to skip
a testcase via being able to call a keyword from *** Settings *** within an init.py,
a testcase.txt, a resource.txt file or a libray.py file. The point being the decision to skip or
not is made and taken before the actual testcase starts. In sudo code this would look like this:
Hence if the testcase can be prevented from actually starting (hence totally skipped)
then result reporting does not need to change because the test should not even by
executed/run (hence behave as if its Tags did not match the selection etc.). This would
then allow users to dynamically skip tests and this part would not be that difficult to
anyone who is familiar with the robot source.
This to me would be perfectly acceptable as the PASS/FAIL counts would be consistent
and so a Development & Regression team could make software release decisions to
ship once a percentage ‘%’ rate is achieved. Managers (Development or Regression teams)
are not interested in how many tests were skipped, only the PASS/FAIL rate. If an Engineer
wants to know if a testcase was skipped then they could check the report, log etc.
If you are going to support reporting skipped testcases, then again as boakley stated above, e.g.
“add another column in the statistics so we now have Total (including skipped), Pass, Fail, and Skipped. Beyond that, skipped tests shouldn't affect anything else -- they don't change the colour, don't change the overall status, etc.”
If you would lie any clarity or for me to expand on this I will do all I can to help.
I would love this functionality ASAP.
I’m willing to be an Alpha/Beta tester for this.
Regards,
Doug
Reacted by Royalyn Gifty, sebastianciupinski and Akos Medgyesi
The changes I would like to proposed in this pull request are to add support for skipping testcases
via the use of a new keyword ‘Skip Execution’. Additionally support for a command line option --skip has been added. The --skip option works like the --exclude option except that tests are shown
in the statistics. Finally support has been added for a special attribute ROBOT_SKIP_ON_FAILURE
on exceptions to mark tests skipped. This is consistent with continuable and fatal failures
(ROBOT_CONTINUE_ON_FAILURE and ROBOT_EXIT_ON_FAILURE) and simplifies logic at the test case
level.
I have fixed up all the unit tests (under the utest directory), they all pass successfully, e.g.
debian@debian:/usr/local/lib/python2.7/dist-packages/robotframework-GITHUB/utest$ sudo ./run.py
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 1475 tests in 5.708s
OK
debian@debian:/usr/local/lib/python2.7/dist-packages/robotframework-GITHUB/utest$
I have also update the source code documentation for the --skip option (under the doc directory).
I have created 5 example/demo testcase files to demonstrate the use of the ‘Skip Execution’ keyword and --skip option.
Example/demo Testcase Files: TEST_SKIP.txt
*** Settings ***
Documentation
... Objective: Test Skipped Testcase Reporting
...
Library BuiltIn
Default Tags smoke_test
*** Keywords ***
Skip Test
Set Test Variable ${release} R1
Run Keyword If '${release}' == 'R1'
... Skip Execution Skipping Testcase (it is not relevant to this image)
*** Test Cases ***
Test_Skip
# Check if Testcase is Relevant (should be skipped)
# -------------------------------------------------
Skip Test
Log ===========> *** RUNNING TEST_SKIP *** <===========
TEST_SKIP_STATIC_TAG.txt
*** Settings ***
Documentation
... Objective: Test Skipped Static Tag Testcase Reporting
...
Library BuiltIn
Default Tags smoke_test my_skip
*** Test Cases ***
Test_Skip_Static_Tag
# Run the testcase
# ----------------
Log ===========> *** RUNNING TEST_SKIP_STATIC_TAG *** <===========
TEST_SKIP_DYNAMIC_TAG.txt
*** Settings ***
Documentation
... Objective: Test Skipped Testcase Reporting
...
Library BuiltIn
Default Tags smoke_test
*** Test Cases ***
Test_Skip_Dynamic_Tag
[Tags] my_skip
# Run the testcase
# ----------------
Log ===========> *** RUNNING TEST_SKIP_DYNAMIC_TAG *** <===========
TEST_PASS.txt
*** Settings ***
Documentation
... Objective: Test Passed Testcase Reporting
...
Library BuiltIn
Default Tags smoke_test
*** Keywords ***
Skip Test
Set Test Variable ${release} R2
Run Keyword If '${release}' == 'R1'
... Skip Execution Skipping Testcase (it is not relevant to this image)
*** Test Cases ***
Test_Pass
# Check if Testcase is Relevant (should be skipped)
# -------------------------------------------------
Skip Test
Log ===========> *** RUNNING TEST_PASS *** <===========
TEST_FAIL.txt
*** Settings ***
Documentation
... Objective: Test Failed Testcase Reporting
...
Library BuiltIn
Default Tags smoke_test
*** Test Cases ***
Test_Fail
Log ===========> *** RUNNING TEST_FAIL *** <===========
# Force a testcase failure
Set Test Variable ${result} FORCE_FAILURE
Should Be Equal ${result} Passed
Issues
I have this working 99.9%. There are two small issues remaining that I have not been able to address.
Issue 1:
How to fix up the file below for adding ROBOT_SKIP_ON_FAILURE support.
atest/robot/output/html_output_stats.py
Issue 2:
The --skip option works exactly like the --exclude option at present. I do not quite understand how
to show the skipped tests in the statistics when the --skip option is used. Skipped tests via the keyword
‘Skip Execution’ are sown in the statistics, but I do not know how to show the tests skipped via the --skip option in the statistics.
Issue 3:
The final issue remaining that I have not been able to address is the case when a critical testcase is
skipped the console output is correct, however the HTML report is classifying a SKIP result as a critical failure (i.e. in the HTML report it states for example 'Status: 1 critical test failed'). I have
figured out (I think) that this needs to be fixed in the file in src/robot/htmldata/rebot/testdata.js
in the code block below. However I cannot figure out what exactly is in ‘stats’. My Jython is not good
– for now. This code block needs to not consider a SKIP result as a failure. Fix this and it will fix the
HTML reporting for critical testcases with SKIP results.
If you or anyone on the robot developers team can help me with this then I’ll do all I can to
incorporate this in this pull request. Alternatively if you would like to simply take my changes and address this issue in the team then I am more than happy with this. My interest is in getting this implemented and released to help my company and the wider user community here.
Regards,
Doug
Testing Results
Below are test runs using the above example/demo files. I’ve included console outputs and screen
shots of the HTML reports generated for the runs.
TEST: Skip Test Non Critical
debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP --include smoke_test -n smoke_test tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite
====================================================================================================================================================================================
Skip Tests.TEST SKIP :: Objective: Test Skipped Testcase Reporting
====================================================================================================================================================================================
Test_Skip | SKIP |
Skipping Testcase (it is not relevant to this image)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST SKIP :: Objective: Test Skipped Testcase Reporting | SKIP |
1 critical test, 0 passed, 0 failed, 1 skipped
1 test total, 0 passed, 0 failed, 1 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite | SKIP |
1 critical test, 0 passed, 0 failed, 1 skipped
1 test total, 0 passed, 0 failed, 1 skipped
====================================================================================================================================================================================
Debug: /home/debian/work/auto/debug.txt
Output: /home/debian/work/auto/output.xml
Log: /home/debian/work/auto/log.html
Report: /home/debian/work/auto/report.html
debian@debian:~/work/auto$
debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_STATIC_TAG --include smoke_test -n smoke_test --skip my_skip tests/skip_tests/
[ ERROR ] Suite 'Skip Tests' contains no tests with tag 'smoke test' and without tag 'my skip' in suite 'TEST_SKIP_STATIC_TAG'.
Try --help for usage information.
debian@debian:~/work/auto$
debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_DYNAMIC_TAG --include smoke_test -n smoke_test --skip my_skip tests/skip_tests/
[ ERROR ] Suite 'Skip Tests' contains no tests with tag 'smoke test' and without tag 'my skip' in suite 'TEST_SKIP_DYNAMIC_TAG'.
Try --help for usage information.
debian@debian:~/work/auto$
debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_STATIC_TAG --include smoke_test --skip my_skip tests/skip_tests/
[ ERROR ] Suite 'Skip Tests' contains no tests with tag 'smoke test' and without tag 'my skip' in suite 'TEST_SKIP_STATIC_TAG'.
Try --help for usage information.
debian@debian:~/work/auto$
debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_DYNAMIC_TAG --include smoke_test --skip my_skip tests/skip_tests/
[ ERROR ] Suite 'Skip Tests' contains no tests with tag 'smoke test' and without tag 'my skip' in suite 'TEST_SKIP_DYNAMIC_TAG'.
Try --help for usage information.
debian@debian:~/work/auto$
I would suggest changing it to just "skip execution". If you need to do it
conditionally you can combine it with "run keyword if" "run keyword if".
By only supporting "skip execution if", there will be times when a test may
do "skip execution if | True", which is somewhat cumbersome.
If you feel strongly about the need for "skip execution if", then I humbly
suggest you provide two keywords - "skip execution" and "skip execution
if".
Otherwise, this is very encouraging!
--bryan
On Thu, Oct 15, 2015 at 7:23 PM, Doug Gordon [email protected]
wrote:
Hi, I have proposed a source code enhancement to the robot framework via:
This pull request adds support for skipping testcases via the use of a new
keyword
‘Skip Execution If’. I would very much welcome your comments and feedback
on the
information below where I have tried to explain to you how this would work.
I have created 3 example/demo testcase files to demonstrate the use of the
‘Skip Execution If’
keyword.
# Force a testcase failure
Set Test Variable ${result} FORCE_FAILURE
Should Be Equal ${result} Passed
Below are test runs using the above example/demo files. I’ve included
console outputs and screen
shots of the HTML reports generated for the runs.
I have this working 99.9%. The one issue remaining that I have not been
able to address is the case
when a critical testcase is skipped the console output is correct, however
the HTML report is
classifying a SKIP result as a failure. I have figured out that this needs
to be fixed in the file in
src/robot/htmldata/rebot/testdata.js in the code block below. However I
cannot figure out what exactly
is in ‘stats’. My Jython is not good – for now. This code block needs to
not consider a SKIP result as
a failure. Fix this and it will fix the HTML reporting for critical
testcases with SKIP results.
If you or anyone on the robot developers team can help me with this then
I’ll do all I can to
incorporate this in this pull request. Alternatively if you would like to
take my changes and address
this issue in the team then I am more than happy with this. My interest is
in getting this implemented
and released to help my company and the user community here.
Don't have much time for this today or during the weekend but some quick comments:
On a quick look the PR Added support for new keyword 'Skip Execution If' #2179 looks pretty good. Nice to see implementing skipping like this isn't too complicated. More importantly, it's great that there is a concrete version that can be tested.
If skipping is supported, I think it should also be supported based on tags e.g. like --skip mytag. Tests having skipped tags shouldn't be executed at all, and a dynamically added skip tag should mark test skipped afterwards. In practice --skip would work like --exclude but tests would be shown in statistics.
To make it easier for libraries to mark tests skipped, we could consider supporting special attribute like ROBOT_SKIP_ON_FAILURE on exceptions to mark tests skipped. This would be consistent with continuable and fatal failures (ROBOT_CONTINUE_ON_FAILURE and ROBOT_EXIT_ON_FAILURE) and would simplify logic on test case level.
I'm not entirely sure is it a good idea to add skip columns to statistics if no tests are skipped. If 2. and 3. above are implemented, skipping gets more usages and showing it in tables would be OK.
Tests are needed. Possibly broken existing tests need to be fixed.
Skipping concept needs to be explained in the User Guide.
This is Nissar from Brocade QA team.
It's good to have the SKIP testcases count added to the report.
From the execution perspective, it gives clear report which shows the total passed, failed and skipped testcases.
Even in the case when none of the testcases are skipped, it indicates that all the testcases execution is covered, which would be useful for tracking the testcases execution coverage.
Hi pekkaklarck, interested to know your thoughts & views on the comment provided by boakley above.
Personally i feel "skip execution if | True" will do all that one needs. One is going to have to do
something to determine dynamically if the current testcase should be skipped and so testing the
condition via the 'If' is all that is needed.
On Wed, Oct 21, 2015 at 8:35 AM, Doug Gordon [email protected]
wrote:
... One is going to have to do
something to determine dynamically if the current testcase should be
skipped and so testing the
condition via the 'If' is all that is needed.
While it's true that some conditional may have to be done, it may not be
done in the same place you are calling skip. For example, I may do a
conditional check in a test case, and call a special keyword if I'm
supposed to skip the test case. This keyword may do several things: it may
close database connections, write to or close a file, log a message, etc.
AND it will do the skip. There's no need for that keyword to do some sort
of test (eg: "Skip if ..."), because the only way that keyword will be
called is if it has already been determined that the test should be
skipped. A second conditional is redundant.
Here is a somewhat contrived example:
*** Keywords ***
| Skip tests for unsupported feature
| | [Arguments] | ${feature}
| | log to console | Feature ${feature} is not supported; all tests for that feature will be skipped.
| | append to list | ${unsupported features} | ${feature}
| | remove values from list | ${supported features} | ${feature}
| | skip
| Check for supported feature
| | [Arguments] | ${feature}
| | Run keyword if | ${feature} not in ${supported features}
| | ... | Skip tests for unsupported feature | ${feature}
*** Test cases ***
| Example
| | [Setup] check for supported feature | multi-touch
| | <test body>
+1
Would also be nice to be able to use tags to auto-skip testcases that cannot succeed. I currently use "pybot --exclude=manual" but would prefer "pybot --skip=manual" to be able to include them in the report without failing them.
That might deserve a separate ticket though
Hi I'm dealing with the sudden death of my Father in-law at this time. I will try to address these points
ASAP, but must give my family my attention at this time.
@ram-sid feel free to copy paste the remaining changes required from the previous attempts and create a pull request. Ultimately this feature should go into this robotframework repository, so maybe you could await the sprint at RoboCon as mentioned above?
After reading most of the comments I think one problem is that there are many different situations in which there is a need for a skip functionality. My own reason for reading this thread was a need for having preconditions for a tests, and if the preconditions were not met I would not like the test to run and would like to have it market as skipped, instead of failed or passed. But, obviously there are several different situations. So here are some thoughts about this in the form of different scenarios:
I know beforehand that there are certain tests I want to run and certain tests that should be skipped. These have tags that I can use. This case is solved by using --include, --exclude as it is today. If there are critical and non-critical tests they are also identified in the same way as today.
There are certain resources (or similar) that must be available for the test to run. If not so, there is no need for the test to run so it should be skipped. In this case it is actually an error that the test did not run, but it is not a fault of the test itself. Personally I think the test should be market as skipped, and failing the overall test run if critical.
A test should only be run if the tested system is in a certain configuration, otherwise skipped. In this case it is NOT an error that the test is skipped, we just did not know beforehand what the actual configuration was. If the test itself is critical (if it should be run) one could change the tagging to non-critical, but perhaps it would be better to use some other indicator. It would also be possible just not to show this test in logs, but I think many people might want to be able to see why the test was skipped.
So in summary I think something like below is appropriate. Skipping means if skipping the test was OK or not (case 2 or 3 above).
Action Skipping Critical/non-Critical Color (suggestion) Overall test
Test runs and fails Critical Red (as today) Fails
Test runs and fails Non-critical Red (as today) OK
Test skipped Not OK Critical Orange Fails
Test skipped Not OK Non-critical Orange OK
Test skipped OK Critical Yellow OK
Test skipped OK Non-critical Yellow OK
The skipping OK/Not OK could perhaps be set by setting some variable, using some function or similar.
Hemmm.. if I skip test I think the result Is Just skipped.. not "ok -
skipped" or "not-ok skipped"
Il ven 21 feb 2020, 22:54 magand01 <[email protected]> ha scritto:
The table in the previous comment did not really come out as expected. New
attempt here:
Action Skipping Critical/Non-critical Color (suggestion) Overall test
Test runs and fails Critical Red (as today) Fails
Test runs and fails Non-critical Red (as today) OK
Test skipped Not OK Critical Orange Fails
Test skipped Not OK Non-critical Orange OK
Test skipped OK Critical Yellow OK
Test skipped OK Non-critical Yellow OK
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2087?email_source=notifications&email_token=AKMGLR2VGCJGDATE2EMJTNTREBEQZA5CNFSM4BMYFMV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMUHEGY#issuecomment-589853211>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKMGLR3O4IGQ4DK5AZ6ISBLREBEQZANCNFSM4BMYFMVQ>
.
@magand01 I'm sorry, but where's the value of failing critical tests on a skip? A skip is a skip. People are looking for an ability to communicate "for one reason on another we won't run this, period".
Assuming any other intentions or a testing philosophy is a mistake and will lead to making this feature unusable for some parts of the community.
The long awaited skip status is coming in RF 4.0 that's planned for December! I submitted #3622 with more concrete design and close this one as its duplicate.
As you'll see from #3622, criticality will go when skipping comes. I know its a controversial decision but I've been thinking this for a long time and believe that's the best way forward. For more reasoning see the separate issue #3624.
Reacted by Windel Bouwman, Anna Kozyreva, Kyriakos (Dominick) Sidiropoulos and drfunjohn
Activity
actingcoach commentedon Aug 20, 2015
I have a need for this 'SKIPPED' status. This happen when robot is hooked with test case management system (TCMS) when executing a test run and some cases have already 'PASSED'; therefore, no need to run that particular cases anymore; thus, robot should mark as 'SKIPPED'
In my case BuiltIn keyword is needed due to its flexibility. If it was a custom exception, I wonder if external libraries can 'raise' that.
boakley commentedon Sep 23, 2015
I think the simplest solution is a built-in keyword (eg:
Skip test), which works via a custom exception that can also be used by libraries.Then, I would add another column in the statistics so we now have Total (including skipped), Pass, Fail, and Skipped. Beyond that, skipped tests shouldn't affect anything else -- they don't change the color, don't change the overall status, etc.
Doug8080 commentedon Oct 6, 2015
I completely agree with boakley above in the way I would like this to work.
There are 2 things to address in the solution when I compile in my mind what
the user community is asking. Namely first skipping a testcase, second reporting.
Skipping the testcase is the real important part, that’s the functionality users want.
:It would be nice if the status of the testcases were reported as SKIP, but that is not
100% necessary. What I mean is, at the very minimum, implement the ability to skip
a testcase via being able to call a keyword from *** Settings *** within an init.py,
a testcase.txt, a resource.txt file or a libray.py file. The point being the decision to skip or
not is made and taken before the actual testcase starts. In sudo code this would look like this:
Hence if the testcase can be prevented from actually starting (hence totally skipped)
then result reporting does not need to change because the test should not even by
executed/run (hence behave as if its Tags did not match the selection etc.). This would
then allow users to dynamically skip tests and this part would not be that difficult to
anyone who is familiar with the robot source.
This to me would be perfectly acceptable as the PASS/FAIL counts would be consistent
and so a Development & Regression team could make software release decisions to
ship once a percentage ‘%’ rate is achieved. Managers (Development or Regression teams)
are not interested in how many tests were skipped, only the PASS/FAIL rate. If an Engineer
wants to know if a testcase was skipped then they could check the report, log etc.
If you are going to support reporting skipped testcases, then again as boakley stated above, e.g.
“add another column in the statistics so we now have Total (including skipped), Pass, Fail, and Skipped. Beyond that, skipped tests shouldn't affect anything else -- they don't change the colour, don't change the overall status, etc.”
If you would lie any clarity or for me to expand on this I will do all I can to help.
I would love this functionality ASAP.
I’m willing to be an Alpha/Beta tester for this.
Regards,
Doug
Doug8080 commentedon Oct 16, 2015
With reference the pull request: PR #2179
The changes I would like to proposed in this pull request are to add support for skipping testcases
via the use of a new keyword ‘
Skip Execution’. Additionally support for a command line option--skiphas been added. The--skipoption works like the--excludeoption except that tests are shownin the statistics. Finally support has been added for a special attribute
ROBOT_SKIP_ON_FAILUREon exceptions to mark tests skipped. This is consistent with continuable and fatal failures
(
ROBOT_CONTINUE_ON_FAILUREandROBOT_EXIT_ON_FAILURE) and simplifies logic at the test caselevel.
I have fixed up all the unit tests (under the utest directory), they all pass successfully, e.g.
I have also update the source code documentation for the
--skipoption (under the doc directory).I have created 5 example/demo testcase files to demonstrate the use of the ‘
Skip Execution’ keyword and--skipoption.Example/demo Testcase Files:
TEST_SKIP.txt
TEST_SKIP_STATIC_TAG.txt
TEST_SKIP_DYNAMIC_TAG.txt
TEST_PASS.txt
TEST_FAIL.txt
Issues
I have this working 99.9%. There are two small issues remaining that I have not been able to address.
Issue 1:
How to fix up the file below for adding ROBOT_SKIP_ON_FAILURE support.
Issue 2:
The
--skipoption works exactly like the--excludeoption at present. I do not quite understand howto show the skipped tests in the statistics when the
--skipoption is used. Skipped tests via the keyword‘
Skip Execution’ are sown in the statistics, but I do not know how to show the tests skipped via the--skipoption in the statistics.Issue 3:
The final issue remaining that I have not been able to address is the case when a critical testcase is
skipped the console output is correct, however the HTML report is classifying a SKIP result as a critical failure (i.e. in the HTML report it states for example '
Status: 1 critical test failed'). I havefigured out (I think) that this needs to be fixed in the file in
src/robot/htmldata/rebot/testdata.jsin the code block below. However I cannot figure out what exactly is in ‘stats’. My Jython is not good
– for now. This code block needs to not consider a SKIP result as a failure. Fix this and it will fix the
HTML reporting for critical testcases with SKIP results.
If you or anyone on the robot developers team can help me with this then I’ll do all I can to
incorporate this in this pull request. Alternatively if you would like to simply take my changes and address this issue in the team then I am more than happy with this. My interest is in getting this implemented and released to help my company and the wider user community here.
Regards,
Doug
Testing Results
Below are test runs using the above example/demo files. I’ve included console outputs and screen
shots of the HTML reports generated for the runs.
TEST: Skip Test Non Critical
TEST: Skip & Pass Tests Non Critical
TEST: Skip Static Tag Test Non Critical
TEST: Skip Static Tag & Pass Test Non Critical
TEST: Skip Dynamic Tag Test Non Critical
TEST: Skip Dynamic Tag & Pass Test Non Critical
TEST: Pass Test Non Critical
TEST: Fail Test Non Critical
TEST: All Tests Non Critical
TEST: Skip Test Critical
TEST: Skip & Pass Tests Critical
TEST: Skip Static Tag Test Critical
TEST: Skip Static Tag & Pass Test Critical
TEST: Skip Dynamic Tag Test Critical
TEST: Skip Dynamic Tag & Pass Test Critical
TEST: Pass Test Critical
TEST: Fail Test Critical
TEST: All Tests Critical
boakley commentedon Oct 16, 2015
I would suggest changing it to just "skip execution". If you need to do it
conditionally you can combine it with "run keyword if" "run keyword if".
By only supporting "skip execution if", there will be times when a test may
do "skip execution if | True", which is somewhat cumbersome.
If you feel strongly about the need for "skip execution if", then I humbly
suggest you provide two keywords - "skip execution" and "skip execution
if".
Otherwise, this is very encouraging!
--bryan
On Thu, Oct 15, 2015 at 7:23 PM, Doug Gordon [email protected]
wrote:
pekkaklarck commentedon Oct 16, 2015
Don't have much time for this today or during the weekend but some quick comments:
--skip mytag. Tests having skipped tags shouldn't be executed at all, and a dynamically added skip tag should mark test skipped afterwards. In practice--skipwould work like--excludebut tests would be shown in statistics.ROBOT_SKIP_ON_FAILUREon exceptions to mark tests skipped. This would be consistent with continuable and fatal failures (ROBOT_CONTINUE_ON_FAILUREandROBOT_EXIT_ON_FAILURE) and would simplify logic on test case level.nshariff commentedon Oct 21, 2015
This is Nissar from Brocade QA team.
It's good to have the SKIP testcases count added to the report.
From the execution perspective, it gives clear report which shows the total passed, failed and skipped testcases.
Even in the case when none of the testcases are skipped, it indicates that all the testcases execution is covered, which would be useful for tracking the testcases execution coverage.
Doug8080 commentedon Oct 21, 2015
Hi pekkaklarck, interested to know your thoughts & views on the comment provided by boakley above.
Personally i feel "skip execution if | True" will do all that one needs. One is going to have to do
something to determine dynamically if the current testcase should be skipped and so testing the
condition via the 'If' is all that is needed.
boakley commentedon Oct 21, 2015
On Wed, Oct 21, 2015 at 8:35 AM, Doug Gordon [email protected]
wrote:
While it's true that some conditional may have to be done, it may not be
done in the same place you are calling skip. For example, I may do a
conditional check in a test case, and call a special keyword if I'm
supposed to skip the test case. This keyword may do several things: it may
close database connections, write to or close a file, log a message, etc.
AND it will do the skip. There's no need for that keyword to do some sort
of test (eg: "Skip if ..."), because the only way that keyword will be
called is if it has already been determined that the test should be
skipped. A second conditional is redundant.
Here is a somewhat contrived example:
Doug8080 commentedon Oct 21, 2015
Ah ok, thank you boakley I understand better now. Ok let me take this up and make the changes.
erikalfthan commentedon Oct 22, 2015
+1
Would also be nice to be able to use tags to auto-skip testcases that cannot succeed. I currently use "pybot --exclude=manual" but would prefer "pybot --skip=manual" to be able to include them in the report without failing them.
That might deserve a separate ticket though
Doug8080 commentedon Oct 26, 2015
Hi I'm dealing with the sudden death of my Father in-law at this time. I will try to address these points
ASAP, but must give my family my attention at this time.
regards,
Doug
Doug8080 commentedon Nov 5, 2015
Hi boakley, committed changes to removed keyword "Skip Execution If' and added keyword 'Skip Execution'. See second commit.
pekkaklarck working on adding the --skip tag support now.
Regards,
Doug
110 remaining items
windelbouwman commentedon Dec 29, 2018
@ram-sid feel free to copy paste the remaining changes required from the previous attempts and create a pull request. Ultimately this feature should go into this robotframework repository, so maybe you could await the sprint at RoboCon as mentioned above?
ram-sid commentedon Dec 30, 2018
@windelbouwman Yes, i'll wait for the sprint to complete. Thank you!
sebastianciupinski commentedon May 8, 2019
Any updates?
R3gi commentedon Aug 19, 2019
I second the need of the SKIP feature. I would appreciate something easy, e.g. Pytest's user-friendly:
@pytest.mark.skip(reason="API is broken now")magand01 commentedon Feb 21, 2020
After reading most of the comments I think one problem is that there are many different situations in which there is a need for a skip functionality. My own reason for reading this thread was a need for having preconditions for a tests, and if the preconditions were not met I would not like the test to run and would like to have it market as skipped, instead of failed or passed. But, obviously there are several different situations. So here are some thoughts about this in the form of different scenarios:
I know beforehand that there are certain tests I want to run and certain tests that should be skipped. These have tags that I can use. This case is solved by using --include, --exclude as it is today. If there are critical and non-critical tests they are also identified in the same way as today.
There are certain resources (or similar) that must be available for the test to run. If not so, there is no need for the test to run so it should be skipped. In this case it is actually an error that the test did not run, but it is not a fault of the test itself. Personally I think the test should be market as skipped, and failing the overall test run if critical.
A test should only be run if the tested system is in a certain configuration, otherwise skipped. In this case it is NOT an error that the test is skipped, we just did not know beforehand what the actual configuration was. If the test itself is critical (if it should be run) one could change the tagging to non-critical, but perhaps it would be better to use some other indicator. It would also be possible just not to show this test in logs, but I think many people might want to be able to see why the test was skipped.
So in summary I think something like below is appropriate. Skipping means if skipping the test was OK or not (case 2 or 3 above).
Action Skipping Critical/non-Critical Color (suggestion) Overall test
Test runs and fails Critical Red (as today) Fails
Test runs and fails Non-critical Red (as today) OK
Test skipped Not OK Critical Orange Fails
Test skipped Not OK Non-critical Orange OK
Test skipped OK Critical Yellow OK
Test skipped OK Non-critical Yellow OK
The skipping OK/Not OK could perhaps be set by setting some variable, using some function or similar.
magand01 commentedon Feb 21, 2020
The table in the previous comment did not really come out as expected. New attempt here:
Caos-Maker89 commentedon Feb 21, 2020
duychu commentedon Apr 28, 2020
Sorry but any actions for skip status. I have been looking for this feature. Thanks.
MrMino commentedon May 13, 2020
@magand01 I'm sorry, but where's the value of failing critical tests on a skip? A skip is a skip. People are looking for an ability to communicate "for one reason on another we won't run this, period".
Assuming any other intentions or a testing philosophy is a mistake and will lead to making this feature unusable for some parts of the community.
pekkaklarck commentedon Aug 3, 2020
The long awaited skip status is coming in RF 4.0 that's planned for December! I submitted #3622 with more concrete design and close this one as its duplicate.
As you'll see from #3622, criticality will go when skipping comes. I know its a controversial decision but I've been thinking this for a long time and believe that's the best way forward. For more reasoning see the separate issue #3624.
[-]New `SKIP` status for tests[/-][+]New `SKIP` status for tests (discussion)[/+]