gitlabartillerygitlab-ci.yml

/bin/sh: eval: line 125: /home/node/artillery/bin/artillery: not found when running the Artillery's sample .gitlab-ci.yml on CI/CD


I am a beginner and I want to try to integrate Artillery on Gitlab CI/CD, so I looked for Artillery's documentation and found the steps on how to do it. I followed the instructions and use this sample configuration found in the documentation:

artillery:
  image:
    name: artilleryio/artillery:latest
    entrypoint: [""]
  script: |
    mkdir reports
    /home/node/artillery/bin/artillery run --output reports/report.json tests/performance/socket-io.yml
    /home/node/artillery/bin/artillery report --output reports/report reports/report.json
  artifacts:
    paths:
      - reports

source: https://www.artillery.io/docs/guides/integration-guides/gitlab-ci-cd

I committed the file and the pipeline starts to run, but after awhile it failed and the error was:

Error: /bin/sh: eval: line 125: /home/node/artillery/bin/artillery: not found

Here's the full log:

Running with gitlab-runner 15.3.0~beta.42.gdb7789ca (db7789ca)
  on blue-4.shared.runners-manager.gitlab.com/default J2nyww-s
Preparing the "docker+machine" executor
Using Docker executor with image artilleryio/artillery:latest ...
Pulling docker image artilleryio/artillery:latest ...
Using docker image sha256:27f94fdd50befb4a245e7352f51747330c3b05922133681869c822460f9065a2 for artilleryio/artillery:latest with digest artilleryio/artillery@sha256:1637c7dd4ed15020612faef63f7e0be6200634c7336ad1bf5b60bab4b5f797b0 ...
Preparing environment
00:02
Running on runner-j2nyww-s-project-38396163-concurrent-0 via runner-j2nyww-s-shared-1660008636-37f7076a...
Getting source from Git repository
00:02
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/trial304/artillery-load-test/.git/
Created fresh repository.
Checking out 51807ad5 as main...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:01
Using docker image sha256:27f94fdd50befb4a245e7352f51747330c3b05922133681869c822460f9065a2 for artilleryio/artillery:latest with digest artilleryio/artillery@sha256:1637c7dd4ed15020612faef63f7e0be6200634c7336ad1bf5b60bab4b5f797b0 ...
$ mkdir reports # collapsed multi-line command
/bin/sh: eval: line 125: /home/node/artillery/bin/artillery: not found
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 127

I've been looking for an answer anywhere, but I can't find any solution to fix the pipeline error. Your inputs are very welcome, thank you!


Solution

  • if you run this, you can get a shell so that you can view the contents of directories:

    docker run -it --rm --entrypoint /bin/sh artilleryio/artillery:latest
    

    Looking at the contents of that directory, I believe what you are looking for is the run command:

    /home/node/artillery/bin/run
    

    You can view available command by running run -h. So I believe you are wanting this:

    /home/node/artillery/bin/run run --output reports/report.json tests/performance/socket-io.yml
    /home/node/artillery/bin/run report --output reports/report reports/report.json