mkorpela / pabot

Parallel executor for Robot Framework test cases.
https://pabot.org
Apache License 2.0
476 stars 152 forks source link

pabot fails during merge restult with robot 6.1b1 #533

Closed oboehmer closed 1 year ago

oboehmer commented 1 year ago

A simple pabot execution fails with Robot 6.1b1 which was released yesterday. Robot 6.1a1 as well as 6.0.x works fine:

(v) $ cat /tmp/test.robot
*** Test Cases ***
simple test
    Should be True   1==1
(v)$ pabot /tmp/test.robot
2023-05-06 12:53:05.505201 [PID:46369] [0] [ID:0] EXECUTING Test
2023-05-06 12:53:06.032115 [PID:46369] [0] [ID:0] PASSED Test in 0.5 seconds
Error while merging result ./pabot_results/0/output.xml
[ERROR] EXCEPTION RAISED DURING PABOT EXECUTION
[ERROR] PLEASE CONSIDER REPORTING THIS ISSUE TO https://github.com/mkorpela/pabot/issues
Pabot: 2.15.0
Python: 3.9.6 (default, Mar 10 2023, 20:16:38)
[Clang 14.0.3 (clang-1403.0.22.14.1)]
Robot Framework: 6.1b1
Total testing: 0.50 seconds
Elapsed time:  0.64 seconds
Traceback (most recent call last):
  File "/tmp/v/bin/pabot", line 8, in <module>
    sys.exit(main())
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/pabot.py", line 1875, in main
    return sys.exit(main_program(args))
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/pabot.py", line 1926, in main_program
    result_code = _report_results(
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/pabot.py", line 1420, in _report_results
    return _report_results_for_one_run(
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/pabot.py", line 1451, in _report_results_for_one_run
    output_path = _merge_one_run(
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/pabot.py", line 1488, in _merge_one_run
    resu = merge(
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/result_merger.py", line 254, in merge
    merged = merge_groups(
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/result_merger.py", line 233, in merge_groups
    merger.merge(out)
  File "/private/tmp/v/lib/python3.9/site-packages/pabot/result_merger.py", line 59, in merge
    self.root.metadata._add_initial(merged.suite.metadata)
AttributeError: 'Metadata' object has no attribute '_add_initial'

This looks to be caused by the commit https://github.com/robotframework/robotframework/commit/afcbbffd41c479e262260e858f62c77772419d8b which removed the private NormalizedDict._add_initial method referenced by pabot.

pekkaklarck commented 1 year ago

NormalizedDict._add_initial() was removed in favor of going through initial values in NormalizedDict.__init__. Pabot should call update() instead. Looking at NormalizedDict code we should actually that in __init__ as well.

Although _add_initial() was a private method and removing them ought to be fine also in non-major releases (especially when there's a stable API available), we can add it back until RF 7 if needed. Based on investigation by @oboehmer on Slack, there is also some issue caused by the new parser option, so probably a new Pabot release is needed anyway.