Repository navigation
Propagate timestamps from CallInfo to TestReport objects - #10711
Conversation
TestReport objects stored only the information about stage duration. This is not enough to correlate pytest stages with external events. Timestamps are already there in CallInfo. They just needed to be propagated to TestReport objects, so that they can be read when TestReports are exported externally (for example with --reportlog option)
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
Just for the sake of it we should add some unittest for the feature
nicoddemus
left a comment
There was a problem hiding this comment.
As @RonnyPfannschmidt mentions, we need a unittest for the feature, ideally we also need to ensure that the serialization/unserialization will work for those new attributes if we want to make sure it will also work out of the box with pytest-reportlog.
Co-authored-by: Bruno Oliveira <[email protected]>
38dfbdd to
2808854
Compare
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
Looks good, wondering if we have a way to make a unittest for this
|
@RonnyPfannschmidt what do you mean? I added a unit test in testing/test_reports.py that tests serialization of the new fields. That should be enough for pytest-reportlog to work as it only calls pytest_report_to_serializable and saves the result to a json file. |
|
The test is indeed enough, it however involves quite some machinery that we currently have no nicely testable way to leave out |
|
Aka there should be one test that just verifies the transfer from callinfo to report and a second test that only verifies the serialization But we lack the infrastructure for those pinpointed tests, so we can't exactly ask for their addition in good conscience |
…10711) This makes it possible to correlate pytest stages with external events, and also makes it readable when TestReports are exported externall (for example with pytest-reportlog). Closes pytest-dev#10710
…10711) This makes it possible to correlate pytest stages with external events, and also makes it readable when TestReports are exported externall (for example with pytest-reportlog). Closes pytest-dev#10710
TestReport objects stored only the information about stage duration. This is not enough to correlate pytest stages with external events. Timestamps are already there in CallInfo. They just needed to be propagated to TestReport objects, so that they can be read when TestReports are exported externally (for example with --reportlog option)
Closes #10710