Skip to content

Commit

Permalink
[8.x] [WIP] - Unskip threat hunting tests (elastic#195662) (elastic#2…
Browse files Browse the repository at this point in the history
…01853)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[WIP] - Unskip threat hunting tests
(elastic#195662)](elastic#195662)

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

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

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-07T16:30:23Z","message":"[WIP]
- Unskip threat hunting tests (elastic#195662)\n\n1. Added
`cypress-network-idle` to better wait for a full page load as
a\r\nloading indicator flicker could cause flakiness.\r\n\r\n2. List of
addressed open issues:\r\n\r\nResolves
https://github.com/elastic/kibana/issues/191819\r\nResolves
https://github.com/elastic/kibana/issues/178367\r\nResolves
https://github.com/elastic/kibana/issues/176757\r\nResolves
https://github.com/elastic/kibana/issues/176759\r\nResolves
https://github.com/elastic/kibana/issues/176758\r\nResolves
https://github.com/elastic/kibana/issues/193840\r\nResolves
https://github.com/elastic/kibana/issues/182206\r\nResolves
https://github.com/elastic/kibana/issues/181977\r\nResolves
https://github.com/elastic/kibana/issues/168768\r\nResolves
https://github.com/elastic/kibana/issues/168769\r\nResolves
https://github.com/elastic/kibana/issues/168770\r\nResolves
https://github.com/elastic/kibana/issues/168771\r\nResolves
https://github.com/elastic/kibana/issues/168772\r\nResolves
https://github.com/elastic/kibana/issues/183104\r\nResolves
https://github.com/elastic/kibana/issues/173854\r\n\r\nSuccessful Flaky
Test
Runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7267\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"3f236b14994cfa024230053b069b7011c2b7434e","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","v9.0.0","v8.17.0"],"number":195662,"url":"https://github.com/elastic/kibana/pull/195662","mergeCommit":{"message":"[WIP]
- Unskip threat hunting tests (elastic#195662)\n\n1. Added
`cypress-network-idle` to better wait for a full page load as
a\r\nloading indicator flicker could cause flakiness.\r\n\r\n2. List of
addressed open issues:\r\n\r\nResolves
https://github.com/elastic/kibana/issues/191819\r\nResolves
https://github.com/elastic/kibana/issues/178367\r\nResolves
https://github.com/elastic/kibana/issues/176757\r\nResolves
https://github.com/elastic/kibana/issues/176759\r\nResolves
https://github.com/elastic/kibana/issues/176758\r\nResolves
https://github.com/elastic/kibana/issues/193840\r\nResolves
https://github.com/elastic/kibana/issues/182206\r\nResolves
https://github.com/elastic/kibana/issues/181977\r\nResolves
https://github.com/elastic/kibana/issues/168768\r\nResolves
https://github.com/elastic/kibana/issues/168769\r\nResolves
https://github.com/elastic/kibana/issues/168770\r\nResolves
https://github.com/elastic/kibana/issues/168771\r\nResolves
https://github.com/elastic/kibana/issues/168772\r\nResolves
https://github.com/elastic/kibana/issues/183104\r\nResolves
https://github.com/elastic/kibana/issues/173854\r\n\r\nSuccessful Flaky
Test
Runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7267\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"3f236b14994cfa024230053b069b7011c2b7434e"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195662","number":195662,"mergeCommit":{"message":"[WIP]
- Unskip threat hunting tests (elastic#195662)\n\n1. Added
`cypress-network-idle` to better wait for a full page load as
a\r\nloading indicator flicker could cause flakiness.\r\n\r\n2. List of
addressed open issues:\r\n\r\nResolves
https://github.com/elastic/kibana/issues/191819\r\nResolves
https://github.com/elastic/kibana/issues/178367\r\nResolves
https://github.com/elastic/kibana/issues/176757\r\nResolves
https://github.com/elastic/kibana/issues/176759\r\nResolves
https://github.com/elastic/kibana/issues/176758\r\nResolves
https://github.com/elastic/kibana/issues/193840\r\nResolves
https://github.com/elastic/kibana/issues/182206\r\nResolves
https://github.com/elastic/kibana/issues/181977\r\nResolves
https://github.com/elastic/kibana/issues/168768\r\nResolves
https://github.com/elastic/kibana/issues/168769\r\nResolves
https://github.com/elastic/kibana/issues/168770\r\nResolves
https://github.com/elastic/kibana/issues/168771\r\nResolves
https://github.com/elastic/kibana/issues/168772\r\nResolves
https://github.com/elastic/kibana/issues/183104\r\nResolves
https://github.com/elastic/kibana/issues/173854\r\n\r\nSuccessful Flaky
Test
Runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7267\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"3f236b14994cfa024230053b069b7011c2b7434e"}},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
  • Loading branch information
michaelolo24 authored Nov 27, 2024
1 parent a797902 commit d574ecc
Show file tree
Hide file tree
Showing 26 changed files with 391 additions and 377 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,7 @@
"cypress-axe": "^1.5.0",
"cypress-file-upload": "^5.0.8",
"cypress-multi-reporters": "^1.6.4",
"cypress-network-idle": "^1.14.2",
"cypress-real-events": "^1.11.0",
"cypress-recurse": "^1.35.2",
"date-fns": "^2.29.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const loadDetectionsPage = (role: SecurityRoleName) => {
waitForAlertsToPopulate();
};

// Failing: See https://github.com/elastic/kibana/issues/191819
describe.skip('Alerts timeline', { tags: ['@ess'] }, () => {
describe('Alerts timeline', () => {
beforeEach(() => {
// First we login as a privileged user to create alerts.
deleteAlertsAndRules();
Expand All @@ -36,7 +35,7 @@ describe.skip('Alerts timeline', { tags: ['@ess'] }, () => {
waitForAlertsToPopulate();
});

context('Privileges: read only', () => {
context('Privileges: read only', { tags: ['@ess'] }, () => {
beforeEach(() => {
loadDetectionsPage(ROLES.reader);
});
Expand All @@ -52,7 +51,7 @@ describe.skip('Alerts timeline', { tags: ['@ess'] }, () => {
});
});

context('Privileges: can crud', () => {
context('Privileges: can crud', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
loadDetectionsPage(ROLES.platform_engineer);
cy.get(LOADING_INDICATOR).should('not.exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,72 +21,66 @@ import { visitWithTimeRange } from '../../../tasks/navigation';
import { waitForWelcomePanelToBeLoaded } from '../../../tasks/common';
import { selectDataView } from '../../../tasks/sourcerer';
import { postDataView } from '../../../tasks/api_calls/common';
import { mockRiskEngineEnabled } from '../../../tasks/entity_analytics';

const DATA_VIEW = 'auditbeat-*';

// FLAKY: https://github.com/elastic/kibana/issues/178367
describe.skip(
'Inspect Explore pages',
{ tags: ['@ess', '@serverless', '@skipInServerlessMKI'] },
() => {
before(() => {
// illegal_argument_exception: unknown setting [index.lifecycle.name]
cy.task('esArchiverLoad', { archiveName: 'risk_users' });
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
describe('Inspect Explore pages', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
// illegal_argument_exception: unknown setting [index.lifecycle.name]
cy.task('esArchiverLoad', { archiveName: 'risk_scores_new' });
login();
mockRiskEngineEnabled();
// Create and select data view
postDataView(DATA_VIEW);
});

login();
// Create and select data view
postDataView(DATA_VIEW);
});

after(() => {
cy.task('esArchiverUnload', { archiveName: 'risk_users' });
cy.task('esArchiverUnload', { archiveName: 'risk_hosts' });
});
afterEach(() => {
cy.task('esArchiverUnload', { archiveName: 'risk_scores_new' });
});

INSPECT_BUTTONS_IN_SECURITY.forEach(({ pageName, url, lensVisualizations, tables }) => {
/**
* Group all tests of a page into one "it" call to improve speed
*/
it(`inspect ${pageName} page`, () => {
login();
INSPECT_BUTTONS_IN_SECURITY.forEach(({ pageName, url, lensVisualizations, tables }) => {
/**
* Group all tests of a page into one "it" call to improve speed
*/
it(`inspect ${pageName} page`, () => {
login();

visitWithTimeRange(url, {
visitOptions: {
onLoad: () => {
waitForWelcomePanelToBeLoaded();
selectDataView(DATA_VIEW);
},
visitWithTimeRange(url, {
visitOptions: {
onLoad: () => {
waitForWelcomePanelToBeLoaded();
selectDataView(DATA_VIEW);
},
});

lensVisualizations.forEach((lens) => {
cy.log(`inspects the ${lens.title} visualization`);
openTab(lens.tab);

openLensVisualizationsInspectModal(lens, () => {
cy.get(INSPECT_MODAL).should('be.visible');
cy.get(INSPECT_MODAL_INDEX_PATTERN).should(
'contain.text',
lens.customIndexPattern ? lens.customIndexPattern : DATA_VIEW
);
});
});
},
});

tables.forEach((table) => {
cy.log(`inspects the ${table.title}`);
openTab(table.tab);
lensVisualizations.forEach((lens) => {
cy.log(`inspects the ${lens.title} visualization`);
openTab(lens.tab);

openTableInspectModal(table);
openLensVisualizationsInspectModal(lens, () => {
cy.get(INSPECT_MODAL).should('be.visible');
cy.get(INSPECT_MODAL_INDEX_PATTERN).should(
'contain.text',
table.customIndexPattern ? table.customIndexPattern : DATA_VIEW
lens.customIndexPattern ? lens.customIndexPattern : DATA_VIEW
);

closesModal();
});
});

tables.forEach((table) => {
cy.log(`inspects the ${table.title}`);
openTab(table.tab);

openTableInspectModal(table);
cy.get(INSPECT_MODAL).should('be.visible');
cy.get(INSPECT_MODAL_INDEX_PATTERN).should(
'contain.text',
table.customIndexPattern ? table.customIndexPattern : DATA_VIEW
);

closesModal();
});
});
}
);
});
});
Loading

0 comments on commit d574ecc

Please sign in to comment.