Pytest+Jenkins:ERROR: Build step failed with exception 解决办法

将 pytest 脚本调试通过后,部署到 Windows 本地的 Jenkins 上,代码脚本执行没有问题,但是构建完成后没有生成 Allure 测试报告,报错内容如下图所示:

E:\project_pytest>exit 0 
[project_pytest] $ C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure-2.15.0\bin\allure.bat generate E:\project_pytest\report_allure -c -o E:\project_pytest\allure-report
输入行太长。
命令语法不正确。
ERROR: Build step failed with exception
ru.yandex.qatools.allure.jenkins.exception.AllurePluginException: Can not generate Allure Report, exit code: 255
	at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:314)
	at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:231)
	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:21)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:808)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757)
	at hudson.model.Build$BuildExecution.post2(Build.java:179)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:701)
	at hudson.model.Run.execute(Run.java:1936)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:100)
	at hudson.model.Executor.run(Executor.java:433)
Build step 'Allure Report' marked build as failure
Finished: FAILURE
解决方案以及操作步骤:

1. 回到 Jenkins 的 Dashboard 首页
2. Manage Jenkins > System Configuration > Global Tool Configuration
在这里插入图片描述

3. 滚动条下拉,找到 Allure Commandline ,点击 Allure Commandline 安装
在这里插入图片描述

4. 将本地 Allure 目录添加至 系统下 Allure Commandline 安装列表中

5. 应用并保存配置信息,重新构建 Job 任务,【构建成功】

E:\project_pytest>exit 0 
[Pytest_Allure] $ D:\PYTEST\allure-2.15.0\bin\allure.bat generate -c -o C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\Pytest_Allure\allure-report
allure-results does not exist
Report successfully generated to C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\Pytest_Allure\allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
Finished: SUCCESS

在这里插入图片描述

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值