Skip to content

Commit

Permalink
[8.10] [Security Solution] Unskip related integrations tests (elastic…
Browse files Browse the repository at this point in the history
…#164933) (elastic#165310)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Security Solution] Unskip related integrations tests
(elastic#164933)](elastic#164933)

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

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-31T10:28:16Z","message":"[Security
Solution] Unskip related integrations tests (elastic#164933)\n\n**Fixes:
https://github.com/elastic/kibana/issues/154663**\r\n**Fixes:
https://github.com/elastic/kibana/issues/153684**\r\n\r\n##
Summary\r\n\r\nThis PR unskips Cypress rule related integration tests
([related_integrations.cy.ts](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts)).\r\n\r\n##
Details\r\n\r\nTesting approach has changed. Instead of importing a rule
and installing agent and package policies via Fleet UI the rule is
created by mocking a prebuilt rule asset and Fleet API is used to
install required integrations. Along the way it required to add and
update some testing selectors as UI had changed while the tests were
skipped.\r\n\r\n## Flaky test runner\r\n\r\n[related_integrations.cy.ts
(150
runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2995)
🟢","sha":"2c3464ca8457e09f51852c6c0d60ab7f6e21afc0","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Feature:Rule
Management","Team:Detection Rule
Management","v8.10.0","v8.11.0","flake-docs"],"number":164933,"url":"https://github.com/elastic/kibana/pull/164933","mergeCommit":{"message":"[Security
Solution] Unskip related integrations tests (elastic#164933)\n\n**Fixes:
https://github.com/elastic/kibana/issues/154663**\r\n**Fixes:
https://github.com/elastic/kibana/issues/153684**\r\n\r\n##
Summary\r\n\r\nThis PR unskips Cypress rule related integration tests
([related_integrations.cy.ts](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts)).\r\n\r\n##
Details\r\n\r\nTesting approach has changed. Instead of importing a rule
and installing agent and package policies via Fleet UI the rule is
created by mocking a prebuilt rule asset and Fleet API is used to
install required integrations. Along the way it required to add and
update some testing selectors as UI had changed while the tests were
skipped.\r\n\r\n## Flaky test runner\r\n\r\n[related_integrations.cy.ts
(150
runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2995)
🟢","sha":"2c3464ca8457e09f51852c6c0d60ab7f6e21afc0"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164933","number":164933,"mergeCommit":{"message":"[Security
Solution] Unskip related integrations tests (elastic#164933)\n\n**Fixes:
https://github.com/elastic/kibana/issues/154663**\r\n**Fixes:
https://github.com/elastic/kibana/issues/153684**\r\n\r\n##
Summary\r\n\r\nThis PR unskips Cypress rule related integration tests
([related_integrations.cy.ts](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts)).\r\n\r\n##
Details\r\n\r\nTesting approach has changed. Instead of importing a rule
and installing agent and package policies via Fleet UI the rule is
created by mocking a prebuilt rule asset and Fleet API is used to
install required integrations. Along the way it required to add and
update some testing selectors as UI had changed while the tests were
skipped.\r\n\r\n## Flaky test runner\r\n\r\n[related_integrations.cy.ts
(150
runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2995)
🟢","sha":"2c3464ca8457e09f51852c6c0d60ab7f6e21afc0"}}]}] BACKPORT-->
  • Loading branch information
maximpn authored Aug 31, 2023
1 parent 638b971 commit 39b7ebe
Show file tree
Hide file tree
Showing 27 changed files with 549 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const search = {
incremental: true,
placeholder: i18n.PLACEHOLDER,
schema: true,
'data-test-subj': 'search-input',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ const RuleDetailsPageComponent: React.FC<DetectionEngineComponentProps> = ({
) : (
<RuleStatus status={lastExecutionStatus} date={lastExecutionDate}>
<EuiButtonIcon
data-test-subj="refreshButton"
data-test-subj="ruleLastExecutionStatusRefreshButton"
color="primary"
onClick={refreshRule}
iconType="refresh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ import {
goToScheduleStepTab,
importSavedQuery,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../../tasks/create_new_rule';
import { saveEditedRule } from '../../../tasks/edit_rule';
import { login, visit, visitSecurityDetectionRulesPage } from '../../../tasks/login';
import { enablesRule, getDetails } from '../../../tasks/rule_details';
import { enablesRule, getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_details';

import { RULE_CREATION } from '../../../urls/navigation';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ import {
fillDefineCustomRuleAndContinue,
fillScheduleRuleAndContinue,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../../tasks/create_new_rule';

import { login, visit } from '../../../tasks/login';
import { getDetails } from '../../../tasks/rule_details';
import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_details';

import { RULE_CREATION } from '../../../urls/navigation';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
TIMELINE_TEMPLATE_DETAILS,
} from '../../../screens/rule_details';

import { getDetails } from '../../../tasks/rule_details';
import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_details';
import {
expectNumberOfRules,
goToRuleDetails,
Expand All @@ -57,7 +57,6 @@ import {
fillScheduleRuleAndContinue,
selectEqlRuleType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../../tasks/create_new_rule';
import { login, visit } from '../../../tasks/login';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ import {
getIndicatorOrButton,
selectIndicatorMatchType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../../tasks/create_new_rule';
import {
SCHEDULE_INTERVAL_AMOUNT_INPUT,
Expand All @@ -104,7 +103,11 @@ import {
} from '../../../screens/create_new_rule';
import { goBackToRuleDetails } from '../../../tasks/edit_rule';
import { login, visit, visitWithoutDateRange } from '../../../tasks/login';
import { goBackToRulesTable, getDetails } from '../../../tasks/rule_details';
import {
goBackToRulesTable,
getDetails,
waitForTheRuleToBeExecuted,
} from '../../../tasks/rule_details';

import { DETECTIONS_RULE_MANAGEMENT_URL, RULE_CREATION } from '../../../urls/navigation';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import {
NEW_TERMS_FIELDS_DETAILS,
} from '../../../screens/rule_details';

import { getDetails } from '../../../tasks/rule_details';
import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
import {
Expand All @@ -55,7 +55,6 @@ import {
fillScheduleRuleAndContinue,
selectNewTermsRuleType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../../tasks/create_new_rule';
import { login, visit } from '../../../tasks/login';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ import {
} from '../../../screens/rule_details';

import { expectNumberOfRules, goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { deleteAlertsAndRules } from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleWithOverrideAndContinue,
fillDefineCustomRuleAndContinue,
fillScheduleRuleAndContinue,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { getDetails } from '../../../tasks/rule_details';
import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_details';

import { RULE_CREATION } from '../../../urls/navigation';

Expand All @@ -73,6 +73,7 @@ describe('Detection rules, override', { tags: [tag.ESS, tag.BROKEN_IN_SERVERLESS

beforeEach(() => {
login();
deleteAlertsAndRules();
});

it('Creates and enables a new custom rule with override option', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import {
TIMELINE_TEMPLATE_DETAILS,
} from '../../../screens/rule_details';

import { getDetails } from '../../../tasks/rule_details';
import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
import {
Expand All @@ -55,7 +55,6 @@ import {
fillScheduleRuleAndContinue,
selectThresholdRuleType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../../tasks/login';

Expand Down
Loading

0 comments on commit 39b7ebe

Please sign in to comment.