一睹为快,先看下面的截图。目前还在 master 分支开发中,支持读取、执行测试用例。后续会支持从 Git 仓库、数据库等位置存、取接口测试用例。
欢迎熟悉以上技术栈的朋友互相交流。
API Testing 提供了极简的部署方式,只有单一的容器即可运行。下面是启动容器的命令:
docker run -p 8080:8080 ghcr.io/linuxsuren/api-testing:master
然后,就可以通过浏览器访问:http://localhost:8080
如果你希望运行在 Kubernetes 中,也可以执行下面的 YAML 文件部署:
---
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: api-testing
name: api-testing
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
selector:
matchLabels:
app: api-testing
template:
metadata:
creationTimestamp: null
labels:
app: api-testing
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app: api-testing
topologyKey: kubernetes.io/hostname
weight: 5
containers:
- image: ghcr.io/linuxsuren/api-testing:master
name: server
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: "100m"
memory: 100m
---
apiVersion: v1
kind: Service
metadata:
name: api-testing
spec:
ports:
- name: web
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: api-testing
sessionAffinity: None
type: NodePort
部署命令:kubectl create -f atest.yaml
,然后查看 Service 访问端口:kubectl get svc api-testing