Skip to main content

IntegrationTestInput

Struct IntegrationTestInput 

Source
pub struct IntegrationTestInput {
    pub id: NodeId,
    pub name: Option<String>,
    pub description: Option<String>,
    pub args: Option<String>,
    pub env: Option<BTreeMap<String, EnvValue>>,
    pub outputs: BTreeSet<DataId>,
    pub inputs: BTreeMap<DataId, Input>,
    pub send_stdout_as: Option<String>,
    pub events: Vec<TimedIncomingEvent>,
    pub recording_status: Option<Box<RecordingStatus>>,
}
Expand description

Defines the input data and events for integration testing a node.

Most of the fields are similar to the fields defined in the Node struct, which is used to define nodes in a dataflow YAML file.

For integration testing, the most important field is the events field, which specifies the events that should be sent to the node during the test.

Fields§

§id: NodeId

Unique node identifier. Must not contain / characters.

Node IDs can be arbitrary strings with the following limitations:

  • They must not contain any / characters (slashes).
  • We do not recommend using whitespace characters (e.g. spaces) in IDs

Each node must have an ID field.

§Example

nodes:
  - id: camera_node
  - id: some_other_node
§name: Option<String>

Human-readable node name for documentation.

This optional field can be used to define a more descriptive name in addition to a short id.

§Example

nodes:
  - id: camera_node
    name: "Camera Input Handler"
§description: Option<String>

Detailed description of the node’s functionality.

§Example

nodes:
  - id: camera_node
    description: "Captures video frames from webcam"
§args: Option<String>

Command-line arguments passed to the executable.

The command-line arguments that should be passed to the executable/script specified in path. The arguments should be separated by space. This field is optional and defaults to an empty argument list.

§Example

nodes:
  - id: example
    path: example-node
    args: -v --some-flag foo
§env: Option<BTreeMap<String, EnvValue>>

Environment variables for node builds and execution.

Key-value map of environment variables that should be set for both the build operation and the node execution (i.e. when the node is spawned through path).

Supports strings, numbers, and booleans.

§Example

nodes:
  - id: example-node
    path: path/to/node
    env:
      DEBUG: true
      PORT: 8080
      API_KEY: "secret-key"
§outputs: BTreeSet<DataId>

Output data identifiers produced by this node.

List of output identifiers that the node sends. Must contain all output_id values that the node uses when sending output, e.g. through the send_output function.

§Example

nodes:
  - id: example-node
    outputs:
      - processed_image
      - metadata
§inputs: BTreeMap<DataId, Input>

Input data connections from other nodes.

Defines the inputs that this node is subscribing to.

The inputs field should be a key-value map of the following format:

input_id: source_node_id/source_node_output_id

The components are defined as follows:

  • input_id is the local identifier that should be used for this input.

    This will map to the id field of Event::Input events sent to the node event loop.

  • source_node_id should be the id field of the node that sends the output that we want to subscribe to

  • source_node_output_id should be the identifier of the output that that we want to subscribe to

§Example

nodes:
  - id: example-node
    outputs:
      - one
      - two
  - id: receiver
    inputs:
        my_input: example-node/two
§send_stdout_as: Option<String>

Redirect stdout/stderr to a data output.

This field can be used to send all stdout and stderr output of the node as a Dora output. Each output line is sent as a separate message.

§Example

nodes:
  - id: example
    send_stdout_as: stdout_output
  - id: logger
    inputs:
        example_output: example/stdout_output
§events: Vec<TimedIncomingEvent>

List of incoming events for the integration test.

The node event stream will yield these events during the test. Once the list is exhausted, the event stream will close itself.

§recording_status: Option<Box<RecordingStatus>>

Status of the recording that produced this file. Emitted by the DORA_WRITE_EVENTS_TO recorder; None for files produced by older versions of dora (before #1857) or hand-authored fixtures.

Consumers should refuse to replay (or at minimum warn loudly) when this is Some(RecordingStatus::Poisoned { .. }), because the events array is incomplete relative to the original run.

Boxed so the (large) RecordingStatus::Poisoned variant doesn’t inflate IntegrationTestInput’s size for the common-case Clean-or-None recording. This also avoids large_enum_variant lints on TestingInput::Input(...) (32 call sites; widening that enum would be intrusive).

Implementations§

Trait Implementations§

Source§

impl Debug for IntegrationTestInput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for IntegrationTestInput

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<IntegrationTestInput, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for IntegrationTestInput

Source§

fn eq(&self, other: &IntegrationTestInput) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for IntegrationTestInput

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for IntegrationTestInput

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<Source> AccessAs for Source

Source§

fn ref_as<T>(&self) -> <Source as IGuardRef<T>>::Guard<'_>
where Source: IGuardRef<T>, T: ?Sized,

Provides immutable access to a type as if it were its ABI-unstable equivalent.
Source§

fn mut_as<T>(&mut self) -> <Source as IGuardMut<T>>::GuardMut<'_>
where Source: IGuardMut<T>, T: ?Sized,

Provides mutable access to a type as if it were its ABI-unstable equivalent.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsNode<T> for T

Source§

fn as_node(&self) -> &T

Source§

impl<T> AsNodeMut<T> for T

Source§

fn as_node_mut(&mut self) -> &mut T

Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T, As> IGuardMut<As> for T
where T: Into<As>, As: Into<T>,

Source§

type GuardMut<'a> = MutAs<'a, T, As> where T: 'a

The type of the guard which will clean up the temporary after applying its changes to the original.
Source§

fn guard_mut_inner(&mut self) -> <T as IGuardMut<As>>::GuardMut<'_>

Construct the temporary and guard it through a mutable reference.
Source§

impl<T, As> IGuardRef<As> for T
where T: Into<As>, As: Into<T>,

Source§

type Guard<'a> = RefAs<'a, T, As> where T: 'a

The type of the guard which will clean up the temporary.
Source§

fn guard_ref_inner(&self) -> <T as IGuardRef<As>>::Guard<'_>

Construct the temporary and guard it through an immutable reference.
Source§

impl<T> Includes<End> for T

Source§

type Output = End

The result
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more