Open Bug 1446965 Opened 3 years ago Updated 5 months ago

[mozlog] Buffer all test logs in 'mach' formatter and flush on failure

Categories

(Testing :: Mozbase, enhancement, P3)

Version 3
enhancement

Tracking

(Not tracked)

People

(Reporter: ahal, Unassigned, Mentored)

References

Details

(Keywords: good-first-bug)

By default, the mach formatter will buffer all TEST_STATUS actions, and only print the ones that failed (this can be overridden by passing in --log-mach-verbose). However the LOG messages aren't buffered. This is confusing because:

1) TEST_STATUS and LOG lines don't appear in the order they were logged
2) A passing TEST_STATUS never appears at all

This makes it difficult to piece together what went wrong if something failed. I think we want to preserve buffering of passing tests by default, and only dump the buffer if something failed.

The tbpl formatter already buffers all test logs, albeit in a tightly coupled fashion. It would be good to extract this into a shared handler.
Priority: -- → P3
Mentor: james
Keywords: good-first-bug

Hi I'm Shraddha, an Outreachy applicant and I would like to work on this.

Assignee: nobody → shraddha.agrawal000

Hi, I am Chhavi, a newcomer and want to understand this bug and want to start working on it.

Where can I find the code piece in which there is a bug? Also, where can I post my doubts?

There are now two people looking at this bug. I think that's fine, but please be aware that others may also be working on a patch; if you want to find a different bug to work on please let me know.

The existing logic for the formatter is in https://searchfox.org/mozilla-central/source/testing/mozbase/mozlog/mozlog/formatters/machformatter.py#297 Notice how the test_status messages are put in a buffer and that's flushed in test_end. The idea here is to do something similar for log messages.

Feel free to ask questions in the bug (i.e. here) on on the #interop irc channel.

Hey, I'm Nikita, an Outreachy applicant. Looks like all of the good first bugs are already assigned to someone, can I get a different bug to work on.

Hi there, I am Eva; an Outreachy applicant looking for a good first bug. Any way you can help Mr. Graham?

Apologies for the shortage of good first bugs in mozlog; it's hard to find easy-to-start with contributions in a relatively small project.

There are two alternative options for people who are still looking:

This might be a silly question, but could we borrow elements of BufferHandler rather than create a new handler? At first glance, the methods look fairly similar to what would be implemented if I made a LogHandler from scratch with the current TbplFormatter buffer functionality.
BufferHandler might be too generic, but thought I'd throw the idea out there in case you see a use for it!

Shraddha: I'm releasing this bug due to inactivity. If you are still interested in working on this please work with jgraham or myself to get started.

Assignee: shraddha.agrawal000 → nobody
You need to log in before you can comment on or make changes to this bug.