前言

相信不少小伙伴对开源项目 httprunner 都很感兴趣,我们来看下它的有哪些特点吧:

  • 项目管理:新增项目、列表展示及相关操作,支持用例批量上传(标准化的HttpRunner json和yaml用例脚本)
  • 模块管理:为项目新增模块,用例和配置都归属于module,module和project支持同步和异步方式
  • 用例管理:分为添加config与test子功能,config定义全部变量和request等相关信息 request可以为公共参数和请求头,也可定义全部变量
  • 场景管理:可以动态加载可引用的用例,跨项目、跨模快,依赖用例列表支持拖拽排序和删除
  • 运行方式:可单个test,单个module,单个project,也可选择多个批量运行,支持自定义测试计划,运行时可以灵活选择配置和环境,
  • 分布执行:单个用例和批量执行结果会直接在前端展示,模块和项目执行可选择为同步或者异步方式,
  • 环境管理:可添加运行环境,运行用例时可以一键切换环境
  • 报告查看:所有异步执行的用例均可在线查看报告,可自主命名,为空默认时间戳保存,
  • 定时任务:可设置定时任务,遵循crontab表达式,可在线开启、关闭,完毕后支持邮件通知
  • 持续集成:jenkins对接,开发中。。。

特点还不错,但是目前此项目已停止维护,作为测开的我们在此基于hrun(httprunner)进行二次开发是个很不错的选择!

一、预备工作

  1.阿里云服务器,注意:如果重置密码后,需要重启服务器;

  2.注意开放所用到的端口,小编直接暴力开放了全部端口;

  3.远程连接服务器工具:Xshell、SecureCRTPortable(小编用的就是这个)

  我们hrun所需环境:python3 + mysql5.7(官方推荐)+ Django2 + httprunner==1.58

二、搭建python3环境

  1.安装环境依赖包,避免后面少出现包的问题(之前试过没运行,导致没有pip3)

  命令:yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel mysql-devel

[root@iZbp19lugf22zbsubsf1y6Z home]# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel mysql-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): extras/7/x86_64/primary_db | 153 kB 00:00:00
(2/4): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(3/4): updates/7/x86_64/primary_db | 2.8 MB 00:00:00
(4/4): epel/x86_64/primary_db | 6.9 MB 00:00:00
Package zlib-devel-1.2.7-18.el7.x86_64 already installed and latest version
Package bzip2-devel-1.0.6-13.el7.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.2k-19.el7.x86_64 already installed and latest version
Package ncurses-devel-5.9-14.20130511.el7_4.x86_64 already installed and latest version
Package sqlite-devel-3.7.17-8.el7.x86_64 already installed and latest version
Package readline-devel-6.2-11.el7.x86_64 already installed and latest version
Package 1:tk-devel-8.5.13-6.el7.x86_64 already installed and latest version
Package gdbm-devel-1.10-8.el7.x86_64 already installed and latest version
Package libdb4-devel-4.8.30-13.el7.x86_64 already installed and latest version
Package 14:libpcap-devel-1.5.3-11.el7.x86_64 already installed and latest version
Package xz-devel-5.2.2-1.el7.x86_64 already installed and latest version
Package 1:mariadb-devel-5.5.64-1.el7.x86_64 already installed and latest version
Nothing to do

 

  2.版本你需要安装哪个版本就下载哪个python3以上就行,推荐3.6.5,linux上下载加上后缀就行了。

  python查看版本地址:https://www.python.org/ftp/python/  小编是用独有的wget下载3.6.5(因为我已经安装了),可能下载时间有点长,当然也可以在本地下载好上传至服务器上,如果喜欢用shell脚本一键安装的朋友还是用wget下载给力:wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz

[root@iZbp19lugf22zbsubsf1y6Z home]# wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
--2019-10-27 14:43:39-- https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
Resolving www.python.org (www.python.org)... 151.101.228.223, 2a04:4e42:36::223
Connecting to www.python.org (www.python.org)|151.101.228.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22994617 (22M) [application/octet-stream]
Saving to: ‘Python-3.6.5.tgz’

100%[===================================================================================================================================================================================================>] 22,994,617 13.4KB/s in 29m 59s

2019-10-27 15:13:39 (12.5 KB/s) - ‘Python-3.6.5.tgz’ saved [22994617/22994617]

  3.在此包目录下解压tgz包,输入:tar -xvf Python-3.6.5.tgz

[root@iZbp19lugf22zbsubsf1y6Z home]# tar -xvf Python-3.6.5.tgz

Python-3.6.5/Lib/test/test_wait3.py
Python-3.6.5/Lib/test/test_ordered_dict.py
Python-3.6.5/Lib/test/test_exception_variations.py
Python-3.6.5/Lib/test/test_argparse.py
Python-3.6.5/Lib/test/test_multibytecodec.py
Python-3.6.5/Lib/test/test_strftime.py
Python-3.6.5/Lib/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt
Python-3.6.5/Lib/test/test_ipaddress.py
Python-3.6.5/Lib/test/test_mmap.py
Python-3.6.5/Lib/test/test_ftplib.py
Python-3.6.5/Lib/test/test_selectors.py
Python-3.6.5/Lib/test/test_operator.py
Python-3.6.5/Lib/test/badsyntax_future10.py
Python-3.6.5/Lib/test/test_decimal.py
Python-3.6.5/Lib/test/test_popen.py
Python-3.6.5/Lib/test/test_genexps.py
Python-3.6.5/Lib/test/test_stat.py
Python-3.6.5/Lib/test/datetimetester.py
Python-3.6.5/Lib/test/test_socketserver.py
Python-3.6.5/Lib/test/test_codecmaps_hk.py
Python-3.6.5/Lib/test/curses_tests.py
Python-3.6.5/Lib/test/test_decorators.py
Python-3.6.5/Lib/test/test_pyclbr.py

...

  4.在Python-3.6.5目录下指定安装目录:./configure --prefix=/home/python365

[root@iZbp19lugf22zbsubsf1y6Z Python-3.6.5]# ./configure --prefix=/home/python365

checking stropts.h usability... no
checking stropts.h presence... no
checking for stropts.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/devpoll.h usability... no
checking sys/devpoll.h presence... no

...

  5.在Python-3.6.5目录下编译输入:make    编译时间有点长,等几分钟完成后再安装,输入:make install

[root@iZbp19lugf22zbsubsf1y6Z Python-3.6.5]# make
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Parser/parser.o Parser/parser.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Parser/bitset.o Parser/bitset.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o

...省略

[root@iZbp19lugf22zbsubsf1y6Z Python-3.6.5]# make install
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Objects/listobject.o Objects/listobject.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Objects/longobject.o Objects/longobject.

...省略

  6.设置python365和pip365的软链接,这里因为自带了python2.7已有类同的软链接,我们要另设置为 python365 和 pip365,可以随便命名:

  ln -s /home/python365/bin/python3.6 /usr/bin/python365

  ln -s /home/python365/bin/pip3 /usr/bin/pip365

  注意:我们上面的指定了安装目录为:/home/python365,然而我们设置软链接也是在/home/python365下面。

[root@iZbp19lugf22zbsubsf1y6Z bin]# ln -s /home/python365/bin/python3.6 /usr/bin/python365
[root@iZbp19lugf22zbsubsf1y6Z bin]# ln -s /home/python365/bin/pip3 /usr/bin/pip365
[root@iZbp19lugf22zbsubsf1y6Z bin]#

  7.验证 python 的版本输入:python365 -V

[root@iZbp19lugf22zbsubsf1y6Z bin]# python365 -V
Python 3.6.5
[root@iZbp19lugf22zbsubsf1y6Z bin]# python
Python 2.7.5 (default, Jul 13 2018, 13:06:57)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

  8.验证 pip365 的版本.

[root@iZbp19lugf22zbsubsf1y6Z bin]# pip365 -V
pip 9.0.3 from /home/python365/lib/python3.6/site-packages (python 3.6)

  9.上面看到pip365版本为9.0.3,我们将pip365也升级至最新版输入:pip365 install --upgrade pip

[root@iZbp19lugf22zbsubsf1y6Z bin]# pip365 install --upgrade pip
Collecting pip
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 44.6MB/s
Installing collected packages: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Successfully installed pip-19.3.1

  10.再来查看一下pip365的版本已为最新版。

[root@iZbp19lugf22zbsubsf1y6Z bin]# pip365 -V
pip 19.3.1 from /home/python365/lib/python3.6/site-packages/pip (python 3.6)

这样就完成了python3的安装了,如遇到有问题欢迎留言交流!!!

httprunner-1-linux下搭建hrun(上)的更多相关文章

  1. [编译] 7、在Linux下搭建安卓APP的开发烧写环境(makefile版-gradle版)—— 在Linux上用命令行+VIM开发安卓APP

    April 18, 2020 6:54 AM - BEAUTIFULZZZZ 目录 0 前言 1 gradle 安装配置 1.1 卸载系统默认装的gradle 1.2 下载对应版本的二进制文件 1.3 ...

  2. MongoDB学习笔记—Linux下搭建MongoDB环境

    1.MongoDB简单说明 a MongoDB是由C++语言编写的一个基于分布式文件存储的开源数据库系统,它的目的在于为WEB应用提供可扩展的高性能数据存储解决方案. b MongoDB是一个介于关系 ...

  3. Linux下搭建个人网站

    前不久在阿里买了一个服务器,然后开始第一次尝试搭建自己的个人网站.前端采用了bootstrap框架,后端采用的是PHP,数据库使用的是Mysql.新手第一次在linux下搭建遇见很多问题,在这里分享一 ...

  4. Ruby学习心得之 Linux下搭建Ruby环境

    作者:枫雪庭 出处:http://www.cnblogs.com/FengXueTing-px/ 欢迎转载 Ruby学习心得之 Linux下搭建Ruby环境1.前言2.Linux下安装Ruby环境 一 ...

  5. Linux下搭建Lotus Domino集群

    Linux下搭建Lotus Domino 集群 本文内容是Linux平台下Lotus Domino服务器部署案例(http://chenguang.blog.51cto.com/350944/1334 ...

  6. Linux下搭建 Cocos2d-x-2.1.4 编译环境

    [tonyfield 2013.09.04 ] 参考 Linux下搭建 Cocos2d-x-2.1.4 编译环境 导入 HelloCpp 例程 1. Java 入口 HelloCpp.java Hel ...

  7. Linux下搭建tomcat集群全记录(转)

    本文将讲述如何在Linux下搭建tomcat集群,以及搭建过程中可能的遇到的问题和解决方法.为简单起见,本文演示搭建的集群只有两个tomact节点外加一个apache组成,三者将安装在同一机器上:ap ...

  8. [编译] 3、在Linux下搭建51单片机的开发烧写环境(makefile版)

    星期二, 10. 七月 2018 01:01上午 - beautifulzzzz 一.SDCC(Small Device C Compiler)编译环境搭建 SDCC是一个小型设备的C语言编译器,该编 ...

  9. linux下搭建lamp环境以及安装swoole扩展

    linux下搭建lamp环境以及安装swoole扩展   一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源  我安装的环境是:apache2.2.15+mysql5 ...

  10. linux下搭建hexo环境

    最近对搭建个人博客比较感兴趣,但是刚搭建好next主题基本博客,电脑就坏了,借了一台电脑继续搞,不想在他电脑中弄太多环境,所以我准备在自己电脑的服务器上搭建hexo环境 服务器环境: (1)cento ...

随机推荐

  1. 论文阅读 | DeepDrawing: A Deep Learning Approach to Graph Drawing

    作者:Yong Wang, Zhihua Jin, Qianwen Wang, Weiwei Cui, Tengfei Ma and Huamin Qu 本文发表于VIS2019, 来自于香港科技大学 ...

  2. [原创] 为Visio添加公式编辑器工具栏按钮

    前言 作为理工科的学生,在写论文时,难免会在示意图中添加一些公式来说明研究内容.常用的画图工具就是 Visio .而常用的公式编辑器就是 Mathtype .对于 Word 这种软件,Mathtype ...

  3. Hadoop 之 MapReduce原理

    1.什么是MapReduce 答:简而言之,就是将一个大任务分成多个小的子任务(Map),并行执行后,合并结果(Reduce).下面举一个纸牌得栗子  2.MapReduce的运行流程  3.JobT ...

  4. 软件测试的分类&软件测试生命周期

    软件测试的分类: 按测试执行阶段:单元测试.集成测试.系统测试.验收测试.(正式验收测试,Alpha 测试-内侧,Beta 测试-公测) 按测试技术分类:黑盒测试.白盒测试.灰盒测试 按测试对象是否运 ...

  5. Dubbo学习系列之八(分布式事务之MQ方案)

    自从小王玩起了微服务,发现微服务果然很强大,好处真是太多,心中暗喜,然而,却也遇到了分布式中最棘手的问题:分布式事务.小王遍访各路神仙,也无个完美开源解决方案,当然,也有些实际可行的手法,虽不算完美, ...

  6. 站内搜索(ELK)之开篇

    因工作需要,近期使用ELK搭建单位内部“站内搜索”,目前已将内部OA系统20余个流程的表单.附件的数据索引到elasticsearch中,包括打印复印流程.声像采集流程.远程文件发送.规章制度.内线电 ...

  7. JVM 调优 - jmap

    Java命令学习系列(三)——Jmap 2015-05-16 分类:Java 阅读(17065) 评论(9) 阿里大牛珍藏架构资料,点击链接免费获取 Jmap jmap是JDK自带的工具软件,主要用于 ...

  8. SharePoint 2013 Sandbox Solution

    昨天在写SharePoint EventReceiver的时候遇到一个问题,创建了一个local farm SharePoint solution,添加了一个ItemAdded(SPItemEvent ...

  9. Circular RNA的产生机制、功能及RNA-seq数据鉴定方法

    推荐关注微信公众号:AIPuFuBio,和使用免费生物信息学资源和工具AIPuFu:http://www.aipufu.com. [Circular RNA的产生机制] Circular RNA,缩写 ...

  10. 设计模式之UML类图以及类间关系

    类图是描述系统中的类,以及各个类之间的关系的静态视图.能够让我们在正确编写代码以前对系统有一个全面的认识.类图是一种模型类型,确切的说,是一种静态模型类型.类图表示类.接口和它们之间的协作关系. 以下 ...