diff --git a/.buildkite/pipelines/pull_request/security_solution.yml b/.buildkite/pipelines/pull_request/security_solution.yml index 9444c821d5db1..c40ed6f09bac1 100644 --- a/.buildkite/pipelines/pull_request/security_solution.yml +++ b/.buildkite/pipelines/pull_request/security_solution.yml @@ -5,7 +5,7 @@ steps: queue: n2-4-spot depends_on: build timeout_in_minutes: 60 - parallelism: 10 + parallelism: 16 retry: automatic: - exit_status: '*' @@ -18,7 +18,7 @@ steps: agents: queue: n2-4-spot depends_on: build - timeout_in_minutes: 120 + timeout_in_minutes: 60 parallelism: 1 soft_fail: true artifact_paths: diff --git a/package.json b/package.json index dc8e76fa3f38a..3be53b0f3e0a5 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "**/@babel/traverse": "^7.21.2", "**/@babel/types": "^7.21.2", "**/@types/babel__generator/@babel/types": "^7.21.0", - "**/@types/node": "18.17.1", + "**/@types/node": "18.17.5", "**/@types/react": "^16.14.25", "**/@types/react-dom": "^16.9.8", "**/@typescript-eslint/utils": "5.62.0", @@ -581,7 +581,7 @@ "@types/mustache": "^0.8.31", "@types/ncp": "^2.0.1", "@types/nock": "^10.0.3", - "@types/node": "18.17.1", + "@types/node": "18.17.5", "@types/node-fetch": "2.6.4", "@types/node-forge": "^1.3.1", "@types/nodemailer": "^6.4.0", @@ -680,12 +680,12 @@ "cpy": "^8.1.1", "css-loader": "^3.4.2", "cssnano": "5.0.0", - "cypress": "12.17.4", - "cypress-axe": "^1.4.0", + "cypress": "^13.3.0", + "cypress-axe": "^1.5.0", "cypress-file-upload": "^5.0.8", "cypress-multi-reporters": "^1.6.3", "cypress-pipe": "^2.0.0", - "cypress-real-events": "^1.10.0", + "cypress-real-events": "^1.10.3", "debug": "^2.6.9", "delete-empty": "^2.0.0", "dependency-check": "^4.1.0", diff --git a/x-pack/plugins/apm/ftr_e2e/cypress_start.ts b/x-pack/plugins/apm/ftr_e2e/cypress_start.ts index b948ead6009cb..e279f1e32334b 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress_start.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress_start.ts @@ -18,7 +18,11 @@ export function cypressRunTests(spec?: string) { return async ({ getService }: FtrProviderContext) => { const result = await cypressStart(getService, cypress.run, spec); - if (result && (result.status === 'failed' || result.totalFailed > 0)) { + if ( + (result as CypressCommandLine.CypressFailedRunResult)?.status === + 'failed' || + (result as CypressCommandLine.CypressRunResult)?.totalFailed + ) { throw new Error(`APM Cypress tests failed`); } }; diff --git a/x-pack/plugins/security_solution/cypress/e2e/detection_alerts/alerts_details.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/detection_alerts/alerts_details.cy.ts index 22d6a3c68bd60..6afd83e9742f4 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/detection_alerts/alerts_details.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/detection_alerts/alerts_details.cy.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { waitForAlertsToPopulate } from 'cypress/tasks/create_new_rule'; import { ALERT_FLYOUT, CELL_TEXT, @@ -13,11 +14,7 @@ import { TABLE_ROWS, } from '../../screens/alerts_details'; -import { - expandFirstAlert, - waitForAlertsIndexToBeCreated, - waitForAlertsPanelToBeLoaded, -} from '../../tasks/alerts'; +import { expandFirstAlert } from '../../tasks/alerts'; import { openJsonView, openTable } from '../../tasks/alerts_details'; import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; @@ -32,12 +29,9 @@ describe('Alert details with unmapped fields', () => { beforeEach(() => { cleanKibana(); esArchiverLoad('unmapped_fields'); - loginAndWaitForPageWithoutDateRange(ALERTS_URL); - waitForAlertsPanelToBeLoaded(); - waitForAlertsIndexToBeCreated(); createCustomRuleActivated(getUnmappedRule()); loginAndWaitForPageWithoutDateRange(ALERTS_URL); - waitForAlertsPanelToBeLoaded(); + waitForAlertsToPopulate(); expandFirstAlert(); }); diff --git a/x-pack/plugins/security_solution/cypress/scripts/run_cypress/parallel.ts b/x-pack/plugins/security_solution/cypress/scripts/run_cypress/parallel.ts index a87830183ceef..50879eefd8be5 100644 --- a/x-pack/plugins/security_solution/cypress/scripts/run_cypress/parallel.ts +++ b/x-pack/plugins/security_solution/cypress/scripts/run_cypress/parallel.ts @@ -471,7 +471,9 @@ ${JSON.stringify(cyCustomEnv, null, 2)} renderSummaryTable(results as CypressCommandLine.CypressRunResult[]); const hasFailedTests = _.some( results, - (result) => result?.status === 'finished' && result.totalFailed > 0 + (result) => + (result as CypressCommandLine.CypressFailedRunResult)?.status === 'failed' || + (result as CypressCommandLine.CypressRunResult)?.totalFailed ); if (hasFailedTests) { throw createFailError('Not all tests passed'); diff --git a/x-pack/plugins/security_solution/cypress/scripts/run_cypress/print_run.ts b/x-pack/plugins/security_solution/cypress/scripts/run_cypress/print_run.ts index 2985f6c1ca577..b95eabb5fd65d 100644 --- a/x-pack/plugins/security_solution/cypress/scripts/run_cypress/print_run.ts +++ b/x-pack/plugins/security_solution/cypress/scripts/run_cypress/print_run.ts @@ -278,7 +278,6 @@ export function renderSummaryTable(results: CypressCommandLine.CypressRunResult[ const parsedResults = _.reduce( results, (acc: CypressCommandLine.CypressRunResult, result) => { - acc.status = result.status; acc.startedTestsAt = acc.startedTestsAt && new Date(result.startedTestsAt) > new Date(acc.startedTestsAt) ? acc.startedTestsAt @@ -358,12 +357,8 @@ export function renderSummaryTable(results: CypressCommandLine.CypressRunResult[ _.each(runs, (run) => { const { spec, stats } = run; - const ms = durationInMinutes(stats.duration); - const formattedSpec = formatPath(spec.relativeToCommonRoot, getWidth(table2, 1)); - - if (run.skippedSpec) { - return table2.push(['-', formattedSpec, color('SKIPPED', 'gray'), '-', '-', '-', '-', '-']); - } + const ms = durationInMinutes(stats?.duration ?? 0); + const formattedSpec = formatPath(spec.relative, getWidth(table2, 1)); return table2.push([ formatSymbolSummary(stats.failures), diff --git a/x-pack/plugins/security_solution/cypress/tasks/timeline.ts b/x-pack/plugins/security_solution/cypress/tasks/timeline.ts index 3ba351be12f69..dbd03d52c111a 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/timeline.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/timeline.ts @@ -90,6 +90,8 @@ export const addDescriptionToTimeline = (description: string) => { export const addNameToTimeline = (name: string) => { cy.get(TIMELINE_EDIT_MODAL_OPEN_BUTTON).first().click(); + cy.get(TIMELINE_TITLE_INPUT).should('exist'); + cy.get(TIMELINE_TITLE_INPUT).should('be.visible'); cy.get(TIMELINE_TITLE_INPUT).type(`${name}{enter}`); cy.get(TIMELINE_TITLE_INPUT).should('have.attr', 'value', name); cy.get(TIMELINE_EDIT_MODAL_SAVE_BUTTON).click(); @@ -98,6 +100,8 @@ export const addNameToTimeline = (name: string) => { export const addNameAndDescriptionToTimeline = (timeline: Timeline) => { cy.get(TIMELINE_EDIT_MODAL_OPEN_BUTTON).first().click(); + cy.get(TIMELINE_TITLE_INPUT).should('exist'); + cy.get(TIMELINE_TITLE_INPUT).should('be.visible'); cy.get(TIMELINE_TITLE_INPUT).type(`${timeline.title}{enter}`); cy.get(TIMELINE_TITLE_INPUT).should('have.attr', 'value', timeline.title); cy.get(TIMELINE_DESCRIPTION_INPUT).type(timeline.description); diff --git a/yarn.lock b/yarn.lock index f48c156400986..b69c437cfd6c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1635,10 +1635,10 @@ find-test-names "^1.19.0" globby "^11.0.4" -"@cypress/request@2.88.12": - version "2.88.12" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.12.tgz#ba4911431738494a85e93fb04498cb38bc55d590" - integrity sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA== +"@cypress/request@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.1.tgz#72d7d5425236a2413bd3d8bb66d02d9dc3168960" + integrity sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -1653,7 +1653,7 @@ json-stringify-safe "~5.0.1" mime-types "~2.1.19" performance-now "^2.1.0" - qs "~6.10.3" + qs "6.10.4" safe-buffer "^5.1.2" tough-cookie "^4.1.3" tunnel-agent "^0.6.0" @@ -6331,10 +6331,10 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@18.17.1", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^16.18.39": - version "18.17.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.1.tgz#84c32903bf3a09f7878c391d31ff08f6fe7d8335" - integrity sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw== +"@types/node@*", "@types/node@18.17.5", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.17.5": + version "18.17.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.5.tgz#c58b12bca8c2a437b38c15270615627e96dd0bc5" + integrity sha512-xNbS75FxH6P4UXTPUJp/zNPq6/xsfdJKussCWNOnz4aULWIRwMgP1LgaB5RiBnMX1DPCYenuqGZfnIAx5mbFLA== "@types/nodemailer@^6.4.0": version "6.4.0" @@ -11127,10 +11127,10 @@ cyclist@~0.2.2: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= -cypress-axe@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/cypress-axe/-/cypress-axe-1.4.0.tgz#e67482bfe9e740796bf77c7823f19781a8a2faff" - integrity sha512-Ut7NKfzjyKm0BEbt2WxuKtLkIXmx6FD2j0RwdvO/Ykl7GmB/qRQkwbKLk3VP35+83hiIr8GKD04PDdrTK5BnyA== +cypress-axe@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/cypress-axe/-/cypress-axe-1.5.0.tgz#95082734583da77b51ce9b7784e14a442016c7a1" + integrity sha512-Hy/owCjfj+25KMsecvDgo4fC/781ccL+e8p+UUYoadGVM2ogZF9XIKbiM6KI8Y3cEaSreymdD6ZzccbI2bY0lQ== cypress-file-upload@^5.0.8: version "5.0.8" @@ -11150,21 +11150,19 @@ cypress-pipe@^2.0.0: resolved "https://registry.yarnpkg.com/cypress-pipe/-/cypress-pipe-2.0.0.tgz#577df7a70a8603d89a96dfe4092a605962181af8" integrity sha512-KW9s+bz4tFLucH3rBGfjW+Q12n7S4QpUSSyxiGrgPOfoHlbYWzAGB3H26MO0VTojqf9NVvfd5Kt0MH5XMgbfyg== -cypress-real-events@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.10.0.tgz#6827ae4667561471c2a86bb4be30061fa9b177b8" - integrity sha512-ALSdCiG+Rj3Sl6qooqTFeFGBxOIe8QJUcgIuJ6ZVBanTEijXRzqxqstMC2ZKfixqj1TyNjolyZU4zOoN/jtHpg== - dependencies: - prettier "^3.0.0" +cypress-real-events@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.10.3.tgz#e2e949ea509cc4306df6c238de1a9982d67360e5" + integrity sha512-YN3fn+CJIAM638sE6uMvv2/n3PsWowdd0rOiN6ZoyezNAMyENfuQHvccLKZpN+apGfQZYetCml6QXLYgDid2fg== -cypress@12.17.4: - version "12.17.4" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.4.tgz#b4dadf41673058493fa0d2362faa3da1f6ae2e6c" - integrity sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ== +cypress@^13.3.0: + version "13.3.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.3.0.tgz#d00104661b337d662c5a4280a051ee59f8aa1e31" + integrity sha512-mpI8qcTwLGiA4zEQvTC/U1xGUezVV4V8HQCOYjlEOrVmU1etVvxOjkCXHGwrlYdZU/EPmUiWfsO3yt1o+Q2bgw== dependencies: - "@cypress/request" "2.88.12" + "@cypress/request" "^3.0.0" "@cypress/xvfb" "^1.2.4" - "@types/node" "^16.18.39" + "@types/node" "^18.17.5" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" @@ -22694,11 +22692,6 @@ prettier@^2.7.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -prettier@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" - integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== - pretty-bytes@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" @@ -23087,6 +23080,13 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= +qs@6.10.4: + version "6.10.4" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.4.tgz#6a3003755add91c0ec9eacdc5f878b034e73f9e7" + integrity sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g== + dependencies: + side-channel "^1.0.4" + qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" @@ -23101,13 +23101,6 @@ qs@^6.10.0, qs@^6.11.0, qs@^6.7.0: dependencies: side-channel "^1.0.4" -qs@~6.10.3: - version "6.10.5" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" - integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== - dependencies: - side-channel "^1.0.4" - qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"