[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"pack-detail-api-testing-stack-zh":3,"seo:pack:api-testing-stack:zh":65},{"code":4,"message":5,"data":6},200,"操作成功",{"pack":7},{"slug":8,"icon":9,"tone":10,"status":11,"status_label":12,"title":13,"description":14,"items":15,"install_cmd":64},"api-testing-stack","🧪","#A16207","stable","稳定","API 测试栈","Bruno \u002F Hoppscotch \u002F Hurl \u002F k6 \u002F Artillery \u002F Locust — 开源替代 Postman + JMeter，无 SaaS 锁定。",[16,28,36,43,50,57],{"id":17,"uuid":18,"slug":19,"title":20,"description":21,"author_name":22,"view_count":23,"vote_count":24,"lang_type":25,"type":26,"type_label":27},996,"89ca3775-356f-11f1-9bc6-00163e2b0d79","bruno-open-source-ide-api-exploration-testing-89ca3775","Bruno — Open-Source IDE for API Exploration & Testing","Bruno is an open-source IDE for exploring and testing APIs — a lightweight, offline-first alternative to Postman and Insomnia. Stores collections as plain text files in your filesystem so they version-control naturally with Git.","Script Depot",324,0,"en","skill","Skill",{"id":29,"uuid":30,"slug":31,"title":32,"description":33,"author_name":34,"view_count":35,"vote_count":24,"lang_type":25,"type":26,"type_label":27},467,"1a83c479-0009-482b-9b11-bb41fb93d5be","hoppscotch-open-source-api-development-platform-1a83c479","Hoppscotch — Open-Source API Development Platform","Test APIs with a beautiful UI. REST, GraphQL, WebSocket, SSE, and gRPC. Self-hostable Postman alternative. 78K+ GitHub stars.","AI Open Source",307,{"id":37,"uuid":38,"slug":39,"title":40,"description":41,"author_name":22,"view_count":42,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1118,"42405722-364b-11f1-9bc6-00163e2b0d79","hurl-run-test-http-requests-plain-text-42405722","Hurl — Run and Test HTTP Requests with Plain Text","Hurl is a command-line tool that runs HTTP requests defined in a simple plain text format. Chain requests, capture values, assert responses, and use it for API testing in CI\u002FCD. Written in Rust on top of libcurl for maximum compatibility.",266,{"id":44,"uuid":45,"slug":46,"title":47,"description":48,"author_name":22,"view_count":49,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1116,"4240522f-364b-11f1-9bc6-00163e2b0d79","k6-modern-load-testing-tool-using-go-javascript-4240522f","k6 — Modern Load Testing Tool Using Go and JavaScript","k6 is a modern load testing tool built by Grafana Labs. Write test scripts in JavaScript, run them in a high-performance Go runtime. Developer-centric with CLI-first workflow, CI\u002FCD integration, and Grafana Cloud for result analysis.",279,{"id":51,"uuid":52,"slug":53,"title":54,"description":55,"author_name":34,"view_count":56,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1396,"729c7c2c-38d7-11f1-9bc6-00163e2b0d79","artillery-modern-load-testing-http-websocket-more-729c7c2c","Artillery — Modern Load Testing for HTTP, WebSocket & More","Node.js load testing toolkit with YAML scenarios covering HTTP, WebSocket, gRPC and Playwright, plus distributed runs on AWS Fargate.",262,{"id":58,"uuid":59,"slug":60,"title":61,"description":62,"author_name":34,"view_count":63,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1117,"42405496-364b-11f1-9bc6-00163e2b0d79","locust-scalable-load-testing-pure-python-42405496","Locust — Scalable Load Testing in Pure Python","Locust is an open-source load testing tool where you define user behavior in plain Python code. Distributed, scalable, and with a real-time web UI for monitoring. No DSL to learn — just write Python.",271,"tokrepo install pack\u002Fapi-testing-stack",{"pageType":66,"pageKey":8,"locale":67,"title":68,"metaDescription":69,"h1":13,"tldr":70,"bodyMarkdown":71,"faq":72,"schema":88,"internalLinks":98,"citations":111,"wordCount":29,"generatedAt":124},"pack","zh","API 测试栈：Bruno + Hurl + k6 替代 Postman \u002F JMeter","六件套开源 API 测试栈：Bruno \u002F Hoppscotch 客户端 + Hurl CI 跑 + k6 \u002F Artillery \u002F Locust 压测。替代 Postman 和 JMeter，无 SaaS 锁定。","六个开源工具完整替代 Postman + JMeter：两个交互客户端 + 一个 CI 跑器 + 三个压测引擎。TokRepo 一条命令装齐。","## 这个 pack 装了什么\n\n这个包收齐了把 Postman 和 JMeter 从现代工程团队替掉的 **六个开源工具**。Postman 2023 后涨价 + 强制云同步把不少团队推走；JMeter 还能用但 XML 脚本和 Java-only 生态在 JavaScript 原生方案面前显得难受。pack 把表面分成三个问题：交互探索 \u002F CI 断言 \u002F 压测。\n\n| # | 资产 | 角色 | 亮点 |\n|---|---|---|---|\n| 1 | Bruno | 交互客户端 | 纯文本 `.bru` 文件，可 git 化 |\n| 2 | Hoppscotch | 交互客户端 | 浏览器优先，可自建，实时协作 |\n| 3 | Hurl | CI 跑器 | 纯文本 DSL，单二进制，Makefile 友好 |\n| 4 | k6 | 压测 | JavaScript 脚本，Grafana 原生面板 |\n| 5 | Artillery | 压测 | YAML 场景，Playwright 驱动浏览器压力 |\n| 6 | Locust | 压测 | 纯 Python 测试，分布式 master-worker |\n\n「交互客户端 + CI 跑器 + 压测」三角覆盖完整生命周期。写接口的时候用 Bruno \u002F Hoppscotch 点；CI 里跑 Hurl 验契约没漂；发版前对 staging 跑 k6 \u002F Artillery \u002F Locust。\n\n## 为什么离开 Postman 和 JMeter\n\n三个推力同时来。**Postman 2023 默认云端化** —— collection 同步到他们服务器，分享要账号，免费档缩水。**JMeter UX 停留在 2005** —— XML 配置、GUI 优先，没有舒服的脚本故事。**CI 要求 diff 可读** —— Postman 导出的 JSON 在 PR 里没法看；Bruno 的 `.bru` 和 Hurl 的纯文本 diff 干净，reviewer 一眼能看出问题。\n\n迁移之外，这套开源 pack 还多了 Postman 没有的能力：\n\n- **同一个压测在三个引擎里跑**做交叉验证（HTTP 重 k6，浏览器流 Artillery，Python 测试组就用 Locust）\n- **Hurl 文件可以当文档** —— 粘进 runbook，任何会 curl 的工程师都看得懂\n- **自建 Hoppscotch** 把企业数据留在自己网络 —— Postman 企业版按席位收费\n\n## 一条命令装齐\n\n```bash\n# 把整个 pack 装进当前项目\ntokrepo install pack\u002Fapi-testing-stack\n\n# 或只装单个\ntokrepo install hurl\ntokrepo install k6\n```\n\nTokRepo CLI 写好 Bruno collection 骨架、`tests\u002Fapi\u002F*.hurl` 目录、`loadtest\u002F` 文件夹（k6 \u002F Artillery \u002F Locust 模板）。每个资产单独带 GitHub Actions 和 GitLab CI 片段。\n\n## 常见踩坑\n\n- **k6 不预热就当生产数据**。k6 默认爬升很快，从 1000 VU 起步前 30 秒服务都在填缓存，p99 看起来比真实差。用 `stages` 加 30-60 秒爬升期。\n- **Hurl 断言比对 body 文本**。断言在 JSON 路径上（`jsonpath \"$.user.id\"`），不要比子串。序列化器换空白或 key 顺序时文本比对会假阳性。\n- **Bruno collection 不分 environments 就分享**。Bruno 支持按环境变量；凭据直接写进 `.bru` 文件就是把密钥泄漏到 git 历史。用 `bru env` 加 `.env.local` 模式。\n- **Locust 单机超高 RPS**。Locust GIL 决定单 Python 进程上限大概 1k-2k RPS；用 `--master` + 多 `--worker`，或者超过 5k RPS 直接换 k6。\n- **只看吞吐忘了 p99**。10k RPS p50=20ms 但 p99=8s 没意义。永远导延迟直方图，不能只看均值。\n\n## 跟其他 pack 的关系\n\n跟 **工作流编排** 天然搭（用 Inngest \u002F Prefect cron 跑夜间压测），跟 **静态站 & 文档生成器** 搭（发布跟 Hurl 测试一致的 OpenAPI 文档，文档和测试同源）。要做测试运行的完整可观测，再叠 **图表 & 数据可视化** 把 k6 CSV 输出渲染进 Apache ECharts 或 Grafana。",[73,76,79,82,85],{"q":74,"a":75},"整套全跑下来收费吗？","不收。每个工具都是开源宽松协议（MIT、Apache 2.0、Hoppscotch 自建是 AGPL）。k6 有付费的 Grafana Cloud k6 提供托管结果存储，但 OSS 二进制本地或 CI 里跑不限量。Artillery 有付费 pro 提供托管报表，核心 CLI 免费。Locust 和 Hurl 完全免费。",{"q":77,"a":78},"比 Postman 怎么样？","Postman 凭成熟 UX 仍然是首次 API 探索最顺的。开源 pack 在 collection \u002F environment \u002F 测试脚本上功能持平，外加两个大优势：文本文件 PR diff 干净、自建后密钥不出网。代价：协作 UX 没那么熟、没内置 API 监控（用 Workflow Orchestration 包补）。",{"q":80,"a":81},"Claude Code \u002F Cursor 能用吗？","能。Claude Code 可以从 OpenAPI 规格生成 Bruno collection、Hurl 测试、k6 脚本 —— TokRepo 资产页给了 subagent prompt。常见用法：给 Claude 一份 `openapi.yaml`，让它生成覆盖每个端点的 `tests\u002Fapi\u002F*.hurl`，然后 CI 里跑 `hurl --test tests\u002Fapi\u002F*.hurl`。Cursor 用户在 `.cursor\u002Frules\u002F` 下有等价规则。",{"q":83,"a":84},"Bruno 跟 Hoppscotch 区别？","Bruno 桌面优先、文件化 —— collection 以 `.bru` 文本存在你硬盘。适合已经用 git 当真相源的小团队。Hoppscotch 浏览器优先可选自建，实时协作模型更丰富 —— 适合产品和 QA 也要看请求结果的场景。多数团队选一个，但渐进迁移时可以共存。",{"q":86,"a":87},"k6 在 CI 跑的运维坑？","k6 即使阈值失败也输出 exit code 0，除非 `--quiet=false` 看 stderr —— 或者更好用 `thresholds` 配 `abortOnFail: true`。很多团队 CI 全绿但偷偷违反了 p99 SLO，因为信了 exit code。另：把 k6 `--out` pipe 成 JSON 当 CI artifact 存，方便对比历次运行。",{"@context":89,"@type":90,"name":91,"description":92,"numberOfItems":93,"publisher":94},"https:\u002F\u002Fschema.org","CollectionPage","API Testing Stack","Open-source replacements for Postman and JMeter — Bruno, Hoppscotch, Hurl, k6, Artillery, Locust.",6,{"@type":95,"name":96,"url":97},"Organization","TokRepo","https:\u002F\u002Ftokrepo.com",[99,103,107],{"url":100,"anchor":101,"reason":102},"\u002Fzh\u002Fpacks\u002Fworkflow-orchestration","工作流编排","压力测试当作定时任务跑",{"url":104,"anchor":105,"reason":106},"\u002Fzh\u002Fpacks\u002Fstatic-site-docs","静态站 & 文档生成器","发布与测试契约一致的 API 文档",{"url":108,"anchor":109,"reason":110},"\u002Fzh\u002Ftools\u002Fclaude-code","Claude Code","从 OpenAPI 自动生成 Hurl + k6 脚本的 agent",[112,116,120],{"claim":113,"source_name":114,"source_url":115},"Bruno is an open-source API client that stores collections as plain text files for git versioning","Bruno","https:\u002F\u002Fwww.usebruno.com",{"claim":117,"source_name":118,"source_url":119},"k6 is a developer-centric load testing tool from Grafana Labs, scripting in JavaScript","grafana\u002Fk6","https:\u002F\u002Fgithub.com\u002Fgrafana\u002Fk6",{"claim":121,"source_name":122,"source_url":123},"Hurl runs HTTP requests defined in plain text and asserts on responses for CI","hurl.dev","https:\u002F\u002Fhurl.dev","2026-05-02T15:00:00Z"]