Skip to content

tests: add filter/event tests for type filtering #710

Description

@wolf31o2

Goal

Add tests for the event filter plugin covering single-type, multi-type, empty-filter (pass-all), and unknown-type cases. The package currently lacks a test file.

Files

  • filter/event/event.go, filter/event/plugin.go, filter/event/option.go (read)
  • filter/event/event_test.go (new)

Changes

Add at least:

  • TestEventFilterSingleType: configure the filter for a single event type, push events of varying types through the plugin, assert only the matching type passes.
  • TestEventFilterMultipleTypes: configure two or more allowed types, assert all matching events pass and others are dropped.
  • TestEventFilterPassAll: configure with an empty allow list, assert all events pass through unchanged.
  • TestEventFilterUnknownType: send an event with an unknown type string, assert the filter handles it (per the documented semantics, either drops or passes; match implementation).

Verification

go test -v -race ./filter/event/...

Dependencies

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions