Skip to content

Commit a8f69f7

Browse files
committed
Restore original behavior to override the exiting robot_output.xml. Set environment variable ROBOTSUITE_APPEND_OUTPUT_XML=1 to append test results to the existing robot_output.xml.
1 parent 81d250b commit a8f69f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/robotsuite/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import unittest2 as unittest
2323
from lxml import etree
2424

25+
append_output_xml = bool(os.environ.get('ROBOTSUITE_APPEND_OUTPUT_XML'))
2526

2627
last_status = None
2728
last_message = None
@@ -347,8 +348,13 @@ def runTest(self):
347348
data = re.sub('(href|src)="([^"]+\.png)"',
348349
'\\1="%s\\2"' % prefix, data)
349350

350-
# Try to merge the new 'output.xml' into the previous one
351-
if os.path.exists('robot_output.xml'):
351+
# Try to merge the second 'output.xml' into the first one or into the
352+
# final one from the previous test run when requested by setting
353+
# environment variable ROBOTSUITE_PRESERVE_OUTPUT_XML
354+
global append_output_xml
355+
if not append_output_xml:
356+
append_output_xml = True
357+
elif os.path.exists('robot_output.xml'):
352358
with open('robot_output.xml') as handle:
353359
merged_output = etree.fromstring(handle.read())
354360
try:

0 commit comments

Comments
 (0)