Centos上Jenkins+git+allure使用教程

1、Jenkins上下载allure

 

2、下载安装完成后重启Jenkins,然后查看allure插件安装成功,如下图所示

 

3、Jenkins服务器上,安装allure-2.26.0,安装完成后配置环境变量,

vi /etc/profile 配置环境变量 添加 export PATH=$PATH:/usr/local/allure-2.26.0/bin

保存环境变量 source /etc/profile

然后验证allure是否配置成功

 4、Jenkins配置

 

 

 

 5、python插件配置

在安装pip3 install pytest报错

 raise ReadTimeoutError(self._pool, None, "Read timed out.")

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

#yum install -y ca-certificates

#wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

#rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

配置yum源证书之后,再次下载安装如pip3 install pytest 则安装成功

6、分别检查各组件是否安装成功

7、Jenkins上创建一个Job,自动拉取Git代码,构建任务并生成Allure测试报告配置方法

 1)创建任务名称,输入任务名称,选择“构建一个自由风格的软件项目"即可

 

2)配置-源码管理-配置好git 路径和账号,并指定构建分支名称

 

 

3)Build Steps配置

 4)构建后操作,选择对应的Allure Report即可,写相对路径即可

 5)上述配置完成后保存,构建任务即可。其他Configure配置按需添加即可。

 

posted @ 2024-08-09 11:29  金朵  阅读(165)  评论(0)    收藏  举报