Clone the world parameters before creating each world instance. This prevents user code that updates the world parameters from leaking those changes across different test cases.
Also, type the worldParameters as JsonObject in configuration to enforce it should be JSON serialisable.
It would have been nice to somehow ensure immutability even between hooks/steps in the same test case. But realistically, users can have custom world instances, they can do what they want with the parameters object they are passed, so there's only so much we can do as the orchestrator.
⚡️ What's your motivation?
Fixes #2356
🏷️ What kind of change is this?
:bug: Bug fix (non-breaking change which fixes a defect)
coverage: 98.383%. remained the same
when pulling e0936026a65734547ca72bd844880814f4011e1e on fix/world-parameters-immutable
into 052ac1abf33824b954f2524d610e370e81a02db1 on main.
🤔 What's changed?
Clone the world parameters before creating each world instance. This prevents user code that updates the world parameters from leaking those changes across different test cases.
Also, type the
worldParameters
asJsonObject
in configuration to enforce it should be JSON serialisable.It would have been nice to somehow ensure immutability even between hooks/steps in the same test case. But realistically, users can have custom world instances, they can do what they want with the
parameters
object they are passed, so there's only so much we can do as the orchestrator.⚡️ What's your motivation?
Fixes #2356
🏷️ What kind of change is this?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.