无法读取炮弹脚本文件中的CSV文件

凯尔·巴克(Kyle Bak)

我正在执行微服务的负载测试,并在使用Artillery时遇到问题读取csv文件时脚本失败。尝试从文件导入输入数据以创建json请求。

最简单的script.yml

config:
  target: "http://localhost:8080"
  phases:
    - duration: 1
      arrivalRate: 1
  payload:
    path: "input.csv"
    fields:
     - "flow"
scenarios:
  - flow:
     - log: "this yml log, flow: {{ flow }}"

同一文件夹中的input.csv文件:

"flow"
"SomeFlow"

用于执行的最简单的命令:

DEBUG=* artillery run script.yml

错误堆栈跟踪:

  artillery:cli Artillery Pro is not installed +0ms
  commands:run defaultOptions:  {
    "_": [
        "run",
        "script.yml"
    ]
} +4ms
/Users/someUser/node_modules/csv-parse/lib/index.js:124
          throw new Error(`Invalid Option: from_line must be a     positive integer greater than 0, got ${JSON.stringify(opts.from_line)}`)
      ^
Error: Invalid Option: from_line must be a positive integer greater     than 0, got at new Parser (/Users/someUser/node_modules/csv-    parse/lib/index.js:124:17)
    at parse (/Users/someUser/node_modules/csv-parse/lib/index.js:838:18)
    at readPayloadFile (/Users/someUser/node_modules/artillery/lib/commands/run.js:257:7)
    at /Users/someUser/node_modules/async/lib/async.js:356:13
    at async.forEachOf.async.eachOf (/Users/someUser/node_modules/async/lib/async.js:233:13)
    at _asyncMap (/Users/someUser/node_modules/async/lib/async.js:355:9)
    at Object.map (/Users/someUser/node_modules/async/lib/async.js:337:20)
    at readPayload (/Users/someUser/node_modules/artillery/lib/commands/run.js:245:9)
    at fn (/Users/someUser/node_modules/async/lib/async.js:746:34)
    at /Users/someUser/node_modules/async/lib/async.js:1213:16

最初,我认为这是Windows特定于平台的问题。然后在OSX上面临同样的问题。我肯定在这里错过了一些次要的和重要的事情。

patb23

似乎是最新版本的问题。当我降级到1.6.0-24时,它起作用了

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Bash-从与脚本文件相同目录中的文件读取

无法从其他脚本文件读取返回的Javascript对象

Bash脚本读取文本文件中的随机行

无法将脚本文件加载到另一个脚本文件中

无法在 Google Colab 中读取 csv 文件

如何编写文本文件,然后在相同的Bash脚本中读取文本文件?

无法从c中的文本文件中读取数据

专门读取脚本文件C#

Eclipse,无法读取Java类中的文本文件

无法读取Javascript中的文本文件

无法从C中的文本文件读取结构

无法在C中读取大型文本文件

在bash脚本中使用awk从文本文件中读取值时,我无法打印空行

什么是 ”#!' 在脚本文件中?

在 Azure ML Python 脚本中读取多个 CSV 文件

从 .csv 文件中读取值并使用 Shell 脚本执行计算

read.csv()警告:无法读取R中的csv文件

无法在Python 3.3中打开文本文件(CSV)

awk在python脚本中调用响应文件无法打开/读取

PHP 文件没有读取我的 js 脚本文件

无法使用SchemaExport生成脚本文件

无法在jenkins中生成脚本文件

Jenkins错误无法生成脚本文件

Eclipse中无法读取src文件夹中的文本文件

无法在 Python 中读取 Unix 中存在的 csv 文件

无法在java中读取文本文件(视为空文件)

如何从批处理脚本中单个变量的文本文件中读取所有内容?

从仪器javascript脚本中的数据库或文本文件中读取数据

读取 csv 文件和文本文件的区别?