0

I am trying to execute my k6 tests with docker-compose and then visualise the results in grafana. I have started my containers and then tried editing the command given in the documentation:

docker-compose run -v     \$PWD/samples:/scripts \k6 run     /scripts/es6sample.js

but I keep receiving errors and I am struggling to understand the pattern needed for the command. I want to run the test.js file in the screenshot below: Repo format

The error I am receiving is:

ERROR: for k6_k6_run  Cannot create container for service k6: invalid volume specification: '/Documents/practice_k6/k6/tests:tests:rw': invalid mount config for type "bind": invalid mount path: 'tests' mount path must be absolute

ERROR: for k6  Cannot create container for service k6: invalid volume specification: '/Documents/practice_k6/k6/tests:tests:rw': invalid mount config for type "bind": invalid mount path: 'tests' mount path must be absolute
ERROR: Encountered errors while bringing up the project.
Eoins-MacBook-Air:k6 eoincorr$ 
aRvi
  • 2,203
  • 1
  • 14
  • 30
Eoin Corr
  • 75
  • 2
  • 8

2 Answers2

0

For anyone interested I found the issue, it was in the volumes within docker-compose.yml file. The volumes in K6 had been entered incorrectly tests:tests instead of tests:/tests

Eoin Corr
  • 75
  • 2
  • 8
0

One Could refer to the document i have created here for using the docker-compose setup.

Jeeva
  • 438
  • 4
  • 12