selenium: improve ffmpeg reporting
authorAntoine Musso <hashar@free.fr>
Thu, 21 Feb 2019 16:00:32 +0000 (17:00 +0100)
committerAntoine Musso <hashar@free.fr>
Mon, 25 Feb 2019 16:03:13 +0000 (17:03 +0100)
commitc7ecbbd6845d93e035e3d15970a9b9a33f42a5ca
tree1351fb1b72e489a494f03f4beaead9667a702579
parentae87a51b05b69c33cef363930f61121d9bb7820f
selenium: improve ffmpeg reporting

1) stdout/stderr log improvement

Our wdio test suite records video of Selenium test session using ffmpeg,
its stdout/stderr are relayed via console.log() however the new line was
not stripped which is confusing and in case the buffer contains multiple
lines, only the first line had the 'ffmpeg stderr: ' prefix.

Ensure each ffmpeg line is prefixed by logging them individually.

2) exit code / signal

childProcess 'close' event is being passed the exit code and the signal.
We only handled the exit code, thus when ffmpeg is send a signal we
logged:

  ffmpeg exited with code null

Handle the case when the childProcess is send a signal (typically
SIGINT).

Change-Id: I9f509690baa9b7981399a09448582f45c30800d7
tests/selenium/wdio.conf.js