jenkins生成allure报告为空,日志中报错allure-results does not exist【已解决】

现象:

1、jenkins持续集成后,jenkins生成allure报告为空。

2、查看jenkins控制台输出日志


[Api-autotest] $ /var/jenkins_home/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure-2.19.0/bin/allure generate -c -o /var/jenkins_home/workspace/Api-autotest/allure-report
allure-results does not exist
Report successfully generated to /var/jenkins_home/workspace/Api-autotest/allure-report
Allure report was successfully generated.

分析:

控制台输出日志分析:

workspace路径:/var/jenkins_home/workspace/Api-autotest

运行脚本分析:

pytest.main(
        ['-vs', '--alluredir','./Pickup/report/temp_jsonreport'])
    os.system("allure generate ./Pickup/report/temp_jsonreport -o ./Pickup/report/html --clean")

allure生成报告,json文件生成目录:/report/temp_jsonreport,html文件生成目录:/report/html
将生成的json结果文件,去生成报告html文件:os.system("allure generate ./Pickup/report/temp_jsonreport -o ./Pickup/report/html --clean")

解决方法:

构建后操作:Pickup\report\temp_jsonreport
构建后操作高级:Pickup\report\html

注意点:需要注意运行的文件(比如main.py)文件的路径,生成的报告存放的路径,以及目前工作空间所在的路径。在运行脚本前,可以用pwd命令查看当前运行脚本所在路径,可以用cd命令切换路径。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值