pub enum TestingOutput {
ToFile(PathBuf),
ToWriter(Box<dyn Write + Send>),
ToChannel(OutputSender),
}Expand description
Specifies where to write the output data of an integration test.
§Output File Format
The output file is a JSONL (“JSON lines”) file. Each line in the file is a separate JSON object that represents one output sent by the node.
The following fields are present in each output object:
id(string): The output identifier that was used when sending the output.data: The output data (if any), encoded as JSON.- see below for details on the encoding
data_type(string or object): The arrow::datatypes::DataType of the output data- Serialized to JSON using the type’s
serde::Serializeimplementation.
- Serialized to JSON using the type’s
time_offset_secs(float, optional): The time offset in seconds between the start of the node and the time when the output was sent.- This field is omitted if the
DORA_TEST_NO_OUTPUT_TIME_OFFSETenvironment is set.
- This field is omitted if the
§Output Data Encoding
We use the following steps to encode the data field of each output object:
- Convert the data to a
RecordBatchthrough:ⓘRecordBatch::try_from_iter([("inner", data)]) - Convert the
RecordBatchto a JSON object through thearrow_json::ArrayWriter.
Variants§
ToFile(PathBuf)
Writes the output to the given JSONL file.
The file will be created or overwritten.
ToWriter(Box<dyn Write + Send>)
Writes the output as JSONL file to the given writer.
ToChannel(OutputSender)
Sends each output as a JSON object to the paired OutputReceiver.
Create the pair with output_channel and read it with
drain_outputs once the node has finished.
The channel is unbounded because nothing consumes it while the node runs. A bounded channel would deadlock as soon as a node emitted more outputs than its capacity: the node blocks waiting for the daemon’s reply to that very output, and the reply cannot be produced until the output is accepted.
Auto Trait Implementations§
impl !RefUnwindSafe for TestingOutput
impl !Sync for TestingOutput
impl !UnwindSafe for TestingOutput
impl Freeze for TestingOutput
impl Send for TestingOutput
impl Unpin for TestingOutput
impl UnsafeUnpin for TestingOutput
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request