-
Notifications
You must be signed in to change notification settings - Fork 71
Also useful for smoke tests!
Usually it is desirable to have some kind of post-deploy check in your CI to make sure that your new software artefact is working. I hope you wouldn't have someone checking this manually :)
To keep things simple and quick you would often use a bash script which perhaps checks the status code or if you're being fancy you look for a particular string in the response.
It's important to stress that you usually want these tests to be lightweight, you don't just to run all your functional/acceptance tests again as the feedback is slow and could be flaky.
Mockingjay can be a solution for smoke tests because it's declarative, configuration based approach allows you to express your intent without writing any code; and it's fast.
---
- name: Some article on link.springer.com should have a title
request:
uri: /article/10.1007/s12239-015-0085-3
method: GET
response:
code: 200
body: '<h1 id="title" itemprop="headline">Optimizing the performance of vehicle-to-grid (V2G) enabled battery electric vehicles through a smart charge scheduling model'
$ mockingjay-server -config=smoke-test.yaml -realURL=http://link.springer.com
2015/05/28 13:35:57 ✔ Some article on link.springer.com should have a title (GET /article/10.1007/s12239-015-0085-3)
2015/05/28 13:35:57 All endpoints are compatible
You can try this configuration yourself and it will reach to http://link.springer.com to check it's working.