Skip to content
Snippets Groups Projects
Commit fd3eb9b8 authored by ml bonhomme's avatar ml bonhomme :bee:
Browse files

no updating self.config

parent b65d2e9e
No related branches found
No related tags found
1 merge request!172update self.config with default user_configuration values
Pipeline #79240 passed
This commit is part of merge request !172. Comments created here will be created in the context of that merge request.
...@@ -171,12 +171,12 @@ class BaseWorker(object): ...@@ -171,12 +171,12 @@ class BaseWorker(object):
) )
self.config = worker_version["configuration"]["configuration"] self.config = worker_version["configuration"]["configuration"]
if "user_configuration" in worker_version["configuration"]: if "user_configuration" in worker_version["configuration"]:
# Add default values (if set) from user configurable parameters to the base configuration # Add default values (if set) to user_configuration
for key, value in worker_version["configuration"][ for key, value in worker_version["configuration"][
"user_configuration" "user_configuration"
].items(): ].items():
if "default" in value: if "default" in value:
self.config.update({key: value["default"]}) self.user_configuration.update({key: value["default"]})
self.worker_details = worker_version["worker"] self.worker_details = worker_version["worker"]
required_secrets = worker_version["configuration"].get("secrets", []) required_secrets = worker_version["configuration"].get("secrets", [])
elif self.args.config: elif self.args.config:
......
...@@ -211,9 +211,8 @@ def test_configure_user_configuration_defaults( ...@@ -211,9 +211,8 @@ def test_configure_user_configuration_defaults(
) )
worker.configure() worker.configure()
assert worker.config == { assert worker.config == {"param_1": "/some/path/file.pth", "param_2": 12}
"param_1": "/some/path/file.pth", assert worker.user_configuration == {
"param_2": 12,
"param_3": "Animula vagula blandula", "param_3": "Animula vagula blandula",
"param_5": True, "param_5": True,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment