Send all data to stdout/stderr at once to avoid later decoding errors
When displaying a testing session results on screen (stdout/stderr), the
StreamTransport class copy the raw data to a ByteStringStreamTranslator that
then decode it into Unicode text in order to show it properly on screen.
The method used was using a buffer and sending 16 KB chunks, which sometimes
lead to a UnicodeDecodeError exception because a Unicode character would be
spread between two chunks of data, making its decoding impossible.
For instance, the Unicode character ☑ is composed of 3 bytes (0xE2 0x9C 0x93).
If this data is cut and only the first part (0xE2) sent in the data chunk, it
is impossible to decode it into a known Unicode character and plainbox crashes.
To avoid this, we make sure the whole data is sent at once.
commands: remove choice checking for --output-format in cmd_ phase
The problem was introduced with my "commands:cmd_session: don't
get_exporter_names() when not needed" 84e3b2c96566df7322a2dd661c260b60604b55bc.
For each subcommand that we have in plainbox we have split them to (at least)
two files. cmd_* and inv_*. The former having the declaration of arg and its
options and the latter having the implementation. This ensures that every
module that invocation needs is only loaded when we invoke the command.
With my 84e3b2 patch I removed checking of all available exporters in the cmd_
phase. This led to a plainbox starting up 4x faster. I left '?' as the only
possible value of --output-format, and when invoked with that arg, it would
actually pull all exporters from providers and list them, as it would run
through the inv_ phase.
unit:job: Add the siblings creation feature to JobDefinition
Using this field, creating slightly modified versions of a job does not require
duplicating it then changing just a field or two.
Typical use of this feature are job definitions for test we have to run before
and after suspend or even test that we usually replicate for multiple ports
when there's no resource to do the enumeration.
The syntax of this field must be a JSON array of dictionaries where the
keys/value pairs override or add fields to the base job.