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

[Cases] Unskip MKI tests #168924

Merged
merged 19 commits into from Oct 23, 2023
Merged

[Cases] Unskip MKI tests #168924

merged 19 commits into from Oct 23, 2023

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Oct 16, 2023

Summary

This PR unskips all Cases' serverless tests for MKI. I run all tests without any issues to a Serverless instance deployed on the cloud.

Notable changes:

  • Use the deleteAllCaseItems from the Serverless API service and not the ESS API service. Not using the Serverless API service was causing issues when trying to delete documents from the .kibana_alerting_cases system index.
  • Waiting for the case to be refreshed when updating custom fields. Otherwise, we get a 403 conflict error because the test is too fast.
  • Change the structure of the tests.
  • Fix attachment test for security

Fixes: #165135, #168534, #169005
Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3579, https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3639

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cnasikas cnasikas added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.11.0 v8.12.0 labels Oct 16, 2023
@cnasikas cnasikas self-assigned this Oct 16, 2023
@cnasikas cnasikas removed the v8.11.0 label Oct 16, 2023
await retry.waitFor('update toast exist', async () => {
return await testSubjects.exists('toastCloseButton');
});

await testSubjects.click('toastCloseButton');

await sync.click();
await header.waitUntilLoadingHasFinished();
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to wait here for the case to be refreshed. Otherwise we get an 403 conflict error because the test is too fast.

await dashboard.waitForRenderComplete();
});

after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed to avoid permission errors when deleting directly a document from the .kibana_alerting_cases system index.

@cnasikas cnasikas marked this pull request as ready for review October 16, 2023 11:18
@cnasikas cnasikas requested a review from a team as a code owner October 16, 2023 11:18
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@cnasikas cnasikas added the ci:skip-cypress-osquery Skips osquery cypress checks label Oct 17, 2023
@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@cnasikas cnasikas requested review from a team as code owners October 20, 2023 07:56
@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Oct 20, 2023

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Osquery Cypress Tests #4 / ALL - Live Query Packs should run live pack should run live pack
  • [job] [logs] Jest Tests #18 / rules_settings_modal renders query delay settings correctly

Metrics [docs]

✅ unchanged

History

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

cc @cnasikas

@cnasikas cnasikas merged commit 2146a7e into elastic:main Oct 23, 2023
34 checks passed
@cnasikas cnasikas deleted the fix_mki_tests branch October 23, 2023 09:21
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 23, 2023
@cnasikas
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.11

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

Questions ?

Please refer to the Backport tool documentation

cnasikas added a commit to cnasikas/kibana that referenced this pull request Oct 24, 2023
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 2146a7e)

# Conflicts:
#	x-pack/test_serverless/functional/test_suites/observability/cases/attachment_framework.ts
#	x-pack/test_serverless/functional/test_suites/observability/cases/list_view.ts
#	x-pack/test_serverless/functional/test_suites/observability/cases/view_case.ts
#	x-pack/test_serverless/functional/test_suites/security/ftr/cases/list_view.ts
#	x-pack/test_serverless/functional/test_suites/security/ftr/cases/view_case.ts
#	x-pack/test_serverless/functional/test_suites/security/index.ts
cnasikas added a commit that referenced this pull request Oct 24, 2023
# Backport

This will backport the following commits from `main` to `8.11`:
- [[Cases] Unskip MKI tests
(#168924)](#168924)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2023-10-23T09:21:25Z","message":"[Cases]
Unskip MKI tests (#168924)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2146a7ef1634a06cf6b4b70edc55dd22fd5b6a4c","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","Team:ResponseOps","Feature:Cases","ci:skip-cypress-osquery","v8.11.0","v8.12.0"],"number":168924,"url":"#168924
Unskip MKI tests (#168924)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2146a7ef1634a06cf6b4b70edc55dd22fd5b6a4c"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"#168924
Unskip MKI tests (#168924)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2146a7ef1634a06cf6b4b70edc55dd22fd5b6a4c"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment