關於mac系統 jenkins生成allure報告“ru.yandex.qatools.allure.jenkins.exception.AllurePluginException: Can not generate Allure Report”的解決辦法



jenkins構建后報錯記錄:
cases/test_login.py::TestLogin::test_login_success[xxxxx-xxxxx-\u3010\u9000\u51fa\u3011]
cases/test_login.py::TestLogin::test_login_success[xxxxx-xxxxx-【退出】] 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

解決辦法:
在jenkins目錄下allure插件下面的 bin/allure文件,將第一行環境變量 :#!/usr/bin/env sh 設置為Jenkins的環境變量:#!/bin/sh -ilex 保存后重新構建即可解決。
本機bin/allure文件路徑:/Users/linguowei/.jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/bin/allure


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM