Skip to content

[ML] Add ML plugin contract mocks#96265

Merged
qn895 merged 8 commits intoelastic:masterfrom
qn895:ml-mocks
Apr 8, 2021
Merged

[ML] Add ML plugin contract mocks#96265
qn895 merged 8 commits intoelastic:masterfrom
qn895:ml-mocks

Conversation

@qn895
Copy link
Member

@qn895 qn895 commented Apr 5, 2021

Summary

This PR addresses #66603 by adding jest mocks for ML plugins (both public and server API). It also replaces mlServicesMock for security solutions from #65583 with the new mock.

Checklist

@qn895 qn895 self-assigned this Apr 5, 2021
@qn895 qn895 added :ml release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0 labels Apr 5, 2021
@qn895 qn895 requested review from darnautov and rylnd April 5, 2021 22:02
@qn895
Copy link
Member Author

qn895 commented Apr 6, 2021

@elasticmachine merge upstream

@qn895 qn895 marked this pull request as ready for review April 6, 2021 15:57
@qn895 qn895 requested review from a team as code owners April 6, 2021 15:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Changes look great, happy to get this code into the right plugin 😉 . The existing mocks certainly serve our immediate needs, but we'll reach out (likely with a PR) if/when that changes!


import { MlPluginSetup } from '../../../../ml/server';
import { elasticsearchServiceMock } from '../../../../../../src/core/server/mocks';
import { mlPluginServerMock } from '../../../../ml/server/mocks';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think kibana preference is to import these mocks directly in the consuming tests, but this makes sense to keep changes here to a minimum 👍 We (SecSol) can absolutely do this in a followup PR.

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@qn895
Copy link
Member Author

qn895 commented Apr 7, 2021

@elasticmachine merge upstream

@qn895 qn895 added the auto-backport Deprecated - use backport:version if exact versions are needed label Apr 7, 2021
@qn895
Copy link
Member Author

qn895 commented Apr 7, 2021

@elasticmachine merge upstream

@darnautov
Copy link
Contributor

@elasticmachine merge upstream

@qn895
Copy link
Member Author

qn895 commented Apr 8, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @qn895

@qn895 qn895 merged commit 955c46b into elastic:master Apr 8, 2021
@qn895 qn895 deleted the ml-mocks branch April 8, 2021 17:15
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 8, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #96610

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Apr 8, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Quynh Nguyen <43350163+qn895@users.noreply.github.com>
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 :ml release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants