Dynamic Payload - Files from Nested Paths


Looking to get my feet wet w/ k6 for an application that I own. The main component I’m wanting to load test takes the stringified body of a Nomad HCL file. There is a repo that has nested folders that may contain HCL files, each of these I’d like to be able to use as a potential payload.

For example, the repo may look like this:


I’d like to setup a k6 load test that finds all of the HCL files in all of these directories and sends them as a payload to my service.

I’ve seen some older examples of k6 using a module called k6/fs, but it’s replacement (at least based on the docs and messaging I get from trying it), k6/experimental/fs doesn’t seem to match the functionality I’d need, though I am happy to be wrong :slight_smile:

Ahh ok. I kept looking for a solution, and I believe I’ve got my answer :slight_smile:

I found this thread which indicates that what I want is not natively possible in k6 at the time of writing. There are some workarounds, which I’ll try for now.

In the above mentioned thread though, there is an open GH issue that discusses potential inclusion of such features in k6. It has been open since 2019 though so… guess I’ll keep my fingers crossed!