Skip to content

lava_dispatcher: Rework ShellLogger and add unit test for it

See T37054 and T37055 for more context.

For cleaner upstreaming commit 9ac1f101 was reverted and a clean commit was added.

Commit text:

lava_dispatcher: Rework ShellLogger and add unit test for it

The rework has following properties:

1). Add support for \r\n and \r line separators. Some software uses \r as line separators and before that LAVA would simply log entire output as one big line if the software used \r. LAVA would also stall all output until it could read the new line.

2). Make logs preserve unprintable characters such as new lines, carriage return and ANSI terminal escape sequences. This allows for better compatibility with other software that relies on those characters such as Gitlab. The unprintable characters are stripped from output before the logs are displayed in the LAVA's web UI.

Unit test will check various logger inputs with different new line separators and fragmented inputs. (for example, if \r\n gets split between the write calls)

Edited by Igor Ponomarev

Merge request reports