[spoon-runner] Add video recording support #516
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Even though Spoon provides GIFs for quick glance over test flows I found it useful to be able to record videos that capture the whole device screen. When investigating test flakiness caused by various Android system UI popup interruptions - videos help to diagnose the root cause quickly.
I have been running a variant of the proposed screen recorder on the instrumentation side using executeShellCommand successfully however I wanted something more reliable - something that is controlled by the host runner. It appeared to me that this multi segment
screenrecord
command approach can be executed on the spoon-runner side so I thought why not try that!This PR adds an optional (disabled by default) video recording functionality that, when enabled, produces videos in the mp4 format that get attached to test reports. Since Android's
screenrecord
command can record only up to 3 minutesScreenRecorder
class takes care of executing the command multiple times sequentially. If multiple video files are produced (long test case) they are pulled from the device and Google'sisoparser
library is used to combine all files into a single, continuous video.