I’m writing some file-upload tests for the past two days and this restriction of having open() “init code” really hurts. I want to have a big set of files, which I want to upload, but I cannot do it dynamically. I have to define each file in the code. I’m testing a document management system and it is all about files.
What I really need, is to iterate over those files in a directory and upload and run checks after each upload. So if you enable the function open to open directory and give me the list of the files, It will solve that issue. On the other hand you can deploy the whole directory to the cluster (the described reason of the open restriction: https://github.com/loadimpact/k6/issues/557)
Right now I execute k6 per file and iterate over the files in a bash script, but I don’t feel this is the right solution. I cannot execute in a parallel and upload multiple files at the same time. And open() is essential for uploading files. Alternative I’m thinking about uploading those files somewhere and use the http.get() endpoint and then upload tha content. This is more infrastructure work, but should work.
What do you think about?