接口测试 API Testing 提供了简单的 UI

LinuxSuRen for 开源技术兴趣小组 · 2023年06月26日 · 2745 次阅读

一睹为快,先看下面的截图。目前还在 master 分支开发中,支持读取、执行测试用例。后续会支持从 Git 仓库、数据库等位置存、取接口测试用例。

技术栈

  • Vue
  • Element-plus
  • HTTP 和 gRPC 作为前后端通讯协议

欢迎熟悉以上技术栈的朋友互相交流。

如何部署

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

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册