You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GitLab CI/CD集成Artillery报错:/home/node/artillery/bin/artillery未找到

解决GitLab CI中Artillery路径找不到的问题

问题背景

在GitLab CI/CD中集成Artillery性能测试时,使用官方文档提供的配置,流水线运行失败,核心报错:

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

原因分析

Artillery官方Docker镜像(artilleryio/artillery:latest)的最新版本中,artillery可执行文件已被加入系统环境变量PATH,无需使用文档里的旧绝对路径调用;原文档中的/home/node/artillery/bin/artillery路径已不再适配当前镜像。

解决方案

修改CI配置的script部分,直接使用artillery命令即可:

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

可选验证步骤

若不确定命令路径,可在script中先添加which artillery查看实际路径,确认命令是否在PATH中:

script: |
  which artillery
  mkdir reports
  # ... 后续测试命令

内容的提问来源于stack exchange,提问作者yam09

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 19:27:33