Provide a way to run basic tests
It would be awesome if there's omg test and with it there's a standard way of testing OMG services, s.t. one can just write omg test in one's favorite CI service and then all tests run.
The basic cases
- checking the API response and comparing it with a response
- checking for errors (i.e. 400: missing attributes )
should be rather easy and could even be provided in Storyscript, e.g.
test.story
digest = hashes digest method: "sha1" data: "hello world"
assert digest == "..."
exception = capture_exception hashes digest no_data: "foo"
assert capture_exception.message = "MalformedContent: Attribute `data` is required."
However, if a service has to access resources outside of its Docker instance, things will be harder to test.
Though ideally, omg test would allow to capture/intercept those requests.
@wilzbach this is certainly insightful and inline with ideas we have tossed around.
tl;dr -- yes! and we also should talk about exporting test suites based on previously called actions.
I can see a feature in the OMG App that records commands (included all data points collected) as a history of commands that ran. The developer could then click re-run on those commands to assert they result in the same(ish) results. This could result in an exportable test suite to run in a CI way.
Obviously, there are data points that will change on every request, but this could result in a really great feature.