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

[Security Solution][Endpoint] Suppress some of the jest console.error noise created by endpoint list middelware #102535

Merged
merged 5 commits into from
Jun 17, 2021

Conversation

paul-tavares
Copy link
Contributor

Summary

  • Suppresses some (but not all) of the errors output to the console during jest test runs.

@paul-tavares paul-tavares added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v7.14.0 auto-backport Deprecated - use backport:version if exact versions are needed labels Jun 17, 2021
@paul-tavares paul-tavares self-assigned this Jun 17, 2021
@paul-tavares paul-tavares requested a review from a team as a code owner June 17, 2021 16:54
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

@@ -82,7 +82,8 @@ type HttpMethods = keyof Pick<
const HTTP_METHODS: HttpMethods[] = ['delete', 'fetch', 'get', 'post', 'put', 'head', 'patch'];

export type ApiHandlerMock<R extends ResponseProvidersInterface = ResponseProvidersInterface> = (
http: jest.Mocked<HttpStart>
http: jest.Mocked<HttpStart>,
options?: { ignoreUnMockedApiRouteErrors?: boolean }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although I added this here, we probably don't want to use it often. Having the errors come out on the console when working on specific test cases is likely desired so that you are aware of what is not mocked from an API standpoint

Copy link
Member

@joeypoon joeypoon 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

Metrics [docs]

✅ unchanged

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

cc @paul-tavares

@paul-tavares paul-tavares merged commit a24d3a7 into elastic:master Jun 17, 2021
@paul-tavares paul-tavares deleted the fix/jest-test-error-noise branch June 17, 2021 19:11
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 17, 2021
… noise created by endpoint list middelware (elastic#102535)

* Mock KibanaServices with services from app context renderer + fix error noise in endpoint host tests
* silence more error noise to the console
* Added options to the ApiHandlerMock function to be able to suppress errors to the console
* Endpoint list - Refactor Fleet mocks for reuse
* Add default http mocks to the app context render test utility
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

Copy link
Contributor

@parkiino parkiino left a comment

Choose a reason for hiding this comment

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

lol i see that you already merged but yayay for no more console warningss

kibanamachine added a commit that referenced this pull request Jun 17, 2021
… noise created by endpoint list middelware (#102535) (#102561)

* Mock KibanaServices with services from app context renderer + fix error noise in endpoint host tests
* silence more error noise to the console
* Added options to the ApiHandlerMock function to be able to suppress errors to the console
* Endpoint list - Refactor Fleet mocks for reuse
* Add default http mocks to the app context render test utility

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 18, 2021
…ets-tab

* 'master' of github.com:elastic/kibana: (93 commits)
  [ML] Remove blank job definition as it is unused and out-of-sync with Elasticsearch (elastic#102506)
  [Lens] Fix wrong error detection on transition to Top values operation (elastic#102384)
  [ML] Anomaly detection job custom_settings improvements (elastic#102099)
  [Cases] Route: Get all alerts attach to a case (elastic#101878)
  Fixes wrong list exception type when creating endpoint event filters list (elastic#102522)
  remove search bar that's not working yet (elastic#102550)
  Migrated Ingest Node Pipeline Functional Tests to use test_user (elastic#102409)
  [Maps] clean up feature editing name space to avoid conflicts with layer settings editing (elastic#102516)
  [canvas] Refactor Storybook from bespoke to standard configuration (elastic#101962)
  [Security Solution] adds wrapSequences method (RAC) (elastic#102106)
  [FTR] Stabilize SSLP functional tests (elastic#102553)
  [K8] Added `Inter` font files for new theme (elastic#102359)
  [Workplace Search] Convert Groups pages to new page template (elastic#102449)
  [DOC] Add experimental disclaimer to rollup jobs (elastic#95624)
  [Security Solution][Endpoint] Suppress some of the jest console.error noise created by endpoint list middelware (elastic#102535)
  [Fleet] Improve performance of Fleet setup (elastic#102219)
  [Alerting] Add event log entry when a rule starts executing (elastic#102001)
  [Fleet] Update docker image of registry used in integration tests (elastic#101911)
  [Asset Management] Osquery telemetry updates (elastic#100754)
  Converts saved object tagging to new management layout (elastic#102284)
  ...

# Conflicts:
#	x-pack/plugins/fleet/kibana.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants