-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test coverage for error events #340
Comments
Please can I work on this? |
Go for it @sheetalsingala. Please let me know if you have any doubts. |
Hey @sheetalsingala I've updated the issue description about the test cases we should add. Feel free to choose one or more from the list |
@PrasadG193 I would like to work on the following test cases:
|
@Divya063 awesome! Please let me know if you need any help |
- Validates error events are skipped when the error event is not configured for a resource in test config. - Validate that error events are skipped when an event occurs for a namespace which is not added in resource_config Fixes part of #340
Hi, Thanks everyone involved! |
Describe the bug
In e2e test suite, we mock resource creation with fake client and verify the BotKube event generations.
https://github.com/infracloudio/botkube/blob/develop/test/e2e/notifier/create/create.go#L46
We need to add similar test cases to verify error event handling.
We can use client-go Event interface for creating new event
Resource configuration can be mocked by setting/altering values in
utils.AllowedUpdateEventsMap
andutils.AllowedEventKindsMap
https://github.com/infracloudio/botkube/blob/develop/pkg/utils/utils.go#L148Add test cases to validate the following behavior:
Validate error events are handled for a resource with
events: [all]
in test config https://github.com/infracloudio/botkube/blob/develop/test/resource_config.yaml - @Divya063Validate error events are handled with only
events: [error]
config for a resource - @Divya063Validate error events are skipped when
error
event is not configured for a resource in test config. e.gevents: [create, update, delete]
- @Divya063Validate that error events are skipped when an event occurs for a namespace which is not configured
Validate that error events are skipped when an event occurs for a resource which is not added in resource_config - @Divya063
Each test case can be added as a separate PR. Multiple PR as expected for this task.
Guidelines for contributors:
The text was updated successfully, but these errors were encountered: