4 new revisions:

Revision: 5e305e046f67
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 09:18:38 2013
Log:      test cleanup
http://code.google.com/p/robotframework/source/detail?r=5e305e046f67

Revision: 1f61aa4e7a09
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 09:30:07 2013
Log:      test clean-up
http://code.google.com/p/robotframework/source/detail?r=1f61aa4e7a09

Revision: 38743eedb3df
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 10:00:38 2013
Log:      Test long errors with suite setups/teardowns....
http://code.google.com/p/robotframework/source/detail?r=38743eedb3df

Revision: 28f960dd354a
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 10:15:33 2013
Log: Explicitly test that suite teardown errors are written to output.xml....
http://code.google.com/p/robotframework/source/detail?r=28f960dd354a

==============================================================================
Revision: 5e305e046f67
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 09:18:38 2013
Log:      test cleanup
http://code.google.com/p/robotframework/source/detail?r=5e305e046f67

Modified:
 /atest/robot/core/suite_setup_and_teardown.txt

=======================================
--- /atest/robot/core/suite_setup_and_teardown.txt      Sat Jan  5 09:14:02 2013
+++ /atest/robot/core/suite_setup_and_teardown.txt      Sat Jan  5 09:18:38 2013
@@ -1,5 +1,4 @@
 *** Settings ***
-Documentation Test cases for failing suite setup and teardown. Some related tests are also found from test_suite_dir_with_suite_file.html
 Force Tags        regression    jybot    pybot
 Resource          atest_resource.txt

@@ -36,9 +35,9 @@
     [Teardown]    Remove File    ${EXECUTED FILE}

 Failing Suite Setup
- [Documentation] Checks that tests in the suite are found from it and marked failed. Also checks that suite teardown is executed.
     Run Tests    ${EMPTY}    core/failing_suite_setup.txt
- Check Suite Status ${SUITE} FAIL Suite setup failed:\nExpected failure\n\n${2 FAIL MSG}
+    Check Suite Status    ${SUITE}    FAIL
+    ...    Suite setup failed:\nExpected failure\n\n${2 FAIL MSG}
     ...    Test 1    Test 2
     Should Be Equal    ${SUITE.setup.status}    FAIL
     Should Be Equal    ${SUITE.teardown.status}    PASS
@@ -47,9 +46,9 @@
     Should Be Empty    ${SUITE.teardown.kws}

 Erroring Suite Setup
- [Documentation] Checks that tests in the suite are found from it and marked failed. Also checks that suite teardown is executed.
     Run Tests    ${EMPTY}    core/erroring_suite_setup.txt
- Check Suite Status ${SUITE} FAIL Suite setup failed:\nNo keyword with name 'Non-Existing Keyword' found.\n\n${2 FAIL MSG}
+    Check Suite Status    ${SUITE}    FAIL
+ ... Suite setup failed:\nNo keyword with name 'Non-Existing Keyword' found.\n\n${2 FAIL MSG}
     ...    Test 1    Test 2
     Should Be Equal    ${SUITE.setup.status}    FAIL
     ${td} =    Set Variable    ${SUITE.teardown}
@@ -75,13 +74,15 @@

 Failing Suite Teardown When Also Tests Fail
     Run Tests    ${EMPTY}    core/failing_suite_teardown_2.txt
- Check Suite Status ${SUITE} FAIL Suite teardown failed:\nExpected failure\n\n${5 FAIL MSG}
+    Check Suite Status    ${SUITE}    FAIL
+    ...    Suite teardown failed:\nExpected failure\n\n${5 FAIL MSG}
... Test Passes Test Fails Setup Fails Teardown Fails Test and Teardown Fail
     Should Be Equal    ${SUITE.teardown.status}    FAIL

 Erroring Suite Teardown
     Run Tests    ${EMPTY}    core/erroring_suite_teardown.txt
- Check Suite Status ${SUITE} FAIL Suite teardown failed:\nNo keyword with name 'Non-Existing Keyword' found.\n\n${2 FAIL MSG}
+    Check Suite Status    ${SUITE}    FAIL
+ ... Suite teardown failed:\nNo keyword with name 'Non-Existing Keyword' found.\n\n${2 FAIL MSG}
     ...    Test 1    Test 2
     Should Be Equal    ${SUITE.teardown.status}    FAIL

@@ -109,8 +110,8 @@
     Check Suite Status    ${SUITE}    FAIL
... Suite teardown failed:\nFailure in top level suite teardown\n\n${12 FAIL MSG} ... PTD Passing PTD Failing FTD Passing FTD Failing PTD PTD Passing - ... PTD PTD Failing PTD FTD Passing PTD FTD Failing FTD PTD Passing FTD PTD Failing FTD FTD Passing
-    ...    FTD FTD Failing
+ ... PTD PTD Failing PTD FTD Passing PTD FTD Failing FTD PTD Passing
+    ...    FTD PTD Failing    FTD FTD Passing    FTD FTD Failing
     Check Suite Status    Passing Teardown Dir    FAIL    ${4 FAIL MSG}
... PTD PTD Passing PTD PTD Failing PTD FTD Passing PTD FTD Failing
     Check Suite Status    Ptd Passing Teardown    FAIL    ${2 FAIL MSG}
@@ -129,12 +130,11 @@

 Failing Higher Level Suite Setup
     Run Tests    ${EMPTY}    core/failing_higher_level_suite_setup
- Check Suite Status ${SUITE} FAIL Suite setup failed:\nExpected failure in higher level setup\n\n${2 FAIL MSG}
+    Check Suite Status    ${SUITE}    FAIL
+ ... Suite setup failed:\nExpected failure in higher level setup\n\n${2 FAIL MSG}
     ...    Test 1    Test 2
-    Check Suite Status    ${SUITE.suites[0]}    FAIL    ${1 FAIL MSG}
-    ...    Test 1
-    Check Suite Status    ${SUITE.suites[1]}    FAIL    ${1 FAIL MSG}
-    ...    Test 2
+ Check Suite Status ${SUITE.suites[0]} FAIL ${1 FAIL MSG} Test 1 + Check Suite Status ${SUITE.suites[1]} FAIL ${1 FAIL MSG} Test 2

 *** Keywords ***
 Check Suite Status

==============================================================================
Revision: 1f61aa4e7a09
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 09:30:07 2013
Log:      test clean-up
http://code.google.com/p/robotframework/source/detail?r=1f61aa4e7a09

Modified:
 /atest/robot/running/long_error_messages.txt

=======================================
--- /atest/robot/running/long_error_messages.txt        Tue Sep 21 09:10:39 2010
+++ /atest/robot/running/long_error_messages.txt        Sat Jan  5 09:30:07 2013
@@ -27,15 +27,15 @@
Has Been Cut 3121 x 1 Message Over The Limit .*${3DOTS}\\n ${3DOTS}.*\\n

 Multiple Short Errors
-    ${test} =  Has Been Cut  ${TESTNAME}
-    Should Be Equal  ${test.message.count('\n')}  ${40}
-
+    ${tc} =  Has Been Cut  ${TESTNAME}
+    Should Contain X Times  ${tc.message}  \n  40
+
 Two long errors
-    ${test} =  Has Been Cut  ${TESTNAME}
-    Should Be Equal  ${test.message.count('\n')}  ${40}
- Should Be True ${test.message.startswith('Several failures occurred:\n\n1) ContinuableApocalypseException: 1')} - Should Be True ${test.message.endswith('1961~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2000')}
-
+    ${tc} =  Has Been Cut  ${TESTNAME}
+    Should Contain X Times    ${tc.message}    \n    40
+ Should Start With ${tc.message} Several failures occurred:\n\n1) ContinuableApocalypseException: 1 + Should End With ${tc.message} 1961~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2000
+

 *** Keywords ***
 Has Been Cut

==============================================================================
Revision: 38743eedb3df
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 10:00:38 2013
Log:      Test long errors with suite setups/teardowns.

Update issue 1307
Also tested that long error messages are cut correctly.
http://code.google.com/p/robotframework/source/detail?r=38743eedb3df

Added:
 /atest/testdata/core/long_suite_setup_and_teardown_errors.txt
Modified:
 /atest/robot/core/suite_setup_and_teardown.txt

=======================================
--- /dev/null
+++ /atest/testdata/core/long_suite_setup_and_teardown_errors.txt Sat Jan 5 10:00:38 2013
@@ -0,0 +1,21 @@
+*** Settings ***
+Suite Setup       Long Error    setup
+Suite Teardown    Long Error    teardown
+
+*** Variables ***
+${CUT} \\[ Message content over the limit has been removed\\. \\]
+
+*** Test Cases ***
+Test
+    [Documentation]    FAIL REGEXP:
+    ...    Setup of the parent suite failed:
+    ...    (setup\\n){20} {4}${CUT}\\n(setup\\n){20}
+    ...    Also teardown of the parent suite failed:
+    ...    (teardown\\n){20} {4}${CUT}\\n(teardown\\n){19}teardown
+    No Operation
+
+*** Keywords ***
+Long Error
+    [Arguments]    ${where}
+    ${error} =    Evaluate    '${where}\\n' * 100
+    Fail    ${error}
=======================================
--- /atest/robot/core/suite_setup_and_teardown.txt      Sat Jan  5 09:18:38 2013
+++ /atest/robot/core/suite_setup_and_teardown.txt      Sat Jan  5 10:00:38 2013
@@ -136,6 +136,19 @@
Check Suite Status ${SUITE.suites[0]} FAIL ${1 FAIL MSG} Test 1 Check Suite Status ${SUITE.suites[1]} FAIL ${1 FAIL MSG} Test 2

+Long Error Messages
+    Run Tests    ${EMPTY}    core/long_suite_setup_and_teardown_errors.txt
+    ${setup} =    Evaluate    'setup\\n' * 20
+    ${teardown} =    Evaluate    'teardown\\n' * 20
+ ${explanation} = Set Variable [ Message content over the limit has been removed. ]\n
+    ${error} =    Catenate    SEPARATOR=\n
+    ...    Suite setup failed:
+    ...    ${setup}${SPACE * 4}${explanation}${setup}
+    ...    Also suite teardown failed:
+    ...    ${teardown}${SPACE * 4}${explanation}${teardown}
+    ...    ${1 FAIL MSG}
+    Check Suite Status    ${SUITE}    FAIL    ${error}    Test
+
 *** Keywords ***
 Check Suite Status
     [Arguments]    ${suite or name}    ${status}    ${message}    @{tests}

==============================================================================
Revision: 28f960dd354a
Branch:   default
Author:   Pekka Klärck
Date:     Sat Jan  5 10:15:33 2013
Log: Explicitly test that suite teardown errors are written to output.xml.

Update issue 1307
Status: Done
Explicitly testing that teardown errors are written to XML.

I consider this issue done.
http://code.google.com/p/robotframework/source/detail?r=28f960dd354a

Modified:
 /atest/robot/core/suite_setup_and_teardown.txt

=======================================
--- /atest/robot/core/suite_setup_and_teardown.txt      Sat Jan  5 10:00:38 2013
+++ /atest/robot/core/suite_setup_and_teardown.txt      Sat Jan  5 10:15:33 2013
@@ -63,14 +63,15 @@

 Failing Suite Teardown When All Tests Pass
     Run Tests    ${EMPTY}    core/failing_suite_teardown.txt
-    ${error} =    Catenate    SEPARATOR=
-    ...    Suite teardown failed:\n
-    ...    Several failures occurred:\n\n
-    ...    1) first\n\n
+    ${error} =    Catenate    SEPARATOR=\n\n
+    ...    Several failures occurred:
+    ...    1) first
     ...    2) second
-    Check Suite Status    ${SUITE}    FAIL    ${error}\n\n${2 FAIL MSG}
+    Check Suite Status    ${SUITE}    FAIL
+    ...    Suite teardown failed:\n${error}\n\n${2 FAIL MSG}
     ...    Test 1    Test 2
     Should Be Equal    ${SUITE.teardown.status}    FAIL
+    Output should contain teardown error    ${error}

 Failing Suite Teardown When Also Tests Fail
     Run Tests    ${EMPTY}    core/failing_suite_teardown_2.txt
@@ -78,6 +79,7 @@
     ...    Suite teardown failed:\nExpected failure\n\n${5 FAIL MSG}
... Test Passes Test Fails Setup Fails Teardown Fails Test and Teardown Fail
     Should Be Equal    ${SUITE.teardown.status}    FAIL
+    Output should contain teardown error    Expected failure

 Erroring Suite Teardown
     Run Tests    ${EMPTY}    core/erroring_suite_teardown.txt
@@ -85,6 +87,7 @@
... Suite teardown failed:\nNo keyword with name 'Non-Existing Keyword' found.\n\n${2 FAIL MSG}
     ...    Test 1    Test 2
     Should Be Equal    ${SUITE.teardown.status}    FAIL
+ Output should contain teardown error No keyword with name 'Non-Existing Keyword' found.

 Failing Suite Setup And Teardown
     Run Tests    ${EMPTY}     core/failing_suite_setup_and_teardown.txt
@@ -99,14 +102,10 @@
     ...    Test 1    Test 2
     Should Be Equal    ${SUITE.setup.status}    FAIL
     Should Be Equal    ${SUITE.teardown.status}    FAIL
+    Output should contain teardown error    Teardown failure\nin two lines

 Failing Higher Level Suite Teardown
     Run Tests    ${EMPTY}    core/failing_suite_teardown_dir
-    ${error} =    Catenate    SEPARATOR=
-    ...    Teardown of the parent suite failed:\n
-    ...    Failure in top level suite teardown\n\n
-    ...    Also teardown of the parent suite failed:\n
-    ...    Failure in suite teardown
     Check Suite Status    ${SUITE}    FAIL
... Suite teardown failed:\nFailure in top level suite teardown\n\n${12 FAIL MSG} ... PTD Passing PTD Failing FTD Passing FTD Failing PTD PTD Passing
@@ -128,6 +127,7 @@
... Suite teardown failed:\nFailure in suite teardown\n\n${2 FAIL MSG}
     ...    FTD FTD Passing    FTD FTD Failing

+
 Failing Higher Level Suite Setup
     Run Tests    ${EMPTY}    core/failing_higher_level_suite_setup
     Check Suite Status    ${SUITE}    FAIL
@@ -158,3 +158,9 @@
     Should Be Equal    ${suite.status}    ${status}    Wrong suite status
Should Be Equal ${suite.full_message} ${message} Wrong suite message
     Check Suite Contains Tests    ${suite}    @{tests}
+
+Output should contain teardown error
+    [Arguments]    ${error}
+    ${keywords} =    Get Elements    ${OUTFILE}    suite/kw
+    Element Text Should Be    ${keywords[-1]}    ${error}    xpath=status
+

Reply via email to