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

[ML] Initial API integration tests for ML jobs in spaces #84789

Merged
merged 6 commits into from
Dec 7, 2020

Conversation

pheyos
Copy link
Member

@pheyos pheyos commented Dec 2, 2020

Summary

This PR adds initial API integration tests for the endpoints related to ML jobs in spaces.

Details

Tests

Overall 57 new tests have been added for the following APIs:

  • anomaly_detectors
    • GET /api/ml/anomaly_detectors
    • PUT /api/ml/anomaly_detectors
    • POST /api/ml/anomaly_detectors (open)
    • POST /api/ml/anomaly_detectors (close)
    • DELETE /api/ml/anomaly_detectors
  • data_frame/analytics
    • GET /api/ml/data_frame/analytics
    • GET /api/ml/data_frame/analytics (stats)
    • POST /api/ml/data_frame/analytics (update)
    • DELETE /api/ml/data_frame/analytics
  • jobs
    • POST /api/ml/jobs/close_jobs
    • POST /api/ml/jobs/delete_jobs
    • POST /api/ml/jobs/jobs_exist
    • POST /api/ml/jobs/jobs_summary
  • saved objects
    • GET /api/ml/saved_objects/status
    • GET /api/ml/saved_objects/sync
    • GET /api/ml/saved_objects/initialize
    • POST /api/ml/saved_objects/assign_job_to_space
    • POST /api/ml/saved_objects/remove_job_from_space
    • GET /api/ml/saved_objects/jobs_spaces
    • POST /api/ml/saved_objects/can_delete_jobs

Test services

  • The ccommonConfig and testExecution are now also available in API integration tests
  • The following api service methods can now be called with a space parameter (optional) that will be used in the query URL:
    • createAnomalyDetectionJob
    • createDatafeed
    • createDataFrameAnalyticsJob
  • The following api services are added:
    • createAnomalyDetectionJobES
    • deleteAnomalyDetectionJobES
    • datafeedExist
    • waitForDatafeedToNotExist
    • createDatafeedES
    • deleteDatafeedES
    • closeAnomalyDetectionJob
    • createDataFrameAnalyticsJobES
    • asignJobToSpaces
    • removeJobFromSpaces
    • assertJobSpaces
  • Add some debug logging to the api service
  • Add users and groups to access all spaces or only one non-default space
  • The following test_resources service methods are added:
    • getSavedObjectIdsByType
    • deleteMlSavedObjectByJobId
    • cleanMLSavedObjects

@pheyos pheyos added :ml v8.0.0 release_note:skip Skip the PR/issue when compiling release notes test-api-integration v7.11.0 labels Dec 2, 2020
@pheyos pheyos self-assigned this Dec 2, 2020
@pheyos pheyos requested a review from a team as a code owner December 2, 2020 16:42
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

Code LGTM 🥳

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

Added a nitpick comment, but on the whole LGTM.
Great work! Thanks for getting these tests in so quickly.

x-pack/test/functional/services/ml/api.ts Outdated Show resolved Hide resolved
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Distributable file count

id before after diff
default 46921 47681 +760

History

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

@pheyos pheyos merged commit 0366a89 into elastic:master Dec 7, 2020
@pheyos pheyos deleted the api_tests_ml_spaces branch December 7, 2020 15:27
pheyos added a commit to pheyos/kibana that referenced this pull request Dec 7, 2020
This PR adds initial API integration tests for the endpoints related to ML jobs in spaces.
pheyos added a commit that referenced this pull request Dec 8, 2020
…5164)

This PR adds initial API integration tests for the endpoints related to ML jobs in spaces.
@walterra walterra mentioned this pull request Jan 20, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml release_note:skip Skip the PR/issue when compiling release notes test-api-integration v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants