Skip to content

New SKIP status for tests (discussion) #2087

Closed
Closed

Description

@pekkaklarck

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:

  1. 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.
  2. How skipped tests affect statistics?
  3. 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.

Activity

  1. actingcoach commented on Aug 20, 2015

    @actingcoach

    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.

  2. boakley commented on Sep 23, 2015

    @boakley

    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.

  3. Doug8080 commented on Oct 6, 2015

    @Doug8080

    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:

    *** Settings ***
    Documentation
    ...    Objective: TAG Test 1
    ...
    
    Library          BuiltIn
    Library          SSHLibrary
    Library          Collections
    Default Tags     smoke_test
    Suite Setup      Example
    
    *** Keywords ***
    Example
        # Check if Testcase is Relevant (should be skipped)
        # -------------------------------------------------
        ${result}=    Skip If Testcase Not Applicable
        Run Keyword If    '${result}' == 'skip'    Skip Test
    
    *** Test Cases ***
    TAG_Test_1
        Log  ===========> *** Test TAG_1 Running *** <===========
        etc.

    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

  4. Doug8080 commented on Oct 16, 2015

    @Doug8080

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

  5. boakley commented on Oct 16, 2015

    @boakley

    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:

    GitHub robot framework pull request #2179
    #2179

    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.

    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
    Skip Execution If '${release}' == 'R1' 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_PASS.txt

    *** Settings ***
    Documentation
    ... Objective: Test Passed Testcase Reporting
    ...

    Library BuiltIn
    Default Tags smoke_test

    *** Keywords ***
    Skip Test
    Set Test Variable ${release} R2
    Skip Execution If '${release}' == 'R1' 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
    

    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.

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

    Regards,
    Doug

    TEST: Skip Test Non Critical

    debian@debian:~/work/robot 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

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST SKIP :: Objective: Test Skipped Testcase Reporting

    Test_Skip | SKIP |

    Skipping Testcase (it is not relevant to this image)

    Flow Monitoring.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

    Flow Monitoring :: Test Suite | PASS |
    0 critical tests, 0 passed, 0 failed, 0 skipped

    1 test total, 0 passed, 0 failed, 1 skipped

    Debug: /home/debian/work/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: skip_test_non_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530661/cd965f4a-73a1-11e5-8b07-577826eb0e9a.jpg

    TEST: Pass Test Non Critical

    debian@debian:~/work/robot pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_PASS --include smoke_test -n smoke_test tests/skip_tests

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST PASS :: Objective: Test Passed Testcase Reporting

    Test_Pass | PASS |

    Flow Monitoring.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

    Flow Monitoring :: 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/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: pass_test_non_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530689/05f79b9c-73a2-11e5-80ba-bffaf4afab18.jpg

    TEST: Fail Test Non Critical

    debian@debian:~/work/robot pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_FAIL --include smoke_test -n smoke_test tests/skip_tests

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST FAIL :: Objective: Test Failed Testcase Reporting

    Test_Fail | FAIL |

    FORCE_FAILURE != Passed

    Flow Monitoring.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

    Flow Monitoring :: 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/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: fail_test_non_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530695/25af130c-73a2-11e5-8508-a244fece0a33.jpg

    TEST: Skip Pass Fail Test Non Critical

    debian@debian:~/work/robot pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP -s TEST_PASS -s TEST_FAIL --include smoke_test -n smoke_test tests/skip_tests

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST FAIL :: Objective: Test Failed Testcase Reporting

    Test_Fail | FAIL |

    FORCE_FAILURE != Passed

    Flow Monitoring.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

    Flow Monitoring.TEST PASS :: Objective: Test Passed Testcase Reporting

    Test_Pass | PASS |

    Flow Monitoring.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

    Flow Monitoring.TEST SKIP :: Objective: Test Skipped Testcase Reporting

    Test_Skip | SKIP |

    Skipping Testcase (it is not relevant to this image)

    Flow Monitoring.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

    Flow Monitoring :: 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/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: skip_pass_fail_test_non_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530709/4e7532a8-73a2-11e5-9cd2-e51258a2743c.jpg

    TEST: Skip Test Critical

    debian@debian:~/work/robot pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP --include smoke_test tests/skip_tests

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST SKIP :: Objective: Test Skipped Testcase Reporting

    Test_Skip | SKIP |

    Skipping Testcase (it is not relevant to this image)

    Flow Monitoring.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

    Flow Monitoring :: 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/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: skip_test_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530741/709f83c4-73a2-11e5-82a2-9fa3649938f2.jpg

    **TEST: Pass Test Critical*

    debian@debian:~/work/robot pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_PASS --include smoke_test tests/skip_tests

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST PASS :: Objective: Test Passed Testcase Reporting

    Test_Pass | PASS |

    Flow Monitoring.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

    Flow Monitoring :: 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/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: pass_test_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530788/d7d91c30-73a2-11e5-96e4-e59740de7321.jpg

    TEST: Fail Test Critical

    debian@debian:~/work/robot pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_FAIL --include smoke_test tests/skip_tests

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST FAIL :: Objective: Test Failed Testcase Reporting

    Test_Fail | FAIL |

    FORCE_FAILURE != Passed

    Flow Monitoring.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

    Flow Monitoring :: 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/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: fail_test_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530818/13c975a0-73a3-11e5-9db9-514f5fff2bcf.jpg

    TEST: Skip Pass Fail Test Critical

    debian@debian:~/work/robot pybot -W 180 -b debug -v testbed_name:uks3sb-1 -v fail_recover:False -s TEST_SKIP -s TEST_PASS -s TEST_FAIL --include smoke_test tests/skip_tests

    Flow Monitoring :: Test Suite

    Flow Monitoring.TEST FAIL :: Objective: Test Failed Testcase Reporting

    Test_Fail | FAIL |

    FORCE_FAILURE != Passed

    Flow Monitoring.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

    Flow Monitoring.TEST PASS :: Objective: Test Passed Testcase Reporting

    Test_Pass | PASS |

    Flow Monitoring.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

    Flow Monitoring.TEST SKIP :: Objective: Test Skipped Testcase Reporting

    Test_Skip | SKIP |

    Skipping Testcase (it is not relevant to this image)

    Flow Monitoring.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

    Flow Monitoring :: Test Suite | PASS |
    3 critical tests, 1 passed, 1 failed, 1 skipped

    3 tests total, 1 passed, 1 failed, 1 skipped

    Debug: /home/debian/work/robot/debug.txt
    Output: /home/debian/work/robot/output.xml
    Log: /home/debian/work/robot/log.html
    Report: /home/debian/work/robot/report.html
    debian@debian:~/work/robot

    HTML Report
    [image: skip_pass_fail_test_critical]
    https://cloud.githubusercontent.com/assets/12747505/10530842/2f6130d2-73a3-11e5-9622-9a5803e6cf6c.jpg

    —
    Reply to this email directly or view it on GitHub
    #2087 (comment)
    .

  6. pekkaklarck commented on Oct 16, 2015

    @pekkaklarck
    MemberAuthor

    Don't have much time for this today or during the weekend but some quick comments:

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. Tests are needed. Possibly broken existing tests need to be fixed.
    6. Skipping concept needs to be explained in the User Guide.
  7. nshariff commented on Oct 21, 2015

    @nshariff

    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.

  8. Doug8080 commented on Oct 21, 2015

    @Doug8080

    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.

  9. boakley commented on Oct 21, 2015

    @boakley

    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>
    
  10. Doug8080 commented on Oct 21, 2015

    @Doug8080

    Ah ok, thank you boakley I understand better now. Ok let me take this up and make the changes.

  11. erikalfthan commented on Oct 22, 2015

    @erikalfthan

    +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

  12. Doug8080 commented on Oct 26, 2015

    @Doug8080

    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

  13. Doug8080 commented on Nov 5, 2015

    @Doug8080

    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

  14. 110 remaining items

  15. windelbouwman commented on Dec 29, 2018

    @windelbouwman

    @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?

  16. ram-sid commented on Dec 30, 2018

    @ram-sid

    @windelbouwman Yes, i'll wait for the sprint to complete. Thank you!

  17. sebastianciupinski commented on May 8, 2019

    @sebastianciupinski

    Any updates?

  18. R3gi commented on Aug 19, 2019

    @R3gi

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

  19. magand01 commented on Feb 21, 2020

    @magand01

    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:

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

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

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

  20. magand01 commented on Feb 21, 2020

    @magand01

    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
  21. Caos-Maker89 commented on Feb 21, 2020

    @Caos-Maker89
  22. duychu commented on Apr 28, 2020

    @duychu

    Sorry but any actions for skip status. I have been looking for this feature. Thanks.

  23. MrMino commented on May 13, 2020

    @MrMino

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

  24. pekkaklarck commented on Aug 3, 2020

    @pekkaklarck
    MemberAuthor

    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.

  25. changed the title [-]New `SKIP` status for tests[/-] [+]New `SKIP` status for tests (discussion)[/+] on Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions