詹金斯不存在魅力结果

时间:2018-11-05 10:52:02

标签: jenkins report allure

生成魅力结果(xmls),并且可以通过在allure-results目录之外运行 allure serve 来查看,但是在Jenkins中使用带有来自Jenkins工作区的相对路径的allure results目录进行配置时,allure找不到结果。大概路径有问题

[allure_test] $ /Users/me/.jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/Allure_2.7.0/bin/allure generate -c -o /Users/me/.jenkins / workspace / allure_test / allure-report 魅力结果不存在 成功生成报告到/Users/me/.jenkins/workspace/allure_test/allure-report 魅力报告已成功生成。

为吸引力报告定义的相对路径为
../../ repos / partner-portal / target / allure-results

报告已生成,但没有结果

2 个答案:

答案 0 :(得分:0)

这是解决方案:
1.在您的工作空间内(对我来说是D:\ m \ Automation Project \ Tests),创建一个名为“ target”的文件夹,其中包含两个子文件夹“ allure-results”和“ allure-reports”。

  1. 在Jenkins Project的Post Build Actions中提供这些条目。

结果:目标/魅力结果
报告路径:目标/魅力报告

Post Build Actions 现在运行您的测试,将生成没有任何问题的诱人报告。

答案 1 :(得分:0)

由于这个问题,我奋斗了24多个小时,无法整夜睡觉。没有与此相关的明确说明以及其工作方式。终于,我明白了。

对于这个答案来说可能为时已晚,但是您能否在工作区中创建“ allure-results”文件夹(例如/Users/me/.jenkins/workspace/allure_test/allure-results)?

在jenkins中配置Allure报告并使用行为命令后,我终于看到以下输出并在jenkins构建计划中看到了工作报告:

.
.
.
.
D:\PythonProject\PythonBehave>behave -f allure_behave.formatter:AllureFormatter -o C:\Users\Alex\.jenkins\workspace\PythonAllure\allure-results D:\PythonProject\PythonBehave\features 

Failing scenarios:
  features/example.feature:17  user can search text in google -- @2.2 Incorrect
  features/github_login.feature:13  User attempt to login with wrong username and password -- @1.1 InCorrect
  features/github_login.feature:14  User attempt to login with wrong username and password -- @1.2 InCorrect
  features/github_login.feature:18  User attempt to login with correct username and password

0 features passed, 2 failed, 0 skipped
3 scenarios passed, 4 failed, 0 skipped
12 steps passed, 4 failed, 8 skipped, 0 undefined
Took 3m24.651s

D:\PythonProject\PythonBehave>exit 1 
Build step 'Custom Python Builder' marked build as failure
[PythonAllure] $ C:\Users\Alex\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Allure_2.13.1\bin\allure.bat generate C:\Users\Alex\.jenkins\workspace\PythonAllure\allure-results -c -o C:\Users\Alex\.jenkins\workspace\PythonAllure\allure-report
Report successfully generated to C:\Users\Alex\.jenkins\workspace\PythonAllure\allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
Finished: FAILURE

在我的工作区中没有allure-results文件夹时,我以前常常获得此输出:

[PythonAllure] $ C:\Users\Alex\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Allure_2.13.1\bin\allure.bat generate -c -o C:\Users\Alex\.jenkins\workspace\PythonAllure\allure-report