- Test data streaming pipelines (CSV, Kafka, SSE)
- Validate that data correctly flows from input to output
- Debug stream configurations without processing overhead
- Test read timeout behavior with actual data buffering
- Verify integration between different stream types
- Test data flow end-to-end without transformation
Echo Processor
The Test Lens uses the lens_echo_processor, which implements a pass-through mechanism for data flow testing.Processor Behavior
The Echo processor:- Stores incoming data in an internal queue
- Returns data unchanged when read
- Acts as a buffer between input and output streams
- Tracks statistics inherited from LensProcessorBase
Implementation Details
Creating a Test Lens
To create a Test Lens, register it with the Echo processor:Use Cases
The Test Lens is designed for testing data streaming and pipeline functionality:- CSV File Streaming - Test streaming CSV files through the lens to validate file reader integration.
- Kafka Integration Testing - Test reading from and writing to Kafka topics through the lens.
- Server-Side Events (SSE) Testing - Validate that Server-Side Events streams correctly output data.
- Read Timeout Testing - Test blocking read behavior with configurable timeout parameters.
- Data Flow Validation - Verify that data correctly flows from input streams to output streams without modification.
Examples
CSV Reader Test
This example demonstrates streaming a CSV file through a Test lens:Kafka Reader Test
This example demonstrates reading from Kafka topics through a Test Lens:Kafka Reader/Writer Test
This example demonstrates streaming data through a Test Lens from Kafka input to Kafka output:Server-Side Events Reader Test
This example demonstrates reading Lens output via Server-Side Events (SSE):Read Timeout Test
This example demonstrates testing read timeout functionality with the Test Lens:Supported Input Streams
The Test Lens can accept the following input stream types:- csv_file_reader - Read data from CSV files
- kafka_reader - Read messages from Kafka topics
- event_emitter - Generate test events
Supported Output Streams
The Test Lens can output to the following stream types:- kafka_writer - Write messages to Kafka topics
- server_sent_events_writer - Stream events via SSE