-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Defend Workflows] Add tags for mocked and real Endpoint Cypress test…
…s for Serverless (#165094) ## Summary - introduces tags for [Defend Workflows] cypress tests (similarly to #162698) - adds scripts to Security Solution: - `cypress:dw:serverless:open` and `:run` - `cypress:dw:endpoint:serverless:open` and `:run` - adds CI jobs to run these scripts - so far most of the expected tests got both `@serverless` and `@brokenInServerless` tests, because of other issues to be solved, - one test is able to run against serverless: `x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/policy_details.cy.ts`
- Loading branch information
1 parent
4270c5e
commit aa36fe6
Showing
44 changed files
with
682 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.buildkite/scripts/steps/functional/defend_workflows_serverless.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/steps/functional/common.sh | ||
source .buildkite/scripts/steps/functional/common_cypress.sh | ||
|
||
export JOB=kibana-defend-workflows-serverless-cypress | ||
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION} | ||
|
||
echo "--- Defend Workflows Cypress tests on Serverless" | ||
|
||
cd x-pack/plugins/security_solution | ||
|
||
yarn cypress:dw:serverless:run; status=$?; yarn junit:merge || :; exit $status |
15 changes: 15 additions & 0 deletions
15
.buildkite/scripts/steps/functional/defend_workflows_vagrant_serverless.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/steps/functional/common.sh | ||
source .buildkite/scripts/steps/functional/common_cypress.sh | ||
|
||
export JOB=kibana-defend-workflows-endpoint-serverless-cypress | ||
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION} | ||
|
||
echo "--- Defend Workflows Endpoint Cypress tests on Serverless" | ||
|
||
cd x-pack/plugins/security_solution | ||
|
||
yarn cypress:dw:endpoint:serverless:run; status=$?; yarn junit:merge || :; exit $status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
x-pack/plugins/security_solution/public/management/cypress/.eslintrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"plugins": ["cypress"], | ||
"extends": [ | ||
"plugin:cypress/recommended" | ||
], | ||
"env": { | ||
"cypress/globals": true | ||
}, | ||
"rules": { | ||
"cypress/no-force": "warn", | ||
"import/no-extraneous-dependencies": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { defineCypressConfig } from '@kbn/cypress-config'; | ||
import { getCypressBaseConfig } from './cypress_base.config'; | ||
|
||
import { dataLoaders } from './support/data_loaders'; | ||
|
||
export default defineCypressConfig({ | ||
...getCypressBaseConfig(), | ||
|
||
env: { | ||
...getCypressBaseConfig().env, | ||
|
||
grepTags: '@ess', | ||
}, | ||
|
||
e2e: { | ||
...getCypressBaseConfig().e2e, | ||
|
||
specPattern: 'public/management/cypress/e2e/mocked_data/', | ||
setupNodeEvents: (on, config) => { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('@cypress/grep/src/plugin')(config); | ||
|
||
return dataLoaders(on, config); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { defineCypressConfig } from '@kbn/cypress-config'; | ||
import { getCypressBaseConfig } from './cypress_base.config'; | ||
|
||
import { dataLoaders, dataLoadersForRealEndpoints } from './support/data_loaders'; | ||
|
||
import { responseActionTasks } from './support/response_actions'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default defineCypressConfig({ | ||
...getCypressBaseConfig(), | ||
|
||
env: { | ||
...getCypressBaseConfig().env, | ||
|
||
'cypress-react-selector': { | ||
root: '#security-solution-app', | ||
}, | ||
|
||
grepTags: '@ess', | ||
}, | ||
|
||
e2e: { | ||
...getCypressBaseConfig().e2e, | ||
|
||
experimentalMemoryManagement: true, | ||
experimentalInteractiveRunEvents: true, | ||
specPattern: 'public/management/cypress/e2e/endpoint/*.cy.{js,jsx,ts,tsx}', | ||
setupNodeEvents: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { | ||
dataLoaders(on, config); | ||
// Data loaders specific to "real" Endpoint testing | ||
dataLoadersForRealEndpoints(on, config); | ||
responseActionTasks(on, config); | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('@cypress/grep/src/plugin')(config); | ||
|
||
return config; | ||
}, | ||
}, | ||
}); |
50 changes: 50 additions & 0 deletions
50
...plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { defineCypressConfig } from '@kbn/cypress-config'; | ||
import { getCypressBaseConfig } from './cypress_base.config'; | ||
import { dataLoaders } from './support/data_loaders'; | ||
import { responseActionTasks } from './support/response_actions'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default defineCypressConfig({ | ||
...getCypressBaseConfig(), | ||
|
||
env: { | ||
...getCypressBaseConfig().env, | ||
|
||
IS_SERVERLESS: true, | ||
grepTags: '@serverless --@brokenInServerless', | ||
|
||
'cypress-react-selector': { | ||
root: '#security-solution-app', | ||
}, | ||
}, | ||
|
||
e2e: { | ||
...getCypressBaseConfig().e2e, | ||
|
||
experimentalMemoryManagement: true, | ||
experimentalInteractiveRunEvents: true, | ||
|
||
specPattern: 'public/management/cypress/e2e/endpoint/*.cy.{js,jsx,ts,tsx}', | ||
|
||
setupNodeEvents: (on, config) => { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('@cypress/grep/src/plugin')(config); | ||
|
||
dataLoaders(on, config); | ||
|
||
// skip dataLoadersForRealEndpoints() | ||
// https://github.com/elastic/security-team/issues/7467 | ||
// Data loaders specific to "real" Endpoint testing | ||
// dataLoadersForRealEndpoints(on, config); | ||
|
||
responseActionTasks(on, config); | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.