Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/brookshi/Hitchhiker
Browse files Browse the repository at this point in the history
  • Loading branch information
brookshi committed May 24, 2018
2 parents a072640 + a6e47c6 commit 2af7e49
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 17 deletions.
2 changes: 2 additions & 0 deletions cn/Simple_Tutorial/Assert_Base_On_UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

针对这种情况推出了基于UI的断言,只需要用鼠标点点,写写目标值就可以了。

里面也可以有一些稍复杂些的函数,比如custom,这个可以根据当前校验的对象来使用不同的函数,使用的是js语法,比如string类型的,可以使用contains, match之类,如果是数组,则可以使用find(v=>v==='a') != null之类。

![](https://raw.githubusercontent.com/brookshi/images/master/Hitchhiker/assert.PNG)

#### 如何创建
Expand Down
6 changes: 5 additions & 1 deletion cn/Simple_Tutorial/Use_Param.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@ Parameters 本质上是一个JSON格式的对象,你需要以下面这种格

![](https://raw.githubusercontent.com/brookshi/images/master/Hitchhiker/simple_tutorial/param_send_all.png)

![](https://raw.githubusercontent.com/brookshi/images/master/Hitchhiker/simple_tutorial/param_send_one.png)
![](https://raw.githubusercontent.com/brookshi/images/master/Hitchhiker/simple_tutorial/param_send_one.png)

#### 使用Pairwise算法

Pairwise算法可以在做到不太降低覆盖率的情况(大概覆盖70%-80%)下大量减少case,因为在Many to Many时,如果参数过多,生成的case数量很大,写assert就很不容易,而Pairwise算法可以解决这块。
19 changes: 18 additions & 1 deletion cn/change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#### 0.12 2018-05-23

**Features:**

* \#119 增加几个批量关闭标签的功能(全部关闭,关闭保存,关闭当前标签外的所有)
* \#147 response增加一个Console(日志)用于显示请求执行过程及脚本里调用的console,这样方便调试脚本和变量
* \#123 对Parameters里的many to many增加算法选项:pairwise,用于减少用例
* \#174 压缩请求返回的数据
* \#128 对于docker,给global_data下面的project做持久化(破坏性改动,之前上传的在新版本需要再上传一次)
* \#133 在Test里获取hitchhiker.request
* \#121 给新用户增加更多例子

**Bugs:**

* \#152 修复上传的project libs对于自动化测试无效


#### 0.11 2018-04-28

**Features:**
Expand All @@ -6,7 +23,7 @@
* \#110 支持Common Pre Request Script里用getEnvVariable拿环境变量
* \#124 以Key-value形式展示和编辑以及描述url的 Query 字符串
* \#12 body里支持key-value形式展示和编辑以及描述form数据
* \#122 parameters里面增加一个Beautify功能吗
* \#122 parameters里面增加一个Beautify功能
* \#127 Schedules 页面样式优化
* 增加request描述编辑

Expand Down
4 changes: 2 additions & 2 deletions cn/installation/StepByStep.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

#### 一步一步部署:

先确保机器有安装: nodejs 7.60+, 推荐用最新LTS版本(8.9) 以及数据库 `mysql 5.7+` (支持json列);
先确保机器有安装: nodejs 7.60+, 推荐用最新LTS版本以及数据库 `mysql 5.7+` (支持json列);

> 进入mysql, 创建db: `hitchhiker-prod`或其他名字(注意编码用utf8),修改变量`max_allowed_packet=200M`
> 创建DB的脚本: CREATE DATABASE IF NOT EXISTS \`hitchhiker-prod\` default charset utf8 COLLATE utf8_general_ci;
> 修改变量需要把`max_allowed_packet=200M`加到 my.ini 文件[mysqld] Section下,具体参考:[change max_allowed_packet](https://stackoverflow.com/questions/8062496/how-to-change-max-allowed-packet-size)
1. 下载安装包 [https://github.com/brookshi/Hitchhiker/releases/download/v0.11/Hitchhiker.zip](https://github.com/brookshi/Hitchhiker/releases/download/v0.11/Hitchhiker.zip);
1. 下载安装包 [https://github.com/brookshi/Hitchhiker/releases/download/v0.12/Hitchhiker.zip](https://github.com/brookshi/Hitchhiker/releases/download/v0.12/Hitchhiker.zip);
下载速度慢的可以去阿里云下载 http://hitchhiker.oss-cn-hongkong.aliyuncs.com/Hitchhiker.zip

2. 解压并在build目录下(即setup.js的目录)执行命令`node setup.js`(windows), `sudo node setup.js`(linux);
Expand Down
2 changes: 1 addition & 1 deletion cn/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Hitchhiker的很多设置可以在appconfig.json里设置,也有对应的环
"mailOnlyForFail": true // 只在失败时发邮件 HITCHHIKER_SCHEDULE_MAILFORFAIL
},
"stress": {
"stressType": "node", // 压力测试的类型,默认为node,内置的,还有go,需要部署hitchhiker-node,设为none时禁用
"stressType": "node", // 压力测试的类型,默认为node,内置的,还有go,需要部署hitchhiker-node,设为none时禁用 HITCHHIKER_STRESS_TYPE
"storeMaxCount": 5, // 压力测试表最大长度 HITCHHIKER_STRESS_COUNT
"stressPort": 11010, // 压力测试的端口 HITCHHIKER_STRESS_PORT
"stressUpdateInterval": 1000 // 压力测试实时更新时的间隔(毫秒) HITCHHIKER_STRESS_UPDATE_INTERVAL
Expand Down
16 changes: 11 additions & 5 deletions cn/installation/docker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
docker使用的是docker-compose来安装,会自动下载两个image:hitchhiker和mysql,基本上按命令执行即可,如果需要配置,可以参考:[配置文件](configuration.md), 环境变量可以写到docker-compose.yml里

国内用户请使用阿里云的镜像 hitchhiker-cn:registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.11
国内用户请使用阿里云的镜像 hitchhiker-cn:registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.12

#### 参考下面命令,一步一步部署 (基于ubuntu,其他系统类似):
``` bash
Expand All @@ -21,7 +21,7 @@ curl -O https://raw.githubusercontent.com/brookshi/Hitchhiker/release/deploy/doc

# 编辑 docker-compose.yml, 把localhost换成你机器的局域网ip,如果是只有本机一个人用那就localhost也可以
sudo vim docker-compose.yml
# 修改完成后,保存退出 (国内用户改image地址:registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.11, 以及写入环境变量配置hitchhiker以及mysql)
# 修改完成后,保存退出 (国内用户改image地址:registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.12, 以及写入环境变量配置hitchhiker以及mysql)
...

# 执行docker-compose up安装镜像
Expand All @@ -36,7 +36,7 @@ curl http://ip:8080/
version: '2'
services:
hitchhiker:
image: brookshi/hitchhiker:v0.11
image: registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.12
container_name: hitchhiker
environment:
- HITCHHIKER_DB_HOST=hitchhiker-mysql
Expand All @@ -45,6 +45,8 @@ services:
ports:
- "8080:8080"
- "11010:11010"
volumes:
- /my/hitchhiker/data:/usr/src/Hitchhiker/build/global_data/project
links:
- hitchhiker-mysql:hitchhiker-mysql
hitchhiker-mysql:
Expand All @@ -65,14 +67,16 @@ services:
version: '2'
services:
hitchhiker:
image: registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.11
image: registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.12
container_name: hitchhiker
environment:
- HITCHHIKER_DB_HOST=hitchhiker-mysql
- HITCHHIKER_APP_HOST=http://localhost:6666/ # 修改为本机ip及端口
ports:
- "6666:6666"
- "11010:11010"
volumes:
- /my/hitchhiker/data:/usr/src/Hitchhiker/build/global_data/project
links:
- hitchhiker-mysql:hitchhiker-mysql
hitchhiker-mysql:
Expand All @@ -92,7 +96,7 @@ services:
version: '2'
services:
hitchhiker:
image: registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.11
image: registry.cn-hangzhou.aliyuncs.com/brook/hitchhiker-cn:v0.12
container_name: hitchhiker
environment:
- HITCHHIKER_DB_HOST=192.168.0.10
Expand All @@ -103,6 +107,8 @@ services:
ports:
- "8080:8080"
- "11010:11010"
volumes:
- /my/hitchhiker/data:/usr/src/Hitchhiker/build/global_data/project
```

#### 使用nginx和域名
Expand Down
6 changes: 4 additions & 2 deletions deploy/docker/hitchhiker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
hitchhiker:
image: brookshi/hitchhiker:v0.11
image: brookshi/hitchhiker:v0.12
container_name: hitchhiker
environment:
- HITCHHIKER_DB_HOST=hitchhiker-mysql
Expand All @@ -10,4 +10,6 @@ services:
- "8080:8080"
- "11010:11010"
external_links:
- hitchhiker-mysql:hitchhiker-mysql
- hitchhiker-mysql:hitchhiker-mysql
volumes:
- /my/hitchhiker/data:/usr/src/Hitchhiker/build/global_data/project
4 changes: 2 additions & 2 deletions deploy/docker/hitchhiker_and_mysql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: '2'
services:
hitchhiker:
image: brookshi/hitchhiker:v0.11
image: brookshi/hitchhiker:v0.12
container_name: hitchhiker
environment:
- HITCHHIKER_DB_HOST=hitchhiker-mysql
- HITCHHIKER_APP_HOST=http://localhost:8080/ # should change before deploying.
# add environment variable
# add environment variable to config
ports:
- "8080:8080"
- "11010:11010"
Expand Down
1 change: 1 addition & 0 deletions deploy/docker/private/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- "11010:11010"
volumes:
- /my/hitchhiker/public:/usr/src/Hitchhiker/build/public
- /my/hitchhiker/data:/usr/src/Hitchhiker/build/global_data/project
links:
- hitchhiker-mysql
hitchhiker-mysql:
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker/push_docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export HITCHHIKER_VERSION="v0.11"
export HITCHHIKER_VERSION="v0.12"
sudo docker pull registry.us-east-1.aliyuncs.com/brook/hitchhiker:$HITCHHIKER_VERSION
sudo docker login --username=brookshi --password=$DOCKER_ID_PWD
sudo docker tag registry.us-east-1.aliyuncs.com/brook/hitchhiker:$HITCHHIKER_VERSION brookshi/hitchhiker:$HITCHHIKER_VERSION
Expand Down
2 changes: 2 additions & 0 deletions deploy/linux_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ** 如果您打算部署Hitchhiker,请忽略这个脚本,部署请参考:http://doc.hitchhiker-api.com/cn/installation/ 如果是开发,可以参考脚本搭开发环境
# ** if you try to deploy Hitchhiker, please ignore this file, reference to: http://doc.hitchhiker-api.com/cn/installation/
# ensure mysql is installed with user:'root' password: 'hitchhiker888' and create database 'hitchhiker-prod'
# replace myhost with your ip, keep 8080 port

Expand Down
2 changes: 2 additions & 0 deletions deploy/win_deploy.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
REM ** 如果您打算部署Hitchhiker,请忽略这个脚本,部署请参考:http://doc.hitchhiker-api.com/cn/installation/ 如果是开发,可以参考脚本搭开发环境
REM ** if you try to deploy Hitchhiker, please ignore this file, reference to: http://doc.hitchhiker-api.com/cn/installation/
REM ensure mysql is installed with user:'root' password: 'hitchhiker888' and create database 'hitchhiker-prod'
REM replace myhost with your ip

Expand Down
16 changes: 16 additions & 0 deletions en/change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#### 0.12 2018-05-23

**Features:**

* \#119 Add tab function: close all, close all but actived, close all saved
* \#147 Add Console tab for response to display request execution process information, it make debug script and variable earier
* \#123 Add Pairwise algorithm for many to many of parameters to reduce case
* \#174 Compress response
* \#128 Add volumn for project lib & data for docker
* \#133 Could get hitchhiker.request in Test script
* \#121 More samples for new user

**Bugs:**

* \#152 fixed new uploaded project libs invalid for scheduler

#### 0.11 2018-04-28

**Features:**
Expand Down
2 changes: 1 addition & 1 deletion en/installation/StepByStep.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Dependence: nodejs 7.60+, recommend use LTS (8.9) and `mysql 5.7+` with json col
> create DB: CREATE DATABASE IF NOT EXISTS \`hitchhiker-prod\` default charset utf8 COLLATE utf8_general_ci;
> change variable: add `max_allowed_packet=200M` under [mysqld] section in /my.conf file, refer to:[change max_allowed_packet](https://stackoverflow.com/questions/8062496/how-to-change-max-allowed-packet-size)
1. Download app package from [https://github.com/brookshi/Hitchhiker/releases/download/v0.11/Hitchhiker.zip](https://github.com/brookshi/Hitchhiker/releases/download/v0.11/Hitchhiker.zip);
1. Download app package from [https://github.com/brookshi/Hitchhiker/releases/download/v0.12/Hitchhiker.zip](https://github.com/brookshi/Hitchhiker/releases/download/v0.12/Hitchhiker.zip);

2. Unzip and run command `node setup.js`(windows), `sudo node setup.js`(linux) in `build` folder;

Expand Down
4 changes: 3 additions & 1 deletion en/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If you want to use another port, should replace all 8080.
version: '2'
services:
hitchhiker:
image: brookshi/hitchhiker:v0.11
image: brookshi/hitchhiker:v0.12
container_name: hitchhiker
environment:
- HITCHHIKER_DB_HOST=hitchhiker-mysql
Expand All @@ -16,6 +16,8 @@ services:
ports:
- "8080:8080"
- "11010:11010"
volumes:
- /my/hitchhiker/data:/usr/src/Hitchhiker/build/global_data/project
links:
- hitchhiker-mysql:hitchhiker-mysql
hitchhiker-mysql:
Expand Down

0 comments on commit 2af7e49

Please sign in to comment.