Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Programmatically re-running failed tests prevents subsequent Robot and Rebot usage in same process #2437

Closed
@krizex

Description

@krizex

When we use RobotFramework.main to execute test suites, we get a output.xml result file, then we use RobotFramework.main and the output.xml to rerun the failed cases in the same process, we get the second result file, naming it output_rerun.xml. After that, we use rebot api to merge the output.xml and output_rerun.xml to one result file, naming output_all.xml. We find that output_all.xml just contains the execution result of the failed cases.

So we checked the source code of robotframework, and we found the error code in robot/conf/settings.py:83
image

We found that code will change the default value of the items of _BaseSettings._cli_opts.
The root cause of this issue is self['TestNames'] and _BaseSettings._cli_opts['TestNames'][1] reference the same list, when execute self['TestNames'] += self['ReRunFailed'], equal to change the value of _BaseSettings._cli_opts['TestNames'][1]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions