前言

相信不少小伙伴对开源项目 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. SpringBoot和Hibernate整合

    1.先使用idea创建maven项目(这个就不详细讲了,很简单的操作) 2.创建完maven项目之后添加springboot依赖,pom.xml文件如下: <?xml version=" ...

  2. 将SpringBoot部署在外部tomcat中

    一,前言 在文章SpringBoot之简单入门中提到了,SpringBoot是内置一个tomcat容器的,但是如果要将SpringBoot部署在一个外部的tomcat,要怎么办呢?这就是本篇文章的目的 ...

  3. java项目打包

    http://blog.csdn.net/qq_34845382/article/details/53885907 自己用Rinnable JAR file 方法也可以.更简单.直接点击Finish即 ...

  4. 使用apache的poi来实现数据导出到excel的功能——方式一

    利用poi导出复杂样式的excel表格的实现. 我们要实现的效果是: 我们利用提前设计好模板样式,再在模板中填充数据的方式. 首先,pom.xml引入poi. <dependency> & ...

  5. 【Python】机器学习之单变量线性回归练习(计算Cost Function)

    注:练习来自于吴恩达机器学习 翻译后的题目: 你是一个餐厅的老板,你想在其他城市开分店,所以你得到了一些数据(数据在本文最下方),数据中包括不同的城市人口数和该城市带来的利润.第一列是城市的人口数,第 ...

  6. springcloud -- sleuth+zipkin整合rabbitMQ详解

    为什么使用RabbitMQ? 我们已经知道,zipkin的原理是服务之间的调用关系会通过HTTP方式上报到zipkin-server端,然后我们再通过zipkin-ui去调用查看追踪服务之间的调用链路 ...

  7. js常用Matn函数的操练

    Math.PI console.log(Math.PI); 随机数以及向下取整 这是一个能实现从a-b之间随机打印一个整数 function rand_s(a, b) { var x = a + (b ...

  8. 什么是线程调度器(Thread Scheduler)和时间分片(Time Slicing )?

    线程调度器是一个操作系统服务,它负责为 Runnable 状态的线程分配 CPU 时间. 一旦我们创建一个线程并启动它,它的执行便依赖于线程调度器的实现.同上一个问题,线程调度并不受到 Java 虚拟 ...

  9. React+后端实现导出Excle表格的功能

    最近在做一个基于React+antd前端框架的Excel导出功能,我主要在后端做了处理,根据以下步骤,可以很容易就实现导出Excel表格数据的功能. 在做这类导出文件的功能,其实,在后端进行处理,会更 ...

  10. # Ubuntu16.04安装nvidia驱动+CUDA+cuDNN

    Ubuntu16.04安装nvidia驱动+CUDA+cuDNN 准备工作 1.查看GPU是否支持CUDA lspci | grep -i nvidia 2.查看Linux版本 uname -m &a ...