grafana / xk6-ts

TypeScript support for k6
GNU Affero General Public License v3.0
17 stars 3 forks source link

--out option is not supported #6

Closed pablochacin closed 2 months ago

pablochacin commented 2 months ago

Running a test with the --out option fails with a no such file error

k6 run script.ts --out json=/tmp/output.json
FATA[0000]    error="open json=/tmp/output.json: no such file or directory"
szkiba commented 2 months ago

The xk6-ts integrates k6pack library (esbuild based lib) into k6 run command. The integration a bit hacky, and temporal. One of the assumptions is that flags preceding the positional arg (script name in this case). So this is why there is a problem with this kind of "flag after positional arg" usage. I recommend reordering the command line as a quick workaround. I'm not sure is it worth to fix the current hack argument handling, since the real integration will not use it.

pablochacin commented 2 months ago

I would recommend documenting as a warning that the script must be the last argument in the CLI

szkiba commented 2 months ago

Thank you @pablochacin , a compatibility warning added to README.