I wish to run scenarios where I first set up the users, data sources, etc. in the system. This setup is typically external to the k6 run.
This follows by running k6 with parallel scenarios ramping up various numbers of these pre-existing users, datasources, etc. as different types of VU’s. For this, I need to be able to read the config of the existing users and assign a separate config to each VU. Optimally, I would be able to share a some list of available users/data source/etc and just pick an available config for a new VU.
However, I do not see any way to share data across VU’s. Is this possible?
If not (I see there is 2+ years old open Github issue one this), is it possible to get the VU “index” value within the scenario? Right now, I believe the set of VU’s is global, and picking a specific list item for the data sources, users, or whatever is not possible as I have no idea what user id 10 is in the context of overall VU’s (maybe VU 7 is a data source, so index 10 is off by one for users, for example).
Shared state would allow me to address all these nicely by just reading a list of available types and picking one when the list is non-empty.
If this is not possible at this time, do you have any suggestion to address this need?