Closed5
OpenAPIのCI(主にテスト)について考える
OpenAPIのテストツールってあんまりなさそう
- Dredd
- Swagger Test Templates
- その他(これはREST APIテストツールか)
https://www.ossnews.jp/oss_info/article.html?oid=9204
Swagger Test TemplatesはOpenAPI ver3に対応していない…
とりあえずDreddを試してみる
> yarn add -D dredd
yarn add v1.22.10
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
warning dredd > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
[3/5] 🚚 Fetching packages...
[4/5] 🔗 Linking dependencies...
...
info This module is OPTIONAL, you can safely ignore this error
success Saved lockfile.
success Saved 46 new dependencies.
info Direct dependencies
└─ dredd@14.0.0
info All dependencies
...
> yarn dredd --version
yarn run v1.22.10
$ /Users/**********/***********/node_modules/.bin/dredd --version
dredd v14.0.0 (Darwin 19.6.0; x64)
❯ yarn dredd init
? Location of the API description document (apiary.apib) (node:96522) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
? Location of the API description document apiary.apib
? Command to start the API server under test
? Host of the API under test http://127.0.0.1:8080/
? Do you want to use hooks to customize Dredd's behavior? No
? Do you want to report your tests to the Apiary inspector? No
? Found CircleCI configuration, do you want to add Dredd? Yes
Configuration saved to dredd.yml
You can run tests now, with:
$ dredd
このスクラップは2023/02/08にクローズされました