-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Synthetics] Add tests for default alerting service #193235
[Synthetics] Add tests for default alerting service #193235
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
4cda4e7
to
3ef7eaa
Compare
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but a few comments.
I noted that tests involving whether or not the rule is enabled/disabled from settings aren't going to be needed for very much longer. I commented on two instances of such tests but I believe there is more. It's fine to include them for now but just making it known that they won't be long lived.
...observability_solution/synthetics/server/routes/default_alerts/default_alert_service.test.ts
Show resolved
Hide resolved
...observability_solution/synthetics/server/routes/default_alerts/default_alert_service.test.ts
Show resolved
Hide resolved
{} as any | ||
); | ||
service.settings = { defaultConnectors: ['slack', 'email'] } as any; | ||
const result = await service.createDefaultAlertIfNotExist( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to createDefaultRuleIfDoesNotExist
and update the test to use the word rule instead of alert as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ agree, this is a case of perpetuating a bad habit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see 420a7b5
25a562f
to
420a7b5
Compare
98ae623
to
297ad0f
Compare
61e3041
to
a772b8c
Compare
a772b8c
to
9b53ba0
Compare
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
## Summary As noted in elastic#193201, I am attempting to increase module-level testing in Synthetics by strategically targeting critical segments of code that are untested, or very lightly tested, at the module level. While this doesn't provide the same quality assurance as e2e tests, it will help increase our confidence when we make changes that those changes have the intended effects, and that they don't introduce small regressions that may go unnoticed in smoke testing or code review. This PR is WIP as I haven't fully tested the module yet and I can only work on this as time allows. (cherry picked from commit b1290ce)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…193762) # Backport This will backport the following commits from `main` to `8.x`: - [[Synthetics] Add tests for default alerting service (#193235)](#193235) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Justin Kambic","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-23T17:30:02Z","message":"[Synthetics] Add tests for default alerting service (#193235)\n\n## Summary\r\n\r\nAs noted in #193201, I am\r\nattempting to increase module-level testing in Synthetics by\r\nstrategically targeting critical segments of code that are untested, or\r\nvery lightly tested, at the module level. While this doesn't provide the\r\nsame quality assurance as e2e tests, it will help increase our\r\nconfidence when we make changes that those changes have the intended\r\neffects, and that they don't introduce small regressions that may go\r\nunnoticed in smoke testing or code review.\r\n\r\nThis PR is WIP as I haven't fully tested the module yet and I can only\r\nwork on this as time allows.","sha":"b1290ceca87e9a385db5e2be574bdd101caa559e","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0","backport:version"],"title":"[Synthetics] Add tests for default alerting service","number":193235,"url":"https://github.com/elastic/kibana/pull/193235","mergeCommit":{"message":"[Synthetics] Add tests for default alerting service (#193235)\n\n## Summary\r\n\r\nAs noted in #193201, I am\r\nattempting to increase module-level testing in Synthetics by\r\nstrategically targeting critical segments of code that are untested, or\r\nvery lightly tested, at the module level. While this doesn't provide the\r\nsame quality assurance as e2e tests, it will help increase our\r\nconfidence when we make changes that those changes have the intended\r\neffects, and that they don't introduce small regressions that may go\r\nunnoticed in smoke testing or code review.\r\n\r\nThis PR is WIP as I haven't fully tested the module yet and I can only\r\nwork on this as time allows.","sha":"b1290ceca87e9a385db5e2be574bdd101caa559e"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193235","number":193235,"mergeCommit":{"message":"[Synthetics] Add tests for default alerting service (#193235)\n\n## Summary\r\n\r\nAs noted in #193201, I am\r\nattempting to increase module-level testing in Synthetics by\r\nstrategically targeting critical segments of code that are untested, or\r\nvery lightly tested, at the module level. While this doesn't provide the\r\nsame quality assurance as e2e tests, it will help increase our\r\nconfidence when we make changes that those changes have the intended\r\neffects, and that they don't introduce small regressions that may go\r\nunnoticed in smoke testing or code review.\r\n\r\nThis PR is WIP as I haven't fully tested the module yet and I can only\r\nwork on this as time allows.","sha":"b1290ceca87e9a385db5e2be574bdd101caa559e"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Justin Kambic <[email protected]>
Summary
As noted in #193201, I am attempting to increase module-level testing in Synthetics by strategically targeting critical segments of code that are untested, or very lightly tested, at the module level. While this doesn't provide the same quality assurance as e2e tests, it will help increase our confidence when we make changes that those changes have the intended effects, and that they don't introduce small regressions that may go unnoticed in smoke testing or code review.
This PR is WIP as I haven't fully tested the module yet and I can only work on this as time allows.