Skip to content
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

Merged
merged 7 commits into from
Sep 23, 2024

Conversation

justinkambic
Copy link
Contributor

@justinkambic justinkambic commented Sep 18, 2024

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.

@justinkambic justinkambic added release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.16.0 labels Sep 18, 2024
@justinkambic justinkambic self-assigned this Sep 18, 2024
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@justinkambic justinkambic force-pushed the test-default-alerting-service branch 2 times, most recently from 4cda4e7 to 3ef7eaa Compare September 20, 2024 20:01
@justinkambic justinkambic marked this pull request as ready for review September 20, 2024 20:01
@justinkambic justinkambic requested a review from a team as a code owner September 20, 2024 20:01
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@justinkambic justinkambic added the backport:version Backport to applied version labels label Sep 20, 2024
Copy link
Contributor

@dominiqueclarke dominiqueclarke left a 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.

{} as any
);
service.settings = { defaultConnectors: ['slack', 'email'] } as any;
const result = await service.createDefaultAlertIfNotExist(
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see 420a7b5

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Sep 20, 2024
@justinkambic justinkambic force-pushed the test-default-alerting-service branch from 25a562f to 420a7b5 Compare September 20, 2024 20:18
@justinkambic justinkambic enabled auto-merge (squash) September 20, 2024 20:18
@justinkambic justinkambic force-pushed the test-default-alerting-service branch from 98ae623 to 297ad0f Compare September 21, 2024 02:57
@justinkambic justinkambic force-pushed the test-default-alerting-service branch from 61e3041 to a772b8c Compare September 23, 2024 14:47
@justinkambic justinkambic force-pushed the test-default-alerting-service branch from a772b8c to 9b53ba0 Compare September 23, 2024 14:47
@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 23, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 272caec
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-193235-272caec750a7

Failed CI Steps

Metrics [docs]

✅ unchanged

History

  • 💔 Build #236406 failed a772b8c1c5b75937bb7a01274c220dbfb161613c
  • 💔 Build #236148 failed 61e3041d1135ffa96f674e5980006c6e980641a7
  • 💔 Build #236116 failed 98ae623bd82d931d28946a78077b405dff2b8207

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @justinkambic

@justinkambic justinkambic merged commit b1290ce into elastic:main Sep 23, 2024
37 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 23, 2024
## 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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 23, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants