psybizz/http-endpoint-tester
最新稳定版本:v1.0.3
Composer 安装命令:
composer create-project psybizz/http-endpoint-tester
包简介
Test application for http(s) endpoints written in node.js
README 文档
README
A HTTP endpoint tester using node.js, inspired by the node-test-tutorial of David Beath and the talk of Danny Dinneen at the 2014 edition of the Endpoint conference.
The tool is written to be used in a CI pipeline with jenkins, to test endpoints of rest(ful) API's. That's why it depends on environment variables, this makes it easy to use the tool in a CI pipeline.
Usage
initialise environment
npm install
This will install/update all the required modules for running the tests
Also a composer wrapper is provided, implemented to keep our own jenkins as stupid as possible ;)
Run tests
ENDPOINT_PATHS=<path/to/paths/file.json> ENDPOINT_HOST=<host>:<port> SITE_URI=<FQDN> ./node_modules/.bin/mocha --ui tdd
Adding paths to test
Select the project in resources Open paths.json and add the following stanza:
[
{
"path": "/api/info",
"method": "GET",
"headers": {
"header1": "value1",
"header2": "value2"
},
"statusCode": [200, 302],
"public": 1,
"secure": 0,
"requireFQDN": 0,
"timeout": 500
},
{
// another stanza
}
]
path: path to test
method: GET,POST, PUT or PATCH
statuscode: [statuscode(s)]
public: should endpoint be available in production
secure: use http or https (needs to be implemented)
timeout: timeout in milliseconds
requireFQDN: mark a test as optional or required when an site uri has been specified. ( optional parameter )
public and secure are not implemented yet.
NOTE on site_uri: this will be set as host header in the request object as demanded by the HTTP1.1 standard, but the request/request implementation will use this value as proxy. So when the tested host is not identical to the site_uri, you are strongly advised to specify followRedirects to false.
Resources
Todo
- implement https support
psybizz/http-endpoint-tester 适用场景与选型建议
psybizz/http-endpoint-tester 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.3k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「http」 「tests」 「Node.js」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 psybizz/http-endpoint-tester 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 psybizz/http-endpoint-tester 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 psybizz/http-endpoint-tester 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Run Autoprefixer using node.js in you php.
repository php library
无描述信息
A cli tool which generates unit tests.
Installs Node.js, NPM, and Yarn into vendor/bin
Swoole server process management
统计信息
- 总下载量: 1.3k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-23