东莞网站建设做公司,php网站后台密码忘记了,电子商务网站建设考试试卷,用wordpress建一个网站吗背景#xff1a;
API接口自动化使用python语言实现#xff0c;利用httprunner框架编写自动化用例场景#xff08;执行的时候还是依赖pytest),使用jenkins自动构建git上的源代码#xff0c;并产生allure报告可视化展示API执行结果。
步骤
1.进入jenkins容器
注意使用roo…背景
API接口自动化使用python语言实现利用httprunner框架编写自动化用例场景执行的时候还是依赖pytest),使用jenkins自动构建git上的源代码并产生allure报告可视化展示API执行结果。
步骤
1.进入jenkins容器
注意使用root身份进入容器 docker exec -it -uroot jenkins bash
2、具体安装步骤
## 见上篇https://blog.csdn.net/dghrty_show/article/details/134445662?spm1001.2014.3001.55023、验证python安装是否成功 4、安装过程中遇到的问题
##编译python执行make时遇到如下报错导致未编译成功报错这个会导致pip3无法使用所以必须要解决这个
zipimport.ZipImportError: cant decompress data; zlib not available
make: *** [Makefile:1102: install] Error 1
#问题原因
当前路径下缺少zlib相关依赖包
#解决办法cd ~apt-get install zlib# #一定要回到python的安装路径下,/opt/py3.6次编译cd /opt/py3.6/makemake install
##问题执行shell脚本时使用pytest -s -q testcases/ --alluredirreports/ --clean-alluredir时进行jenkins构建一直报错
/tmp/jenkins138024061767095240.sh: line 3: pytest: command not found
##解决办法
python3 -m pytest -s -q testcases/ --alluredirreports/ --clean-alluredir
##原因
1执行shell脚本的时候报找不到pytest命令但是自己的库里其实已经通过pip安装了pytest,执行pip list也是可以查询到pytest的版本信息
2本来想通过设置环境变量解决但是最终失败(如下设置
cat ~/.bash_profile
验证是否添加成功echo $PATH
3最终原因是我自己通过pip去安装的pytest 并不会使其成为系统命令所以需要通过python -m pytest 命令执行使其成为系统命令问题在jenkins容器内安装了pytest但是就找不到pytest在哪里
1使用whereis/which pytest无法找到
2使用 pip3 show pytest
3其实在jenkins中安装python后安装的各种插件都是在py3.6/lib/python3.6/site-packages下的