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] Add API tests for index exists endpoint #146400

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

peteharverson
Copy link
Contributor

@peteharverson peteharverson commented Nov 28, 2022

Summary

Adds tests to check the response of the index exists endpoint:

/api/ml/index_exists

Also fixed the behavior of the endpoint when passed an index with a wilcard expression so that it no longer returns true if an index does not exist matching the expression by adding allow_no_indices: false to the query parameters.

Part of #142456

Checklist

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

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.

LGTM

@peteharverson
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 445 451 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 521 527 +6
total +21

History

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

cc @peteharverson

@peteharverson peteharverson merged commit 4294e3b into elastic:main Dec 7, 2022
@peteharverson peteharverson deleted the ml-index-exists-api-tests branch December 7, 2022 13:12
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 7, 2022
## Summary

Adds tests to check the response of the index exists endpoint:

```
/api/ml/index_exists
```

Also fixed the behavior of the endpoint when passed an index with a
wilcard expression so that it no longer returns `true` if an index does
not exist matching the expression by adding `allow_no_indices: false` to
the query parameters.

Part of elastic#142456

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit 4294e3b)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 7, 2022
# Backport

This will backport the following commits from `main` to `8.6`:
- [[ML] Add API tests for index exists endpoint
(#146400)](#146400)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Pete
Harverson","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-07T13:12:17Z","message":"[ML]
Add API tests for index exists endpoint (#146400)\n\n##
Summary\r\n\r\nAdds tests to check the response of the index exists
endpoint:\r\n\r\n```\r\n/api/ml/index_exists\r\n```\r\n\r\nAlso fixed
the behavior of the endpoint when passed an index with a\r\nwilcard
expression so that it no longer returns `true` if an index does\r\nnot
exist matching the expression by adding `allow_no_indices: false`
to\r\nthe query parameters.\r\n\r\nPart of
https://github.com/elastic/kibana/issues/142456\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"4294e3b17f559a0073f5453a47df7e9dc83c58ba","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review",":ml","release_note:skip","test-api-integration","v8.6.0","v8.7.0"],"number":146400,"url":"https://github.com/elastic/kibana/pull/146400","mergeCommit":{"message":"[ML]
Add API tests for index exists endpoint (#146400)\n\n##
Summary\r\n\r\nAdds tests to check the response of the index exists
endpoint:\r\n\r\n```\r\n/api/ml/index_exists\r\n```\r\n\r\nAlso fixed
the behavior of the endpoint when passed an index with a\r\nwilcard
expression so that it no longer returns `true` if an index does\r\nnot
exist matching the expression by adding `allow_no_indices: false`
to\r\nthe query parameters.\r\n\r\nPart of
https://github.com/elastic/kibana/issues/142456\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"4294e3b17f559a0073f5453a47df7e9dc83c58ba"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146400","number":146400,"mergeCommit":{"message":"[ML]
Add API tests for index exists endpoint (#146400)\n\n##
Summary\r\n\r\nAdds tests to check the response of the index exists
endpoint:\r\n\r\n```\r\n/api/ml/index_exists\r\n```\r\n\r\nAlso fixed
the behavior of the endpoint when passed an index with a\r\nwilcard
expression so that it no longer returns `true` if an index does\r\nnot
exist matching the expression by adding `allow_no_indices: false`
to\r\nthe query parameters.\r\n\r\nPart of
https://github.com/elastic/kibana/issues/142456\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"4294e3b17f559a0073f5453a47df7e9dc83c58ba"}}]}]
BACKPORT-->

Co-authored-by: Pete Harverson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants