pabot
pabot copied to clipboard
Having tests creating xml files in ${OUTPUT DIR} makes pabot return 252
If you have tests in your testcases which create xml files in ${OUTPUT DIR} pabot return 252 as return-code independent on if the tests actually fail or not.
so a simple test case which make pabot fail would be:
*** Settings ***
Library OperatingSystem
*** Test Cases ***
Store information to XML File
Create File ${OUTPUT DIR}${/}MESSAGES.xml <MESSAGES>Text</MESSAGES>
The second test in this example is of no interest for this problem, but for reference:
*** Test Cases ***
Just log "Nothing"
Log Nothing
the example result:
Reading XML source '.\pabot_results\0\MESSAGES.xml' failed: Incompatible XML element 'MESSAGES'.
Skipping '.\pabot_results\0\MESSAGES.xml' from final result
2 critical tests, 2 passed, 0 failed
2 tests total, 2 passed, 0 failed
===================================================
Output: C:\temp\output.xml
Log: C:\temp\log.html
Report: C:\temp\report.html
Total testing: 12.20 seconds
Elapsed time: 8.0 seconds
C:\temp>echo %ERRORLEVEL%
252
If the xml files is created in a subfolder of ${OUTPUT DIR} it works as expected though.
*** Settings ***
Library OperatingSystem
*** Test Cases ***
Store information to XML File
Create Directory ${OUTPUT DIR}${/}xmlout
Create File ${OUTPUT DIR}${/}xmlout${/}MESSAGES.xml <MESSAGES>Text</MESSAGES>
I guess the following change will be too simple...
def group_by_root(results, critical_tags, non_critical_tags, invalid_xml_callback):
groups = {}
for src in results:
if not src.endswith('output.xml'): #<- checking the filename will it work?
continue