-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Functional tests - refactor response code checks #127875
Conversation
Pinging @elastic/ml-ui (:ml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Could you add an example of the new failure response output in the PR description?
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @pheyos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement. LGTM
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
This PR refactors the way how we assert response codes from API requests in our functional tests. (cherry picked from commit f4c4fd6) # Conflicts: # x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/new_job_caps.ts # x-pack/test/functional/services/ml/api.ts
This PR refactors the way how we assert response codes from API requests in our functional tests. (cherry picked from commit f4c4fd6) # Conflicts: # x-pack/test/api_integration/apis/ml/anomaly_detectors/forecast_with_spaces.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/get.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/new_job_caps.ts # x-pack/test/api_integration/apis/ml/datafeeds/update.ts # x-pack/test/api_integration/apis/ml/results/get_category_definition.ts # x-pack/test/api_integration/apis/ml/results/get_category_examples.ts # x-pack/test/api_integration/apis/transform/reset_transforms.ts # x-pack/test/functional/services/ml/api.ts # x-pack/test/functional/services/ml/test_resources.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
) This PR refactors the way how we assert response codes from API requests in our functional tests. (cherry picked from commit f4c4fd6) # Conflicts: # x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/new_job_caps.ts # x-pack/test/functional/services/ml/api.ts
) This PR refactors the way how we assert response codes from API requests in our functional tests. (cherry picked from commit f4c4fd6) # Conflicts: # x-pack/test/api_integration/apis/ml/anomaly_detectors/forecast_with_spaces.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/get.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/jobs_exist_spaces.ts # x-pack/test/api_integration/apis/ml/data_frame_analytics/new_job_caps.ts # x-pack/test/api_integration/apis/ml/datafeeds/update.ts # x-pack/test/api_integration/apis/ml/results/get_category_definition.ts # x-pack/test/api_integration/apis/ml/results/get_category_examples.ts # x-pack/test/api_integration/apis/transform/reset_transforms.ts # x-pack/test/functional/services/ml/api.ts # x-pack/test/functional/services/ml/test_resources.ts
Summary
This PR refactors the way how we assert response codes from API requests in our functional tests.
Details
.expect(someStatusCode)
occurrances in supertest requests with a separate call ofassertResponseStatusCode
from theml.api
ortransform.api
service, which makes sure to log the response body in case of an assertion failure.