cli icon indicating copy to clipboard operation
cli copied to clipboard

Provide a way to run basic tests

Open wilzbach opened this issue 7 years ago • 1 comments

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 avatar Dec 06 '18 14:12 wilzbach

@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.

stevepeak avatar Jul 18 '19 08:07 stevepeak