Skip to content

[ResponseOps][Rules] Add unit tests for Rule Executors edge cases (we already have some e2e tests) #124709

Open

Description

ResponseOps team discussed:
The code can be improved by adding some unit tests around the rule executors
x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type.ts
x-pack/plugins/stack_alerts/server/alert_types/index_threshold/alert_type.ts

In each there is an executor function that we don't have any unit tests for.
This is not a critical risk, as it is quite useful to have the below noted holistic e2e tests, but adding in some 'edge case' parameter value unit tests for the executors could provide confidence in changes quicker (instead of waiting till later / longer into the CI PR execution process to find problems).

End to end tests for rule execution here:
x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/index.ts and x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/index_threshold/index.ts
...These tests across multiple executions and test that conditions are met as expected and actions are scheduled as expected

So we can add this item to a future iteration for the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Feature:Alerting/RuleTypesIssues related to specific Alerting Rules TypesTeam:ResponseOpsLabel for the ResponseOps team (formerly the Cases and Alerting teams)technical debtImprovement of the software architecture and operational architecturetest-coverageissues & PRs for improving code test coveragetests_needed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions