Skip to content

Added support for new keyword 'Skip Execution If' - #2179

Closed
Doug8080 wants to merge 3 commits into
robotframework:masterfrom
Doug8080:Doug8080-skip
Closed

Doug8080 wants to merge 3 commits into
robotframework:masterfrom
Doug8080:Doug8080-skip

Conversation

@Doug8080

Copy link
Copy Markdown

On branch Doug8080-skip
Changes to be committed:
modified: src/robot/errors.py
modified: src/robot/htmldata/rebot/common.css
modified: src/robot/htmldata/rebot/model.js
modified: src/robot/htmldata/rebot/view.js
modified: src/robot/libraries/BuiltIn.py
modified: src/robot/model/stats.py
modified: src/robot/model/totalstatistics.py
modified: src/robot/output/console/highlighting.py
modified: src/robot/reporting/jsmodelbuilders.py
modified: src/robot/result/testcase.py
modified: src/robot/result/testsuite.py
modified: src/robot/running/keywordrunner.py
modified: src/robot/running/runner.py
modified: src/robot/running/status.py
modified: src/robot/running/userkeyword.py

On branch Doug8080-skip
Changes to be committed:
       modified:   src/robot/errors.py
       modified:   src/robot/htmldata/rebot/common.css
       modified:   src/robot/htmldata/rebot/model.js
       modified:   src/robot/htmldata/rebot/view.js
       modified:   src/robot/libraries/BuiltIn.py
       modified:   src/robot/model/stats.py
       modified:   src/robot/model/totalstatistics.py
       modified:   src/robot/output/console/highlighting.py
       modified:   src/robot/reporting/jsmodelbuilders.py
       modified:   src/robot/result/testcase.py
       modified:   src/robot/result/testsuite.py
       modified:   src/robot/running/keywordrunner.py
       modified:   src/robot/running/runner.py
       modified:   src/robot/running/status.py
       modified:   src/robot/running/userkeyword.py
@Doug8080

Copy link
Copy Markdown
Author

I would like to reference the discussion taking place at:
New SKIP status for tests #2087

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.

    function suiteStats(stats) {
        return {
            total: stats[0],
            totalPassed: stats[1],
            totalFailed: stats[0] - stats[1],
            critical: stats[2],
            criticalPassed: stats[3],
            criticalFailed: stats[2] - stats[3]
        };
    }

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$ 

skip_test_non_critical

TEST: Skip & Pass Tests Non Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP -s TEST_PASS --include smoke_test -n smoke_test tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
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                                                                                                          | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 0 passed, 0 failed, 1 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
2 tests total, 1 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$

skip_test_pass_test_non_critial

TEST: Skip Static Tag Test Non Critical

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$

TEST: Skip Static Tag & Pass Test Non Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_STATIC_TAG -s TEST_PASS --include smoke_test -n smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 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$

skip_test_static_tag_pass_test_non_critial

TEST: Skip Dynamic Tag Test Non Critical

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$

TEST: Skip Dynamic Tag & Pass Test Non Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_DYNAMIC_TAG -s TEST_PASS --include smoke_test -n smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 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$

skip_test_dynamic_tag_pass_test_non_critial

TEST: Pass Test Non Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_PASS --include smoke_test -n smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 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$ 

pass_test_non_critical

TEST: Fail Test Non Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_FAIL --include smoke_test -n smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Fail                                                                                                                                                                   | FAIL |
FORCE_FAILURE != Passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                           | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 0 passed, 1 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 0 passed, 1 failed, 0 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$

fail_test_non_critical

TEST: All Tests Non Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP -s TEST_SKIP_STATIC_TAG -s TEST_SKIP_DYNAMIC_TAG -s TEST_PASS -s TEST_FAIL --include smoke_test -n smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Fail                                                                                                                                                                   | FAIL |
FORCE_FAILURE != Passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                           | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 0 passed, 1 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
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                                                                                                          | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
1 test total, 0 passed, 0 failed, 1 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
0 critical tests, 0 passed, 0 failed, 0 skipped
3 tests total, 1 passed, 1 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$

all_test_non_critical

TEST: Skip Test 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 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$

skip_test_critical

TEST: Skip & Pass Tests Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP -s TEST_PASS --include smoke_test tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
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                                                                                                                                                    | PASS |
2 critical tests, 1 passed, 0 failed, 1 skipped
2 tests total, 1 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$

skip_test_pass_test_critial

TEST: Skip Static Tag Test Critical

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$

TEST: Skip Static Tag & Pass Test Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_STATIC_TAG -s TEST_PASS --include smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 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$

skip_test_static_tag_pass_test_critial

TEST: Skip Dynamic Tag Test Critical

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$

TEST: Skip Dynamic Tag & Pass Test Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP_DYNAMIC_TAG -s TEST_PASS --include smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 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$

skip_test_dynamic_tag_pass_test_critial

TEST: Pass Test Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_PASS --include smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 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$

pass_test_critical

TEST: Fail Test Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_FAIL --include smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Fail                                                                                                                                                                   | FAIL |
FORCE_FAILURE != Passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                           | FAIL |
1 critical test, 0 passed, 1 failed, 0 skipped
1 test total, 0 passed, 1 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                    | FAIL |
1 critical test, 0 passed, 1 failed, 0 skipped
1 test total, 0 passed, 1 failed, 0 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$

fail_test_critical

TEST: All Tests Critical

debian@debian:~/work/auto$ pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP -s TEST_SKIP_STATIC_TAG -s TEST_SKIP_DYNAMIC_TAG -s TEST_PASS -s TEST_FAIL --include smoke_test --skip my_skip tests/skip_tests/
====================================================================================================================================================================================
Skip Tests :: Test Suite                                                                                                                                                            
====================================================================================================================================================================================
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Fail                                                                                                                                                                   | FAIL |
FORCE_FAILURE != Passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST FAIL :: Objective: Test Failed Testcase Reporting                                                                                                           | FAIL |
1 critical test, 0 passed, 1 failed, 0 skipped
1 test total, 0 passed, 1 failed, 0 skipped
====================================================================================================================================================================================
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                                   
====================================================================================================================================================================================
Test_Pass                                                                                                                                                                   | PASS |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Skip Tests.TEST PASS :: Objective: Test Passed Testcase Reporting                                                                                                           | PASS |
1 critical test, 1 passed, 0 failed, 0 skipped
1 test total, 1 passed, 0 failed, 0 skipped
====================================================================================================================================================================================
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                                                                                                                                                    | FAIL |
3 critical tests, 1 passed, 1 failed, 1 skipped
3 tests total, 1 passed, 1 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$

all_test_critical

root added 2 commits November 5, 2015 09:44
…P_ON_FAILURE

on exceptions to mark tests skipped. Updated unit tests and documentation files.
@Doug8080

Doug8080 commented Nov 6, 2015

Copy link
Copy Markdown
Author

Added support for CLI option --skip. Also added support for special attribute
ROBOT_SKIP_ON_FAILURE on exceptions to mark tests skipped. Updated unit
tests and source documentation files.

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.

How is skipping different than excluding in this context?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

First off, sorry Pekkaklarck for taking so long to get back to you on this, things have been hectic at work of late.

My implementation of --tagstatskip is exactly the same as --tagstatexclude.

With reference to your comment on 16th Oct #2087

"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."

My understanding of the robot source is limited and I could not see exactly how to implement
what you were asking for in your comment. So Implemented as much as I could in replicating
--tagstatexclude with --tagstatskip. I was hoping that you (or someone else in the robot
development could/would use what I have written as a basses for what you are asking for. I don't
understand the source enough to do this correctly I feel :(

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.

No worries about the delay. Paid work obviously has higher priority than open source contributions (unless you are paid for the latter).

I know implementing skipping correctly is not easy. The biggest problem I see with it is designing it so that it works consistently with existing --exclude/--include and --critical/--noncritical functionality. I hope you understand I'm not going to spend time with it unless someone pays me. Currently this isn't an important feature for any of my paying clients.

@snyderr

snyderr commented Jan 18, 2016

Copy link
Copy Markdown

Doug,

Is it possible for you to make an updated list on the known problems with the skip execution function?
I have been tasked by my boss to get this code to work properly so that my company can possibly use it in the near future. I am unsure how long I will be able to work on this but I hope to debug your code as much as I can. I am going to start to look into fixing the problem with the jython/javascript but if you could post a complete list it would help me accomplish this task faster.

Thank you,
Ryan

@pekkaklarck

Copy link
Copy Markdown
Member

There were quite many issues with the original PR. The biggest problem is not that much about the code but about how skipping should work in general compared to --exclude and non-critical tests (i.e. --critical and --noncritical). It would probably be a good idea to discuss this more interactively in Slack or IRC.

@snyderr

snyderr commented Jan 18, 2016

Copy link
Copy Markdown

Would you be available to discuss this any time tomorrow? I live in Boston, MA so our time zones are a little off. I should be free around 10a.m. eastern if that works well for you. We can talk in IRC or slack, doesn’t matter to me.

@pekkaklarck

Copy link
Copy Markdown
Member

Tue won't work due to full day training and travel home afterwards. Would Wed be OK? I'm UTC+2. Let's use Slack if that's good for you. Should we use it also for agreeing the exact time?

@pekkaklarck

Copy link
Copy Markdown
Member

SKIP status was added in RF 4.0 (#3622). This PR is thus outdated.

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.

3 participants