From 939c87d95342c61f03c853cb3b34c9f412c303b0 Mon Sep 17 00:00:00 2001 From: Juan Pablo Djeredjian Date: Tue, 24 Oct 2023 09:18:42 +0200 Subject: [PATCH] [Security Solution] Unskip tests for `detection_response` Cypress tests and enable Serverless run (#169218) ## Summary Flaky test runner for Cypress tests in: - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_alerts` - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/value_lists` - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation` ## Changes - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts` **tagged to run on Serverless** - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts` **tagged to run on Serverless** - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts` **tagged to run on Serverless** - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts` **tagged to run on Serverless** - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts` **tagged to run on Serverless** - `x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/deletion/rule_delete.cy.ts` **added disableAutorefresh() to avoid flakiness** ## Related failing-test issues ### `detection_response/detection_alerts` 1. https://github.com/elastic/kibana/issues/169091 **Marked as `legit-flake` and assigned to @elastic/security-detection-engine** 3. https://github.com/elastic/kibana/issues/163885 ### `detection_response/value_lists` 4. https://github.com/elastic/kibana/issues/165699 ### `detection_response/rule_creation` 5. https://github.com/elastic/kibana/issues/163691 ## Flaky test runner - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3583 - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3615 [SERVERLESS ONLY] - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3656 [Serverless without indicator match and saved queries] --- .../rule_creation/custom_query_rule_data_view.cy.ts | 3 +-- .../rule_creation/event_correlation_rule.cy.ts | 3 +-- .../rule_creation/machine_learning_rule.cy.ts | 8 ++------ .../detection_response/rule_creation/new_terms_rule.cy.ts | 3 +-- .../e2e/detection_response/rule_creation/override.cy.ts | 3 +-- .../rule_actions/deletion/rule_delete.cy.ts | 2 ++ 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts index 32eb50ef25d53..3b1a799de512b 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts @@ -69,8 +69,7 @@ import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_deta import { CREATE_RULE_URL } from '../../../urls/navigation'; -// TODO: https://github.com/elastic/kibana/issues/161539 -describe('Custom query rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Custom query rules', { tags: ['@ess', '@serverless'] }, () => { describe('Custom detection rules creation with data views', () => { const rule = getDataViewRule(); const expectedUrls = rule.references?.join(''); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts index d169d44f19761..36fa6cd484154 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts @@ -57,8 +57,7 @@ import { visit } from '../../../tasks/navigation'; import { openRuleManagementPageViaBreadcrumbs } from '../../../tasks/rules_management'; import { CREATE_RULE_URL } from '../../../urls/navigation'; -// TODO: https://github.com/elastic/kibana/issues/161539 -describe('EQL rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts index 7e73310433df1..684a44d37d214 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts @@ -54,19 +54,15 @@ import { visit } from '../../../tasks/navigation'; import { openRuleManagementPageViaBreadcrumbs } from '../../../tasks/rules_management'; import { CREATE_RULE_URL } from '../../../urls/navigation'; -// TODO: https://github.com/elastic/kibana/issues/161539 -describe('Machine Learning rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Machine Learning rules', { tags: ['@ess', '@serverless'] }, () => { const expectedUrls = (getMachineLearningRule().references ?? []).join(''); const expectedFalsePositives = (getMachineLearningRule().false_positives ?? []).join(''); const expectedTags = (getMachineLearningRule().tags ?? []).join(''); const expectedMitre = formatMitreAttackDescription(getMachineLearningRule().threat ?? []); const expectedNumberOfRules = 1; - before(() => { - cleanKibana(); - }); - beforeEach(() => { + cleanKibana(); login(); visit(CREATE_RULE_URL); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts index 53334bdc80541..f45be3af38a2a 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts @@ -59,8 +59,7 @@ import { visit } from '../../../tasks/navigation'; import { CREATE_RULE_URL } from '../../../urls/navigation'; import { openRuleManagementPageViaBreadcrumbs } from '../../../tasks/rules_management'; -// TODO: https://github.com/elastic/kibana/issues/161539 -describe('New Terms rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('New Terms rules', { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts index 6290583e82d82..7b8e5b0744c72 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts @@ -62,8 +62,7 @@ import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_deta import { CREATE_RULE_URL } from '../../../urls/navigation'; import { openRuleManagementPageViaBreadcrumbs } from '../../../tasks/rules_management'; -// TODO: https://github.com/elastic/kibana/issues/161539 -describe('Rules override', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Rules override', { tags: ['@ess', '@serverless'] }, () => { const rule = getNewOverrideRule(); const expectedUrls = rule.references?.join(''); const expectedFalsePositives = rule.false_positives?.join(''); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/deletion/rule_delete.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/deletion/rule_delete.cy.ts index 563c8b85c1b73..0896438e275e3 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/deletion/rule_delete.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/deletion/rule_delete.cy.ts @@ -12,6 +12,7 @@ import { RULE_SWITCH } from '../../../../../screens/alerts_detection_rules'; import { deleteFirstRule, + disableAutoRefresh, getRulesManagementTableRows, selectRulesByName, } from '../../../../../tasks/alerts_detection_rules'; @@ -33,6 +34,7 @@ describe('Rule deletion', { tags: ['@ess', '@serverless'] }, () => { createRule(testRules[2]); login(); visitRulesManagementTable(); + disableAutoRefresh(); }); it('User can delete an individual rule', () => {