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

[Logs UI] Update alert executor tests #75764

Merged

Conversation

Kerry350
Copy link
Contributor

Summary

This ticket closes #69261.

It updates the executor unit tests, firstly to add coverage for the group by functionality (previously only the ungrouped scenario was tested), and to simplify the approach.

ℹ️ To expand on "simplify the approach": Previously there was a lot of end-to-end mocking in place, to the point that we were mocking on top of the mocks provided by the alerting framework, this was hard to follow / amend, and given that we had mocks on top of mocks there wasn't actually any added confidence that things were working as expected.

This approach strips things back a bit and tests smaller units, rather than trying to mimic a functional test via unit testing. I wanted to make sure the logic that is most important is more heavily emphasised (filter generation, query generation and the processing of results). This is also important as other code starts to use smaller units of the executor (e.g. chart preview data).

@Kerry350 Kerry350 added v8.0.0 Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Aug 24, 2020
@Kerry350 Kerry350 added this to the Logs UI 7.10 milestone Aug 24, 2020
@Kerry350 Kerry350 requested a review from a team August 24, 2020 14:25
@Kerry350 Kerry350 self-assigned this Aug 24, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@Kerry350
Copy link
Contributor Author

@elasticmachine merge upstream

@Kerry350
Copy link
Contributor Author

Kerry350 commented Sep 2, 2020

@elasticmachine merge upstream

@Kerry350
Copy link
Contributor Author

Kerry350 commented Sep 4, 2020

@elasticmachine merge upstream

@afgomez afgomez self-requested a review September 4, 2020 17:06
@Kerry350
Copy link
Contributor Author

Kerry350 commented Sep 7, 2020

@elasticmachine merge upstream

Copy link
Contributor

@afgomez afgomez left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@Kerry350 Kerry350 merged commit ea47ff1 into elastic:master Sep 7, 2020
Kerry350 added a commit to Kerry350/kibana that referenced this pull request Sep 7, 2020
Kerry350 added a commit that referenced this pull request Sep 7, 2020
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 8, 2020
…' of github.com:jloleysens/kibana into ilm/fix/pre-existing-policy-with-no-existing-repository

* 'ilm/fix/pre-existing-policy-with-no-existing-repository' of github.com:jloleysens/kibana:
  fix empty string in selected indices (elastic#76855)
  [Security Solution] Refactor OverviewHost and OverviewNetwork to use Search Strategy (elastic#76409)
  Use Search API in Timelion (sync) (elastic#75115)
  [telemetry] expose getIsOptedIn function in plugin start contract (elastic#75143)
  [ILM] Clean up remaining js files and any typings (elastic#76803)
  [Logs UI] Shared `<LogStream />` component (elastic#76262)
  [Security Solution] Add unit test for all hosts (elastic#76752)
  [Security Solution] Add unit test for authentications search strategy (elastic#76665)
  Do not apply search source data for tsvb (elastic#75137)
  [Security Solution] Refactor NetworkDns to use Search Strategy (elastic#76250)
  [SECURITY SOLUTION] Adds 'cypress:open-as-ci' command (elastic#76125)
  [Logs UI] Update alert executor tests (elastic#75764)
  [Functional] Unskip vega tests and fix flakiness (elastic#76600)
  [Data] Query String Input accepts classname prop (elastic#76848)
  [ML] Swim lane pagination for viewing by job id (elastic#76847)
  [Security Solution] Refactor MatrixHistogram to use Search Strategy (elastic#76603)
  [APM] Use the outcome field to calculate the transaction error rate chart (elastic#75528)
  [APM] Use observer.hostname instead of observer.name (elastic#76074)
  Legacy logging: fix remoteAddress being duplicated in userAgent field (elastic#76751)
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 8, 2020
…s-for-710

* 'master' of github.com:elastic/kibana:
  [Search] Use async es client endpoints (elastic#76872)
  fix empty string in selected indices (elastic#76855)
  [Security Solution] Refactor OverviewHost and OverviewNetwork to use Search Strategy (elastic#76409)
  Use Search API in Timelion (sync) (elastic#75115)
  [telemetry] expose getIsOptedIn function in plugin start contract (elastic#75143)
  [ILM] Clean up remaining js files and any typings (elastic#76803)
  [Logs UI] Shared `<LogStream />` component (elastic#76262)
  [Security Solution] Add unit test for all hosts (elastic#76752)
  [Security Solution] Add unit test for authentications search strategy (elastic#76665)
  Do not apply search source data for tsvb (elastic#75137)
  [Security Solution] Refactor NetworkDns to use Search Strategy (elastic#76250)
  [SECURITY SOLUTION] Adds 'cypress:open-as-ci' command (elastic#76125)
  [Logs UI] Update alert executor tests (elastic#75764)
  [Functional] Unskip vega tests and fix flakiness (elastic#76600)
  [Data] Query String Input accepts classname prop (elastic#76848)
  [ML] Swim lane pagination for viewing by job id (elastic#76847)
  [Security Solution] Refactor MatrixHistogram to use Search Strategy (elastic#76603)
  [APM] Use the outcome field to calculate the transaction error rate chart (elastic#75528)
  [APM] Use observer.hostname instead of observer.name (elastic#76074)
  Legacy logging: fix remoteAddress being duplicated in userAgent field (elastic#76751)

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
#	x-pack/plugins/index_lifecycle_management/common/types/index.ts
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/node_allocation.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/warm_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/services/api.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs UI] [Alerting] Expand executor tests
4 participants