tests: allow to test the number of events emitted by a transform #20278
Labels
domain: unit tests
Anything related to Vector's unit testing feature
type: feature
A value-adding code addition that introduce new functionality.
A note for the community
Use Cases
Vector transforms have the ability to emit multiple events per input event if an array is assigned to the root
.
event:However, there seems to be no way to test the expected numbers of events emitted:
In our opinion, testing the number of events emitted by a transform is an important testing condition as well.
Attempted Solutions
There does not seem to be a way to test the number of events emitted by a transform.
Proposal
We propose to add an extra keyword to the
outputs
elements. For example:For most use cases,
number_of_events
will typically be1
. However, to fully preserve backwards compatibility, there should be no default and this check enforced only ifnumber_of_events
is present or non null.References
No response
Version
vector 0.36.1 (x86_64-unknown-linux-gnu 2857180 2024-03-11 14:32:52.417737479)
The text was updated successfully, but these errors were encountered: