-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Defend Workflows] Add tags for mocked and real Endpoint Cypress tests for Serverless #165094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gergoabraham
merged 37 commits into
elastic:main
from
gergoabraham:test/olm-7133-reuse-tests-for-serverless
Sep 20, 2023
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
b6642b6
add `cypress:dw:serverless:*` scripts
gergoabraham 8cc56e7
add `Elastic-Api-Version` to all cy requests
gergoabraham 8645b2c
add `http.host` to shared setting, so ES is accessible via local IP
gergoabraham db6b729
add config and scripts for real endpoint serverless
gergoabraham b51cdbf
fix test scripts (removing `ts` and `open` from shared scripts)
gergoabraham 774c548
add `@ess` tag for every test
gergoabraham c85ec25
fix eslint errors
gergoabraham 26f13f1
add `@ess` grep to ess test configs
gergoabraham 96681c4
fine tune grep config
gergoabraham 171d093
move cypress configs into cypress folder
gergoabraham d012eaf
run tests on CI
gergoabraham 5bd9599
add `@serverless` tag to selected cypress tests
gergoabraham bdabdfa
fix eslint errors
gergoabraham df6c6f6
improve earlier eslint fix: remove unnecessary click
gergoabraham 5b3f9e5
add `@brokenInServerless` to all "real endpoint" tests, until we got …
gergoabraham f01466d
add reporter config to cypress configs
gergoabraham 0715a0c
fix lint errors
gergoabraham 783402a
remove CI job for real endpoints against serverless
gergoabraham addb780
remove `@brokenInServerless` tags from skipped real endpoint tests
gergoabraham 0019766
fix the eslint fix
gergoabraham 4da5f86
run a placeholder test case for mocked_data
gergoabraham 48ec79d
Revert "remove `@brokenInServerless` tags from skipped real endpoint …
gergoabraham 3aaf36a
Revert "remove CI job for real endpoints against serverless"
gergoabraham 88d79c2
run a placeholder test case for real endpoint serverless tests
gergoabraham bf44385
remove placeholder tests
gergoabraham 4ac5a03
prevent `junit:merge` from failing CI step
gergoabraham 08fab69
Merge branch 'main' into test/olm-7133-reuse-tests-for-serverless
gergoabraham 4a0cea8
remove `http.host` server arg from shared config
gergoabraham 11132d6
prepare `runEndpointLoaderScript()` for serverless
gergoabraham 63e5342
add `dataLoaders()` back to serverless config
gergoabraham a2dca01
enable `Policy Details` cy test for serverless
gergoabraham 6ae9f21
re-enable configurations that have problems fixed
gergoabraham b08267a
update readme
gergoabraham ad1c3fe
add reusable base config for cypress
gergoabraham 6f90e66
Merge branch 'main' into test/olm-7133-reuse-tests-for-serverless
gergoabraham 7ec96a3
add IS_SERVERLESS to cy config
gergoabraham 75cde75
convert base config to a function instead of const
gergoabraham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| { | ||
|
paul-tavares marked this conversation as resolved.
|
||
| "plugins": ["cypress"], | ||
| "extends": [ | ||
| "plugin:cypress/recommended" | ||
| ], | ||
| "env": { | ||
| "cypress/globals": true | ||
| }, | ||
| "rules": { | ||
| "cypress/no-force": "warn", | ||
| "import/no-extraneous-dependencies": "off" | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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); | ||
|
paul-tavares marked this conversation as resolved.
|
||
|
|
||
| return dataLoaders(on, config); | ||
| }, | ||
| }, | ||
| }); | ||
This file contains hidden or 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 hidden or 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 hidden or 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({ | ||
|
paul-tavares marked this conversation as resolved.
|
||
| ...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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we only want this to run conditionally on pull requests?
on-merge at https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/on_merge.yml#L82
all pull requests at https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/pull_request/base.yml#L71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the question! I've added it to our tracking issue for serverless tests, to make a team decision - until then, for this PR, I'd keep it this way to merge this as soon as possible.