searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

如何部署Jenkins集成pytest allure报告

2023-08-22 05:52:18
44
0

一、windows下载安装jenkins:

  • 安装jdk
  • 安装jenkins

二、Windows系统在jenkins上安装allure插件

安装插件有两种方法:

一种是在线安装,一种是离线安装.两种方式介绍如下:

(1)如果服务器可以上网,那边选择在线安装,安装流程为:

系统管理----插件管理---选择需要的插件直接安装。

如果直接下载插件速度过慢,可以修改以下配置文件:

打开文件C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\updates\default.json
全局搜索  google网址替换成  baidu,全局搜索 updates.jenkins-ci.org/download  替换成 mirrors.tuna.tsinghua.edu.cn/jenkins

(2)如果服务器不能上网,选择离线安装,首先去官网下载需要的plugin,选择匹配的版本号,下载到本地,然后打开:系统管理---插件管理—高级---找到”上传插件”(浏览,找到扩展名为.hpi的插件,上传之后默认直接就安装了。重启jenkins,安装的插件就可以使用了。

三、在jenkins 全局工具中配置allure命令行

在系统管理 —> 全局工具配置 :

 

做以下配置(allure和jdk),配置完并保存:

配置JDK

三、配置job

新建job:Jenkins首页点击新建任务并输入任务名称

 

源码管理(Source Code Management):

构建后操作(Post-build Actions):输入Path名称,这里的path名称表示在项目跟目录下生成此文件夹,文件夹用来保存生成html报告之前所依赖的json,xml,txt等类型文件

配置完成之后,点击“保存”

五、常见的报错:

1,C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Allure_Commandline\bin\allure.bat generate C:\pangya\zidonghua\report\outputs\output -c -o C:\pangya\zidonghua\report\outputs\html

原因:全局设置中allure_command_line没有指定成本地的路径

2,

allure generate outputs/output -o outputs/html --clean  

Report successfully generated to outputs\html

ERROR: Step ‘Allure Report’ aborted due to exception:

java.io.IOException: Can't find allure commandline <null>

原因:Allure commandline的路径写的不对,不用写\bin ,系统的环境变量中到\bin(C:\pangya\chajian\allure-commandline-2.13.5\allure-2.13.5\bin),所以jenkins中不用写到\bin

0条评论
0 / 1000
庞****雅
2文章数
0粉丝数
庞****雅
2 文章 | 0 粉丝
庞****雅
2文章数
0粉丝数
庞****雅
2 文章 | 0 粉丝
原创

如何部署Jenkins集成pytest allure报告

2023-08-22 05:52:18
44
0

一、windows下载安装jenkins:

  • 安装jdk
  • 安装jenkins

二、Windows系统在jenkins上安装allure插件

安装插件有两种方法:

一种是在线安装,一种是离线安装.两种方式介绍如下:

(1)如果服务器可以上网,那边选择在线安装,安装流程为:

系统管理----插件管理---选择需要的插件直接安装。

如果直接下载插件速度过慢,可以修改以下配置文件:

打开文件C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\updates\default.json
全局搜索  google网址替换成  baidu,全局搜索 updates.jenkins-ci.org/download  替换成 mirrors.tuna.tsinghua.edu.cn/jenkins

(2)如果服务器不能上网,选择离线安装,首先去官网下载需要的plugin,选择匹配的版本号,下载到本地,然后打开:系统管理---插件管理—高级---找到”上传插件”(浏览,找到扩展名为.hpi的插件,上传之后默认直接就安装了。重启jenkins,安装的插件就可以使用了。

三、在jenkins 全局工具中配置allure命令行

在系统管理 —> 全局工具配置 :

 

做以下配置(allure和jdk),配置完并保存:

配置JDK

三、配置job

新建job:Jenkins首页点击新建任务并输入任务名称

 

源码管理(Source Code Management):

构建后操作(Post-build Actions):输入Path名称,这里的path名称表示在项目跟目录下生成此文件夹,文件夹用来保存生成html报告之前所依赖的json,xml,txt等类型文件

配置完成之后,点击“保存”

五、常见的报错:

1,C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Allure_Commandline\bin\allure.bat generate C:\pangya\zidonghua\report\outputs\output -c -o C:\pangya\zidonghua\report\outputs\html

原因:全局设置中allure_command_line没有指定成本地的路径

2,

allure generate outputs/output -o outputs/html --clean  

Report successfully generated to outputs\html

ERROR: Step ‘Allure Report’ aborted due to exception:

java.io.IOException: Can't find allure commandline <null>

原因:Allure commandline的路径写的不对,不用写\bin ,系统的环境变量中到\bin(C:\pangya\chajian\allure-commandline-2.13.5\allure-2.13.5\bin),所以jenkins中不用写到\bin

文章来自个人专栏
文章 | 订阅
0条评论
0 / 1000
请输入你的评论
0
0