From 2dc753b262cc0822bc83330375931929f5c9d7d9 Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Thu, 10 Mar 2022 12:24:21 -0500 Subject: [PATCH] [Security Solution][CI Stats] - Add cypress tests to flaky test runner (#127293) --- .buildkite/pipelines/flaky_tests/groups.json | 12 +++++++++++ .buildkite/pipelines/flaky_tests/runner.js | 21 ++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.buildkite/pipelines/flaky_tests/groups.json b/.buildkite/pipelines/flaky_tests/groups.json index b47ccf16a0184..aa061af00bd6c 100644 --- a/.buildkite/pipelines/flaky_tests/groups.json +++ b/.buildkite/pipelines/flaky_tests/groups.json @@ -13,6 +13,18 @@ "key": "oss/accessibility", "name": "OSS Accessibility" }, + { + "key": "xpack/cypress/security_solution", + "name": "Security Solution - Cypress" + }, + { + "key": "xpack/cypress/osquery_cypress", + "name": "Osquery - Cypress" + }, + { + "key": "xpack/cypress/fleet_cypress", + "name": "Fleet - Cypress" + }, { "key": "xpack/cigroup", "name": "Default CI Group", diff --git a/.buildkite/pipelines/flaky_tests/runner.js b/.buildkite/pipelines/flaky_tests/runner.js index cff4f9c0f29e7..e93c46e672a76 100644 --- a/.buildkite/pipelines/flaky_tests/runner.js +++ b/.buildkite/pipelines/flaky_tests/runner.js @@ -7,6 +7,9 @@ */ const { execSync } = require('child_process'); +const groups = /** @type {Array<{key: string, name: string, ciGroups: number }>} */ ( + require('./groups.json').groups +); const concurrency = 25; const defaultCount = concurrency * 2; @@ -183,6 +186,24 @@ for (const testSuite of testSuites) { concurrency_group: UUID, concurrency_method: 'eager', }); + case 'cypress': + const CYPRESS_SUITE = CI_GROUP; + const group = groups.find((group) => group.key.includes(CYPRESS_SUITE)); + if (!group) { + throw new Error( + `Group configuration was not found in groups.json for the following cypress suite: {${CYPRESS_SUITE}}.` + ); + } + steps.push({ + command: `.buildkite/scripts/steps/functional/${CYPRESS_SUITE}.sh`, + label: group.name, + agents: { queue: 'ci-group-6' }, + depends_on: 'build', + parallelism: RUN_COUNT, + concurrency: concurrency, + concurrency_group: UUID, + concurrency_method: 'eager', + }); break; } }