Skip to content

--legacy-output does not work with Rebot when combining, merging or filtering results #5012

Closed

Description

@emakaay

Because robot scripts are not always stable, due to infrastructural problems, we use a script to perform failing tests with a maximum of 3 times. Until tests are run ok... or eventually fail.

This will generate several output.xml which are combined into a single output.xml (report.html and log.html) using rebot.
Until Robotframework v6.1.1 this was working fine. I started to use version 7.0 and used the option --legacyoutput with both robot and rebot.

When I combine MORE THEN one output,xl, rebot will fail:
`
rebot --legacyoutput --merge --outputdir --output output.xml firstoutput.xml secondoutput.xml

[ ERROR ] Unexpected error: AttributeError: 'NoneType' object has no attribute 'isoformat'
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\robot\utils\application.py", line 81, in _execute
rc = self.main(arguments, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\robot\rebot.py", line 340, in main
rc = ResultWriter(*datasources).write_results(settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\robot\reporting\resultwriter.py", line 57, in write_results
self._write_output(results.result, settings.output, settings.legacy_output)
File "C:\Python311\Lib\site-packages\robot\reporting\resultwriter.py", line 71, in _write_output
self._write('Output', result.save, path, legacy_output)
File "C:\Python311\Lib\site-packages\robot\reporting\resultwriter.py", line 84, in _write
writer(path, *args)
File "C:\Python311\Lib\site-packages\robot\result\executionresult.py", line 154, in save
self.visit(writer(target, rpa=self.rpa))
File "C:\Python311\Lib\site-packages\robot\result\executionresult.py", line 168, in visit
visitor.visit_result(self)
File "C:\Python311\Lib\site-packages\robot\result\visitor.py", line 44, in visit_result
result.suite.visit(self)
File "C:\Python311\Lib\site-packages\robot\model\testsuite.py", line 420, in visit
visitor.visit_suite(self)
File "C:\Python311\Lib\site-packages\robot\model\visitor.py", line 131, in visit_suite
suite.suites.visit(self)
File "C:\Python311\Lib\site-packages\robot\model\itemlist.py", line 102, in visit
item.visit(visitor) # type: ignore
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\robot\model\testsuite.py", line 420, in visit
visitor.visit_suite(self)
File "C:\Python311\Lib\site-packages\robot\model\visitor.py", line 131, in visit_suite
suite.suites.visit(self)
File "C:\Python311\Lib\site-packages\robot\model\itemlist.py", line 102, in visit
item.visit(visitor) # type: ignore
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\robot\model\testsuite.py", line 420, in visit
visitor.visit_suite(self)
File "C:\Python311\Lib\site-packages\robot\model\visitor.py", line 131, in visit_suite
suite.suites.visit(self)
File "C:\Python311\Lib\site-packages\robot\model\itemlist.py", line 102, in visit
item.visit(visitor) # type: ignore
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\robot\model\testsuite.py", line 420, in visit
visitor.visit_suite(self)
File "C:\Python311\Lib\site-packages\robot\model\visitor.py", line 135, in visit_suite
self.end_suite(suite)
File "C:\Python311\Lib\site-packages\robot\output\xmllogger.py", line 375, in end_suite
self._write_status(suite)
File "C:\Python311\Lib\site-packages\robot\output\xmllogger.py", line 444, in _write_status
'starttime': self._datetime_to_timestamp(item.start_time),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\robot\output\xmllogger.py", line 432, in _datetime_to_timestamp
return dt.isoformat(' ', timespec='milliseconds').replace('-', '')
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'isoformat'
`

Is it something I'm doing wrong ? I found it confusing that the documentation & release notes mention the option "--legacy-output", but both robot.exe --help and rebot --help, only have the option "--legacyoutput" (without -).

Activity

  1. changed the title [-]Possible problem with rebot(robotframework 7.0) when more the 1 output.xml files are turned into a single report[/-] [+]`--legacy-output` does not work with Rebot when combining or merging results[/+] on Jan 12, 2024
  2. pekkaklarck commented on Jan 12, 2024

    @pekkaklarck
    Member

    This is a bug with --legacy-output that can be reproduced also if combining results without the --merge option. In these cases all suites don't have start and end times, and that is not handled correctly.

    This is pretty severe issue, but I don't think it requires an urgent bug fix release. I'd like to wait at least a week to see are there other issues that need to be fixed.

  3. added this to the v7.0.1 milestone on Jan 12, 2024
  4. emakaay commented on Jan 12, 2024

    @emakaay
    Author

    I agree an urgent bug fix is not required.
    | would like to note that the option "--legacy-output" is not visible when running robot --help or rebot --help.
    Then only the option --legacyoutput (without the dash) is visible. are both options available ? or is this a bug in the documentation ?

  5. pekkaklarck commented on Jan 12, 2024

    @pekkaklarck
    Member

    --legacyoutput, --legacy-output and also --LegacyOutput are all the same. These long options have been case-insensitive for a long time, and in RF 6.1 (#4547) we made them also hyphen-insensitive.

  6. self-assigned this
    on Jan 31, 2024
  7. changed the title [-]`--legacy-output` does not work with Rebot when combining or merging results[/-] [+]`--legacy-output` does not work with Rebot when combining, merging or filtering results[/+] on Jan 31, 2024
  8. pekkaklarck commented on Jan 31, 2024

    @pekkaklarck
    Member

    The problem occurs also if filtering results like:

    rebot  --test Example --legacy-output --output filtered.xml original.xml
    

    Fixed now and fix will be included in RF 7.0.1 that will be released in the near future.

  9. added a commit that references this issue on Jan 31, 2024
    f21817f
  10. alangefe commented on Feb 20, 2024

    @alangefe

    @pekkaklarck , do you have a schedule as to when RF 7.0.1 will be released? I would like to use some of the RF 7 features, but cannot until the --legacy-output flag is working properly due to external tools outside of my control that have not been fixed to handle the new output format.

  11. amgads commented on May 31, 2024

    @amgads

    @pekkaklarck -- we have the same issue and would like to use 7.0.1 as the plugin issue is breaking our automation testing and results -- when is the release date.

  12. pekkaklarck commented on May 31, 2024

    @pekkaklarck
    Member

    7.0.1 has been delayed due to my paternity leave, but I hope we get at leasya release candidate out this weekend or early next week.

  13. amgads commented on May 31, 2024

    @amgads
  14. pekkaklarck commented on Jun 1, 2024

    @pekkaklarck
    Member

    Pre-releases are installed with pip but require the --pre option. We just need to get the rc out first.

  15. amgads commented on Jun 1, 2024

    @amgads
  16. pekkaklarck commented on Jun 4, 2024

    @pekkaklarck
    Member

    RF 7.0.1 rc 1 with this fix has just been released. It would be great if you could test does the fix work properly before the final release that's targeted for Monday June 10.

  17. emakaay commented on Jun 4, 2024

    @emakaay
    Author
  18. amgads commented on Jun 5, 2024

    @amgads
  19. pekkaklarck commented on Jun 7, 2024

    @pekkaklarck
    Member

    Thanks for testing @amgads!

  20. added theissue type on Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions