diff --git a/cumulusci/tasks/robotframework/robotframework.py b/cumulusci/tasks/robotframework/robotframework.py index fb8cd61683..5b3b54ec67 100644 --- a/cumulusci/tasks/robotframework/robotframework.py +++ b/cumulusci/tasks/robotframework/robotframework.py @@ -14,7 +14,11 @@ TaskOptionsError, ) from cumulusci.core.tasks import BaseTask -from cumulusci.core.utils import process_bool_arg, process_list_arg +from cumulusci.core.utils import ( + process_bool_arg, + process_list_arg, + process_list_of_pairs_dict_arg, +) from cumulusci.robotframework.utils import set_pdb_trace from cumulusci.tasks.robotframework.debugger import DebugListener from cumulusci.tasks.salesforce import BaseSalesforceTask @@ -113,7 +117,11 @@ def _init_options(self, kwargs): self.options["vars"] = [] # Initialize options as a dict - if "options" not in self.options: + if "options" in self.options: + self.options["options"] = process_list_of_pairs_dict_arg( + self.options["options"] + ) + else: self.options["options"] = {} # processes needs to be an integer. diff --git a/cumulusci/tasks/robotframework/tests/test_robotframework.py b/cumulusci/tasks/robotframework/tests/test_robotframework.py index c1a4f2ab8a..9c81506e5f 100644 --- a/cumulusci/tasks/robotframework/tests/test_robotframework.py +++ b/cumulusci/tasks/robotframework/tests/test_robotframework.py @@ -88,6 +88,16 @@ def test_list_args(self): for option in ("test", "include", "exclude", "vars", "suites", "skip"): assert isinstance(task.options[option], list) + def test_options_converted_to_dict(self): + task = create_task( + Robot, + { + "suites": "test", # required, or the task will raise an exception + "options": "outputdir:/tmp/example,loglevel:DEBUG", + }, + ) + assert isinstance(task.options["options"], dict) + def test_process_arg_requires_int(self): """Verify we throw a useful error for non-int "processes" option"""