关于mac系统 jenkins生成allure报告“ru.yandex.qatools.allure.jenkins.exception.AllurePluginException: Can not generate Allure Report”的解决办法

jenkins构建后报错记录:
cases/test_login.py::TestLogin::test_login_success[nt_admin-123456-\u3010\u9000\u51fa\u3011]
cases/test_login.py::TestLogin::test_login_success[nt_admin-123456-【退出】] PASSED [100%]

  • generated html file: file:///Users/linguowei/PycharmProjects/rugao2020/report/report.html -
    ========================== 1 passed in 16.52 seconds ===========================
    [rugao2020] $ /Users/linguowei/.jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/bin/allure generate /Users/linguowei/PycharmProjects/rugao2020/result -c -o /Users/linguowei/PycharmProjects/rugao2020/allure-report
    env: sh: No such file or directory
    ERROR: Build step failed with exception
    ru.yandex.qatools.allure.jenkins.exception.AllurePluginException: Can not generate Allure Report, exit code: 127
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:314)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:231)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
    at hudson.model.Run.execute(Run.java:1843)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
    Build step 'Allure Report' marked build as failure
    Finished: FAILURE

解决办法:
原文链接:https://testerhome.com/topics/19597
“打开allure插件下面的 bin/allure文件,第一行声明脚本解析器时出了问题 (#!/usr/bin/env sh)
这里需要设置Jenkins的环境变量,但我把脚本修改成#!/bin/sh -ilex 也OK了”
亲测有效!!!!!!!
(补充一下我的文件路径:/Users/linguowei/.jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/bin/allure)
供大家参考!

猜你喜欢

转载自www.cnblogs.com/linguowei/p/12958143.html