Skip to content

Commit 02dd80f

Browse files
authored
chore: update readme & add community-related (#394)
Signed-off-by: yuluo-yx <[email protected]>
1 parent 9156fb8 commit 02dd80f

File tree

2 files changed

+176
-24
lines changed

2 files changed

+176
-24
lines changed

README-ZH.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
[![CLA assistant](https://cla-assistant.io/readme/badge/LinuxSuRen/api-testing)](https://cla-assistant.io/LinuxSuRen/api-testing)
2+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3f16717cd6f841118006f12c346e9341)](https://app.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
3+
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/3f16717cd6f841118006f12c346e9341)](https://app.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
4+
[![GitHub All Releases](https://img.shields.io/github/downloads/linuxsuren/api-testing/total)](https://tooomm.github.io/github-release-stats/?username=linuxsuren&repository=api-testing)
5+
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxsuren/api-testing)](https://hub.docker.com/r/linuxsuren/api-testing)
6+
[![LinuxSuRen/open-source-best-practice](https://img.shields.io/static/v1?label=OSBP&message=%E5%BC%80%E6%BA%90%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5&color=blue)](https://github.com/LinuxSuRen/open-source-best-practice)
7+
8+
一个开源的 API 测试工具。🚀
9+
10+
## 功能特性
11+
12+
* 支持的协议: HTTP, gRPC, tRPC
13+
* 支持多种格式的测试结果导出: Markdown, HTML, PDF, Stdout
14+
* 通过简单配置模拟服务
15+
* 支持转换为 [JMeter](https://jmeter.apache.org/) 文件格式
16+
* 支持响应体字段检查或 [eval](https://expr.medv.io/)
17+
* 使用 [JSON schema] 校验响应参数(https://json-schema.org/)
18+
* 支持预处理和后处理 API 请求
19+
* 支持以服务器模式运行并支持 [gRPC](pkg/server/server.proto) 和 HTTP endpoint
20+
* [VS Code 扩展支持](https://github.com/LinuxSuRen/vscode-api-testing)
21+
* [Github 扩展支持](https://github.com/marketplace/actions/api-testing-with-kubernetes)
22+
* 支持多种存储方式 (Local, ORM Database, S3, Git, Etcd, etc.)
23+
* [HTTP API record](https://github.com/LinuxSuRen/atest-ext-collector)
24+
* 支持多种安装方式(CLI, Container, Native-Service, Operator, Helm, etc.)
25+
* 整合 Prometheus, SkyWalking 监控
26+
27+
## 快速开始
28+
29+
[![Deployed on Zeabur](https://zeabur.com/deployed-on-zeabur-dark.svg)](https://zeabur.com?referralCode=LinuxSuRen&utm_source=LinuxSuRen&utm_campaign=oss) [![Try in PWD](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com?stack=https://raw.githubusercontent.com/LinuxSuRen/api-testing/master/docs/manifests/docker-compose.yml)
30+
31+
通过 [hd](https://github.com/LinuxSuRen/http-downloader) 安装,或从 [releases](https://github.com/LinuxSuRen/api-testing/releases) 下载安装:
32+
33+
```shell
34+
hd install atest
35+
```
36+
37+
您也可以通过 kubernetes 安装,更多细节请参考: [manifests](docs/manifests/kubernetes/default/manifest.yaml).
38+
39+
用法如下:
40+
41+
```shell
42+
API testing tool
43+
44+
Usage:
45+
atest [command]
46+
47+
Available Commands:
48+
completion Generate the autocompletion script for the specified shell
49+
func Print all the supported functions
50+
help Help about any command
51+
json Print the JSON schema of the test suites struct
52+
run Run the test suite
53+
sample Generate a sample test case YAML file
54+
server Run as a server mode
55+
service Install atest as a Linux service
56+
57+
Flags:
58+
-h, --help help for atest
59+
-v, --version version for atest
60+
61+
Use "atest [command] --help" for more information about a command.
62+
```
63+
64+
API Testing 使用示例,在此示例中,您将通过 md 格式阅览生成的接口测试报告:
65+
66+
`atest run -p sample/testsuite-gitlab.yaml --duration 1m --thread 3 --report md`
67+
68+
| API | Average | Max | Min | Count | Error |
69+
|---|---|---|---|---|---|
70+
| GET https://gitlab.com/api/v4/projects | 1.152777167s | 2.108680194s | 814.928496ms | 99 | 0 |
71+
| GET https://gitlab.com/api/v4/projects/45088772 | 840.761064ms | 1.487285371s | 492.583066ms | 10 | 0 |
72+
consume: 1m2.153686448s
73+
74+
## 在 Docker 中使用
75+
76+
在 Docker 中以服务器模式运行 `atest`,您可以通过 `8080` 访问 `atest` 的 UI 控制台:
77+
78+
```bash
79+
docker run --pull always -p 8080:8080 ghcr.io/linuxsuren/api-testing:master
80+
```
81+
82+
在 Docker 中使用 `atest-collector`:
83+
84+
```shell
85+
docker run -p 1234:8080 -v /var/tmp:/var/tmp \
86+
ghcr.io/linuxsuren/api-testing atest-collector \
87+
--filter-path /api \
88+
-o /var/tmp/sample.yaml
89+
# you could find the test cases file from /var/tmp/sample
90+
# cat /var/tmp/sample
91+
```
92+
93+
## 模板
94+
95+
以下字段的模板配置参考:[sprig](http://masterminds.github.io/sprig/):
96+
97+
* API
98+
* Request Body
99+
* Request Header
100+
101+
### Functions
102+
103+
您可以使用 [sprig](http://masterminds.github.io/sprig/) 中的所有常用函数。此外,还有一些特殊函数可以在 `atest` 中使用:
104+
105+
| Name | Usage |
106+
|---|---|
107+
| `randomKubernetesName` | `{{randomKubernetesName}}` to generate Kubernetes resource name randomly, the name will have 8 chars |
108+
| `sleep` | `{{sleep(1)}}` in the pre and post request handle |
109+
110+
## 验证 Kuberntes 资源
111+
112+
`atest` 可以验证任何类型的 Kubernetes 资源。使用前请先设置 Kubernetes 相关的环境变量:
113+
114+
* `KUBERNETES_SERVER`
115+
* `KUBERNETES_TOKEN`
116+
117+
另请参考 [example](sample/kubernetes.yaml)。
118+
119+
## 待办事项
120+
121+
* 减少上下文的大小
122+
* 支持自定义上下文
123+
124+
## 功能限制
125+
126+
* 仅支持解析 map 或 array 类型的响应体。
127+
128+
## 社区交流
129+
130+
欢迎使用以下联系方式,探讨有关 API Testing 的任何问题!
131+
132+
### 邮件列表
133+
134+
`[email protected]`, 欢迎通过此邮件列表讨论与 API Testing 相关的任何问题。
135+
136+
### Githbu Discussion
137+
138+
[Github Discussion](https://github.com/LinuxSuRen/api-testing/discussions/new/choose)

README.md

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxsuren/api-testing)](https://hub.docker.com/r/linuxsuren/api-testing)
66
[![LinuxSuRen/open-source-best-practice](https://img.shields.io/static/v1?label=OSBP&message=%E5%BC%80%E6%BA%90%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5&color=blue)](https://github.com/LinuxSuRen/open-source-best-practice)
77

8-
This is a API testing tool.
8+
This is a API testing tool. 🚀
99

1010
## Features
1111

12-
* Supported protocols: HTTP, gRPC, tRPC
13-
* Multiple test report formats: Markdown, HTML, PDF, Stdout
14-
* Mock Server in simple configuration
15-
* Support converting to [JMeter](https://jmeter.apache.org/) files
16-
* Response Body fields equation check or [eval](https://expr.medv.io/)
17-
* Validate the response body with [JSON schema](https://json-schema.org/)
18-
* Pre and post handle with the API request
19-
* Run in server mode, and provide the [gRPC](pkg/server/server.proto) and HTTP endpoint
20-
* [VS Code extension](https://github.com/LinuxSuRen/vscode-api-testing) support
21-
* Multiple storage backends supported(Local, ORM Database, S3, Git, Etcd, etc.)
22-
* [HTTP API record](https://github.com/LinuxSuRen/atest-ext-collector)
23-
* Install in multiple use cases(CLI, Container, Native-Service, Operator, Helm, etc.)
24-
* Monitoring integration with Prometheus, SkyWalking
12+
* Supported protocols: HTTP, gRPC, tRPC
13+
* Multiple test report formats: Markdown, HTML, PDF, Stdout
14+
* Mock Server in simple configuration
15+
* Support converting to [JMeter](https://jmeter.apache.org/) files
16+
* Response Body fields equation check or [eval](https://expr.medv.io/)
17+
* Validate the response body with [JSON schema](https://json-schema.org/)
18+
* Pre and post handle with the API request
19+
* Run in server mode, and provide the [gRPC](pkg/server/server.proto) and HTTP endpoint
20+
* [VS Code extension](https://github.com/LinuxSuRen/vscode-api-testing) support
21+
* Multiple storage backends supported(Local, ORM Database, S3, Git, Etcd, etc.)
22+
* [HTTP API record](https://github.com/LinuxSuRen/atest-ext-collector)
23+
* Install in multiple use cases(CLI, Container, Native-Service, Operator, Helm, etc.)
24+
* Monitoring integration with Prometheus, SkyWalking
2525

2626
## Get started
2727

@@ -73,12 +73,14 @@ consume: 1m2.153686448s
7373
## Use in Docker
7474
7575
Use `atest` as server mode in Docker, then you could visit the UI from `8080`:
76-
```
76+
77+
```bash
7778
docker run --pull always -p 8080:8080 ghcr.io/linuxsuren/api-testing:master
7879
```
7980
8081
Use `atest-collector` in Docker:
81-
```shell
82+
83+
```bash
8284
docker run -p 1234:8080 -v /var/tmp:/var/tmp \
8385
ghcr.io/linuxsuren/api-testing atest-collector \
8486
--filter-path /api \
@@ -91,9 +93,9 @@ docker run -p 1234:8080 -v /var/tmp:/var/tmp \
9193
9294
The following fields are templated with [sprig](http://masterminds.github.io/sprig/):
9395
94-
* API
95-
* Request Body
96-
* Request Header
96+
* API
97+
* Request Body
98+
* Request Header
9799
98100
### Functions
99101
@@ -108,16 +110,28 @@ You could use all the common functions which comes from [sprig](http://mastermin
108110
109111
It could verify any kinds of Kubernetes resources. Please set the environment variables before using it:
110112
111-
* `KUBERNETES_SERVER`
112-
* `KUBERNETES_TOKEN`
113+
* `KUBERNETES_SERVER`
114+
* `KUBERNETES_TOKEN`
113115
114116
See also the [example](sample/kubernetes.yaml).
115117
116118
## TODO
117119
118-
* Reduce the size of context
119-
* Support customized context
120+
* Reduce the size of context.
121+
* Support customized context.
120122
121123
## Limit
122124
123-
* Only support to parse the response body when it's a map or array
125+
* Only support to parse the response body when it's a map or array.
126+
127+
## Community Exchange
128+
129+
Feel free to talk to us about any questions you may have about API Testing in the following ways.
130+
131+
### Mailing List
132+
133+
`[email protected]`, Feel free to discuss everything related to API Testing via this mailing list.
134+
135+
### Githbu discussion
136+
137+
[Github Discussion](https://github.com/LinuxSuRen/api-testing/discussions/new/choose)

0 commit comments

Comments
 (0)