Warn on access to the exported script options
instead of test.options
in k6/execution
#2601
Labels
evaluation needed
proposal needs to be validated or tested before fully implementing it in k6
js-compat
ux
From https://github.com/grafana/k6/pull/2571/files#r921222735
There are various issues when scripts try to access the exported script
options
from the script. #2571 fixes one bug/undefined behavior, but there are a few other subtle problems.I think it would be relatively easy to make this into a
DynamicObject
that prints a warning if anyone tries to access any of the properties? 🤔We can warn people (with a
sync.Once
, to limit spam) to usetest.options
fromk6/execution
for read (i.e.Get()
, Keys() andHas
()) operations. And also warn (with anothersync.Once
) them that modifying theoptions
(i.e. onSet()
andDelete()
) during the script runtime is useless and won't actually affect anything during the script execution.The text was updated successfully, but these errors were encountered: