詹金斯:无法 运行 编程“/Users/user/.jenkins/workspace/jenkinsjob/taurus-venv/bin/bzt error=2

Jenkins: Cannot run program "/Users/user/.jenkins/workspace/jenkinsjob/taurus-venv/bin/bzt error=2

我已经开始尝试本教程:https://dzone.com/articles/how-to-use-the-jenkins-performance-plugin,但我在使用本地 jenkins 时遇到了问题(在第 7 步之后)。看起来 jenkins 无法在我的虚拟环境中 运行 bzt 出现一些问题。

Started by user user
Running as SYSTEM
Building in workspace /Users/user/.jenkins/workspace/jenkinsjob
Performance test: Checking global bzt installation...
[jenkinsjob] $ bzt --help
Performance test: You don't have global bzt installed on this Jenkins host. Installing it globally will speed up job. Run 'sudo pip install bzt' to install it.
Performance test: Checking virtualenv tool availability...
[jenkinsjob] $ /usr/local/bin/virtualenv --help
Performance test: Found virtualenv tool.
Performance test: Creating virtualev at 'taurus-venv'...
[jenkinsjob] $ /usr/local/bin/virtualenv --clear --system-site-packages taurus-venv
Performance test: Done creating virtualenv.
Performance test: Installing bzt into 'taurus-venv'
[jenkinsjob] $ /Users/user/.jenkins/workspace/jenkinsjob/taurus-venv/bin/pip install bzt
Performance test: bzt installed successfully.
Performance test: Checking installed bzt...
[jenkinsjob] $ /Users/user/.jenkins/workspace/jenkinsjob/taurus-venv/bin/bzt --help
Performance test: Failed to run bzt inside virtualenv.
Cannot run program "/Users/user/.jenkins/workspace/jenkinsjob/taurus-venv/bin/bzt" (in directory "/Users/user/.jenkins/workspace/jenkinsjob"): error=2, No such file or directoryBuild step 'Run Performance Test' changed build result to FAILURE
Finished: FAILURE

有人遇到并解决了这个问题吗?你能帮我吗?非常感谢。

我无法使用最新的 Jenkins 和性能插件重现您的问题

很可能 Taurus installation into virtualenv 不知何故失败了,我会尝试以下操作:

  1. 运行 /Users/user/.jenkins/workspace/jenkinsjob/taurus-venv/bin/pip install bzt 命令并检查输出
  2. 运行 /Users/user/.jenkins/workspace/jenkinsjob/taurus-venv/bin/bzt --help 命令并检查输出

另外,Jenkins 建议您可以全局安装 Taurus(对于所有用户)运行使用以下命令:

sudo pip install bzt

并取消勾选构建配置中的 Always use virtualenv 框:

通常您不需要 Taurus 运行 JMeter 测试并使用 Performance Plugin 解析结果,您可以 run JMeter in command-line non-GUI mode via normal Jenkins Execute shell build step and then use Publish performance test result report post-build action to generate the performance test reports and trend charts.

作为解决方案,我为 bzt 设置了一个不同的(与全球安装的版本不同的)版本: