{"id":13621028,"url":"https://github.com/LinuxSuRen/api-testing","last_synced_at":"2025-04-14T22:33:18.976Z","repository":{"id":64303096,"uuid":"501122714","full_name":"LinuxSuRen/api-testing","owner":"LinuxSuRen","description":"Open source API testing tool. 开源接口调试、测试工具。Mock Server","archived":false,"fork":false,"pushed_at":"2025-04-03T12:40:13.000Z","size":12276,"stargazers_count":313,"open_issues_count":34,"forks_count":54,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-08T13:08:10.353Z","etag":null,"topics":["api","api-testing","graphql","grpc","hacktoberfest","http","mock","mock-server","testing","trpc"],"latest_commit_sha":null,"homepage":"https://linuxsuren.github.io/api-testing/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LinuxSuRen.png","metadata":{"files":{"readme":"README-ZH.md","changelog":null,"contributing":"CONTRIBUTING-ZH.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-08T06:12:04.000Z","updated_at":"2025-04-06T07:10:33.000Z","dependencies_parsed_at":"2023-10-15T02:08:48.277Z","dependency_job_id":"281ba726-3ddd-4676-9ee2-2f19fc5f9611","html_url":"https://github.com/LinuxSuRen/api-testing","commit_stats":{"total_commits":398,"total_committers":25,"mean_commits":15.92,"dds":"0.20100502512562812","last_synced_commit":"0f0298455e9b51d63f5954b293b533c8b5177029"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fapi-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fapi-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fapi-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fapi-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinuxSuRen","download_url":"https://codeload.github.com/LinuxSuRen/api-testing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248972677,"owners_count":21191839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-testing","graphql","grpc","hacktoberfest","http","mock","mock-server","testing","trpc"],"created_at":"2024-08-01T21:01:01.881Z","updated_at":"2025-04-14T22:33:13.966Z","avatar_url":"https://github.com/LinuxSuRen.png","language":"Go","readme":"[![CLA assistant](https://cla-assistant.io/readme/badge/LinuxSuRen/api-testing)](https://cla-assistant.io/LinuxSuRen/api-testing)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3f16717cd6f841118006f12c346e9341)](https://app.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/3f16717cd6f841118006f12c346e9341)](https://app.codacy.com/gh/LinuxSuRen/api-testing/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![GitHub All Releases](https://img.shields.io/github/downloads/linuxsuren/api-testing/total)](https://tooomm.github.io/github-release-stats/?username=linuxsuren\u0026repository=api-testing)\n[![Docker Pulls](https://img.shields.io/docker/pulls/linuxsuren/api-testing)](https://hub.docker.com/r/linuxsuren/api-testing)\n[![LinuxSuRen/open-source-best-practice](https://img.shields.io/static/v1?label=OSBP\u0026message=%E5%BC%80%E6%BA%90%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5\u0026color=blue)](https://github.com/LinuxSuRen/open-source-best-practice)\n\n\u003e 中文 | [English](README.md)\n\n一个开源的 API 测试工具。🚀\n\n## 功能特性\n\n* 支持的协议: HTTP, gRPC, tRPC\n* 支持多种格式的测试结果导出: Markdown, HTML, PDF, Stdout\n* 简单易用的 Mock 服务，支持 OpenAPI\n* 支持转换为 [JMeter](https://jmeter.apache.org/) 文件格式\n* 支持响应体字段检查或 [eval](https://expr.medv.io/)\n* 使用 [JSON schema] 校验响应参数(https://json-schema.org/)\n* 支持预处理和后处理 API 请求\n* 支持以服务器模式运行并支持 [gRPC](pkg/server/server.proto) 和 HTTP endpoint\n* [VS Code 扩展支持](https://github.com/LinuxSuRen/vscode-api-testing)\n* [Github 扩展支持](https://github.com/marketplace/actions/api-testing-with-kubernetes)\n* 支持多种存储方式 (Local, ORM Database, S3, Git, Etcd, etc.)\n* [HTTP API record](https://github.com/LinuxSuRen/atest-ext-collector)\n* 支持多种安装方式(CLI, Container, Native-Service, Operator, Helm, etc.)\n* 整合 Prometheus, SkyWalking 监控\n\n## 快速开始\n\n[![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)\n\n通过 [hd](https://github.com/LinuxSuRen/http-downloader) 安装，或从 [releases](https://github.com/LinuxSuRen/api-testing/releases) 下载安装:\n\n```shell\nhd install atest\n```\n\n您也可以通过 kubernetes 安装，更多细节请参考： [manifests](docs/manifests/kubernetes/default/manifest.yaml).\n\n用法如下：\n\n```shell\nAPI testing tool\n\nUsage:\n  atest [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  func        Print all the supported functions\n  help        Help about any command\n  json        Print the JSON schema of the test suites struct\n  run         Run the test suite\n  sample      Generate a sample test case YAML file\n  server      Run as a server mode\n  service     Install atest as a Linux service\n\nFlags:\n  -h, --help      help for atest\n  -v, --version   version for atest\n\nUse \"atest [command] --help\" for more information about a command.\n```\n\nAPI Testing 使用示例，在此示例中，您将通过 md 格式阅览生成的接口测试报告：\n\n`atest run -p sample/testsuite-gitlab.yaml --duration 1m --thread 3  --report md`\n\n| API | Average | Max | Min | Count | Error |\n|---|---|---|---|---|---|\n| GET https://gitlab.com/api/v4/projects | 1.152777167s | 2.108680194s | 814.928496ms | 99 | 0 |\n| GET https://gitlab.com/api/v4/projects/45088772 | 840.761064ms | 1.487285371s | 492.583066ms | 10 | 0 |\nconsume: 1m2.153686448s\n\n## 在 Docker 中使用\n\n在 Docker 中以服务器模式运行 `atest`，您可以通过 `8080` 访问 `atest` 的 UI 控制台：\n\n```bash\ndocker run --pull always -p 8080:8080 ghcr.io/linuxsuren/api-testing:master\n```\n\n在 Docker 中使用 `atest-collector`:\n\n```shell\ndocker run -p 1234:8080 -v /var/tmp:/var/tmp \\\n  ghcr.io/linuxsuren/api-testing atest-collector \\\n  --filter-path /api \\\n  -o /var/tmp/sample.yaml\n# you could find the test cases file from /var/tmp/sample\n# cat /var/tmp/sample\n```\n\n## 模板\n\n以下字段的模板配置参考：[sprig](http://masterminds.github.io/sprig/):\n\n* API\n* Request Body\n* Request Header\n\n### Functions\n\n您可以使用 [sprig](http://masterminds.github.io/sprig/) 中的所有常用函数。此外，还有一些特殊函数可以在 `atest` 中使用：\n\n| Name | Usage |\n|---|---|\n| `randomKubernetesName` | `{{randomKubernetesName}}` to generate Kubernetes resource name randomly, the name will have 8  chars |\n| `sleep` | `{{sleep(1)}}` in the pre and post request handle |\n\n## 验证 Kuberntes 资源\n\n`atest` 可以验证任何类型的 Kubernetes 资源。使用前请先设置 Kubernetes 相关的环境变量：\n\n* `KUBERNETES_SERVER`\n* `KUBERNETES_TOKEN`\n\n另请参考 [example](sample/kubernetes.yaml)。\n\n## 待办事项\n\n* 减少上下文的大小\n* 支持自定义上下文\n\n## 功能限制\n\n* 仅支持解析 map 或 array 类型的响应体。\n\n## 社区交流\n\n欢迎使用以下联系方式，探讨有关 API Testing 的任何问题！\n\n### 邮件列表\n\n`api-testing-tech@googlegroups.com`, 欢迎通过此邮件列表讨论与 API Testing 相关的任何问题。\n\n### GitHub Discussion\n\n[GitHub Discussion](https://github.com/LinuxSuRen/api-testing/discussions/new/choose)\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinuxSuRen%2Fapi-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLinuxSuRen%2Fapi-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinuxSuRen%2Fapi-testing/lists"}