How to attach data file to script to run in Cloud?

Hi,
for local run we are giving data file path and running in local as below:
const csvData = papaparse.parse(open(’\data.csv’), { header: true }).data;

How to attach same data file to script to run in cloud?

Thanks

Hi @huligesh.hanumanthap,

Running k6 cloud script.js instead of k6 run script.js should do it automatically. You of course need to first login into the cloud with k6 login cloud.

Some relevant documentation can be found here.

And you can also reach out to the support team within the app by clicking on "support’ on the bottom of the left menu.

Hi @mstoykov,
Thanks for your time, actually I am trying as below.

I logged in to app.k6.io and ran script from Ashburn location and got below error message:
TEST ERROR DETAIL: GoError: stat /tmp/cTn49c/Username.csv: no such file or directory at github.com/loadimpact/k6/js/common.Bind.func1 (native).

Please note, I have copied script.js to new script in app.k6.io and ran script.

Thanks

Yes - this won’t work as you will also need to upload the data file, possibly even specifying that it is in some directory or something. While for 1 file this might work, doing to for a bunch is probably going to be a nightmare. Which is why k6 cloud script.js just does all of that automatically.

Do you have something that prevents you from using the cli app like that?