I would be interested to create a shared project in my company github’s repo with a file structure that has shared files in a common folder and specific folders per team. This would allow every team to drop their scenarios (or .js file) to add to a mixed traffic test. I am working on it now. I would like to have a JS Object that build the “options” parameter so that every dropped .js file could be added with a given configuration. However I am not sure how I can set the “exec” parameter if the test function isn’t in the same file. When I try then I get a goja error since function can be a JSON element.
Is it possible to do that and if so, any pointer for me please?
I am not sure what you mean by “function can be a JSON element”, but you can re-export the function used in the imported file and adjust the scenario’s exec option to the new name. This will be easier once we have https://github.com/loadimpact/k6/issues/1342 implemented, but you should still be able to achieve most of what you want with k6 today.
Take a look and if you have any more questions, please submit a simplified example with 1 or 2 dummy files that doesn’t do what you expect it to do, so we can give concrete suggestions for fixes.