On 08/09/2012 02:24 PM, Mikolaj Izdebski wrote:
CLI interface.
I assumed there would be only 1 test per file, but that could be xtended of course.
It might make sense to have several tests in on file IMHO. BTW, the
current json return value is actually a list of results for that reason.
> - Returns a json object as today, although it can also be an error object.
I really don't like this point. Usually there are only 2 things to be returned:
check status and additional notes. IMO the first one should just be exit status
of the process, the second - stdout. If there are some needs, you could alternatively
return a JSON object. So you first try to parse the reply as JSON, if it fails you
assume it's plain text.
Niote that the current version also returns attachments (this is not
implemented in the current plugin interface :( ) So, we are returning a
list of results. Each result contains a list of attachments. So. some
kind of format is needed. We can invent our own, use e. g. YAML or just
stick with json. Being lazy, I prefer the last...
That said, simple returns like status+ notes could be returned as
lines, one per test.
BTW,, an alternative might be to skip the comments and expand the cli
interface to accept two commands: 'config' which returns registration
data, and 'run <tests>' which runs the tests. Not much parsing is needed
to handle that...