pytest-reportlog icon indicating copy to clipboard operation
pytest-reportlog copied to clipboard

Documentation of json format

Open hterik opened this issue 2 years ago • 2 comments

Is the format of the json-stream documented somewhere?

I've tried to follow the code and it appears to be a serialization of a https://docs.pytest.org/en/7.1.x/reference.html#_pytest.reports.TestReport object (or any of the other BaseReport). Is this correct? In that case can that be clarified in documentation?

Also curious if there is any ambition to document the serialized form of the json, or is the reference to the TestReport object enough?

hterik avatar May 31 '22 08:05 hterik

Hi @hterik,

Is this correct?

Yes, exactly.

In that case can that be clarified in documentation?

That it is a serialization of BaseReport? I think so.

Also curious if there is any ambition to document the serialized form of the json, or is the reference to the TestReport object enough?

Not sure how we could document that (I mean, which format, how to present it, etc). I think that for now a mention that it is a serialization of TestReport is harmless, but doesn't really tell much.

I think for now users are best served that if they just produce an output using their suite, and use that as reference.

nicoddemus avatar Jun 02 '22 16:06 nicoddemus

Thanks. Links to TestReport/BaseReport/etc would be great, it has a lot of the necessary information.

Just to note, sample output for reference is ok as an introduction only, but not enough as documentation for a serialization format. Because it only shows you the values that happened to be produced during that single run. It might for example only show outcomes passed and fail, leaving me unaware there is a third outcome; skipped, that my parser must support.

hterik avatar Jun 03 '22 07:06 hterik