Documentation
¶
Overview ¶
Package scenario provides a declarative scenario DSL for DDS integration tests. A scenario is a sequence of Steps executed against a Participant. Steps include publishing samples, expecting samples, waiting for quiet periods, and running custom assertions.
Example:
err := scenario.Run(ctx, p,
scenario.Publish("sensor/temp", []byte("42"), dds.DefaultQoS),
scenario.Expect("sensor/temp", dds.DefaultQoS, 100*time.Millisecond, nil),
)
Index ¶
- func Run(ctx context.Context, p dds.Participant, steps ...Step) error
- type Step
- func Assert(desc string, fn func(ctx context.Context, p dds.Participant) error) Step
- func Expect(topic string, qos dds.QoS, timeout time.Duration, match func(dds.Sample) bool) Step
- func ExpectNone(topic string, qos dds.QoS, timeout time.Duration) Step
- func Publish(topic string, payload []byte, qos dds.QoS) Step
- func Wait(d time.Duration) Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Step ¶
type Step interface {
// contains filtered or unexported methods
}
Step is a single action in a scenario.
func Expect ¶
Expect returns a Step that subscribes to topic and waits up to timeout for a sample. If match is non-nil, the step fails if the received sample does not satisfy the predicate.
func ExpectNone ¶
ExpectNone returns a Step that fails if any sample arrives on topic within timeout.
Click to show internal directories.
Click to hide internal directories.