代码之家  ›  专栏  ›  技术社区  ›  Nital

无法在现有API上运行Taurus性能测试

  •  1
  • Nital  · 技术社区  · 6 年前

    安装后 Taurus 在Win 10机器上创建新文件以测试我的API的性能:

    性能测试配置。yml公司

    execution:
    - concurrency: 100
      ramp-up: 1m
      hold-for: 2m
      scenario: helloworld-api-perf-test
    
    scenarios:
      quick-test:
        requests:
        - https://helloworld-api.cfapps.io
    

    我在日志中发现以下错误:

    错误日志:

    > bzt perf-test-config.yml
    15:32:18 INFO: Taurus CLI Tool v1.11.0
    15:32:18 INFO: Starting with configs: ['perf-test-config.yml']
    15:32:18 INFO: Configuring...
    15:32:18 INFO: Artifacts dir: C:\Users\chandeln\MY-WORK\helloworld-api\2018-03-29_15-32-18.609453
    15:32:18 WARNING: at path 'execution.0.scenario': scenario 'helloworld-api-perf-test' is used but isn't defined
    15:32:18 INFO: Preparing...
    15:32:19 WARNING: Could not find location at path: helloworld-api-perf-test
    15:32:19 ERROR: Config Error: Scenario 'helloworld-api-perf-test' not found in scenarios: dict_keys(['quick-test'])
    15:32:19 INFO: Post-processing...
    15:32:19 INFO: Artifacts dir: C:\Users\chandeln\MY-WORK\helloworld-api\2018-03-29_15-32-18.609453
    15:32:19 WARNING: Done performing with code: 1
    
    2 回复  |  直到 6 年前
        1
  •  2
  •   Ori Marko    6 年前

    如中所示 taurus User Manual scenario 执行中也应 scenarios 例如:

    execution:
    - concurrency: 100
      ramp-up: 1m
      hold-for: 2m
      scenario: helloworld-api-perf-test
    
    scenarios:
      helloworld-api-perf-test:
        requests:
        - https://helloworld-api.cfapps.io
    
        2
  •  1
  •   Dmitri T    6 年前

    你只有 quick-test 在“场景”字典和“执行”块中,您试图调用名为 helloworld-api-perf-test

    因此,选项包括:

    1. 改变 scenario: helloworld-api-perf-test scenario: quick-test
    2. 改变 quick-test: helloworld-api-perf-test:

    更多信息:

    1. Taurus Configuration Syntax
    2. Navigating your First Steps Using Taurus
    推荐文章