Repository: mkorpela/pabot

Issue:
pabot fails during merge restult with robot 6.1b1
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. 

Discussion:

Patch:
diff --git a/src/pabot/pabot.py b/src/pabot/pabot.py
index c174b35..8738db2 100644
--- a/src/pabot/pabot.py
+++ b/src/pabot/pabot.py
@@ -1258,6 +1258,7 @@ def _options_for_rebot(options, start_time_string, end_time_string):
         "maxassignlength",
         "maxerrorlines",
         "monitorcolors",
+        "parser",
         "prerunmodifier",
         "quiet",
         "randomize",
diff --git a/src/pabot/result_merger.py b/src/pabot/result_merger.py
index 169d7a7..e7ab827 100644
--- a/src/pabot/result_merger.py
+++ b/src/pabot/result_merger.py
@@ -56,7 +56,7 @@ class ResultMerger(SuiteVisitor):
         try:
             self._set_prefix(merged.source)
             merged.suite.visit(self)
-            self.root.metadata._add_initial(merged.suite.metadata)
+            self.root.metadata.update(merged.suite.metadata)
             if self.errors != merged.errors:
                 self.errors.add(merged.errors)
         except:


Test patch:
diff --git a/tests/test_pabot.py b/tests/test_pabot.py
index 703f7a9..c60c743 100644
--- a/tests/test_pabot.py
+++ b/tests/test_pabot.py
@@ -1045,6 +1045,7 @@ class PabotTests(unittest.TestCase):
                 "prerunmodifier",
                 "monitorcolors",
                 "language",
+                "parser",
             ]:
                 self.assertFalse(key in options, "%s should not be in options" % key)
             else: