Hi,
I’m currently running a very basic K6 test script, and I’m able to see the response body if I use console.log().
However, it’s a very extensive load test I’m preparing and I need to save all the responses I get to a file, for future analysis.
I’ve currently tried the solutions mentioned in the following posts:
When using docker-compose run k6 run --logformat raw tests.js --console-output=./test.csv it only works on windows but not Ubuntu(Unix/linux) system. docker-compose run -u "$(id -u):$(id -g)" k6 run --logformat raw --console-output=/scripts/test.csv /scripts/stages.js gives test.csv permission denied
I’ve also tried k6 run test.js 2>responses.csv and different file names, the output file turns out to be empty at the moment. I was logging the response as console.log() and alternatively as console.debug() docker-compose run k6 run --logformat raw --http-debug=full tests.js 2>test.csv
Also returned an empty file.
Is there any way to be able to save the raw responses we get from a request.
Would also be helpful if we can save responses to influxdb
I tried following: docker-compose run -v test_output:/var/opt/project k6 run --logformat raw /scripts/ewoks.js --console-output=var/opt/internal/consoleoutput.txt
and got open /var/opt/project/consoleout.txt: permission denied
test_output is a new docker volume that I created.
also tried a local directory as bind mount, it gave permission denied
Update its working now, just needed a --user $UID tag for docker-compose SOLVED