Description
openedon Feb 4, 2022
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.