-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fixed parallel script for cypress tests in QA and buildkite #169311
Merged
Merged
Changes from 40 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
7d2104c
Fixed parallel script for cypress and buildkite
dkirchan 9e43643
Fixed API_KEY target to be more accurate to which API_KEY it refers to
dkirchan bf05e41
Fixed error codes to avoid logging them. Logging status code and mess…
dkirchan 950cf06
Wrapped vault read to a retry
dkirchan 2d7e9bb
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 93bb326
Added parallelism - Disabled Essentials non-functioning test - Run al…
dkirchan 023b18f
fixes linting issue
MadameSheema c22ec0e
reuses existing types
MadameSheema fd3e26c
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 60270f9
Revert "reuses existing types"
MadameSheema 56c4e9c
reusing existing types
MadameSheema dcd01d8
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine fb90107
Revert "reusing existing types"
MadameSheema f68e7ad
extracts retrieve integrations to utils
MadameSheema e4c169e
removing unnecessary methods
MadameSheema 9e33e81
Fixed comment with product type to get an already defined one
dkirchan 47653cb
Changed the encode method to the default btoa()
dkirchan 1934c67
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 5535a0e
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 597d8c1
Fixing return types and API_KEY check
dkirchan 255c0c5
Merge branch 'security/dkirchan-create-envs' of github.com:elastic/ki…
dkirchan 9d646ca
Reverted Product type change
dkirchan 57d39ba
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 596f4d3
Removed return undefined
dkirchan f4d61e8
Merge branch 'security/dkirchan-create-envs' of github.com:elastic/ki…
dkirchan 267c0b9
stabilizing tests in production
MadameSheema eb293e4
Merge branch 'main' into security/dkirchan-create-envs
MadameSheema d761a4a
fixes merge conflict issue
MadameSheema 5917580
Changed poll method with pRetry
dkirchan 3cb02fb
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine d7613c8
Fixed comments for envrionments errors and types
dkirchan 3006b32
Fixed process exit to correctly map the exit code in order to fail th…
dkirchan 1f9eb5a
Removed then from pMap Promise
dkirchan 73bb92d
stabilizing more tests in production
MadameSheema 010e4fd
Merge branch 'main' into security/dkirchan-create-envs
MadameSheema 7b9a157
simplify waitForEsStatusGreen function
maximpn 3077982
Fixed wait for kibana status available.
dkirchan cda8ecd
Enabled tests to run on proper kibana nodes with parallelism
dkirchan 2482326
Removed parallel count as it is defined in the yaml file
dkirchan fb18ec6
Introducing a long timeout in and we will be able to redefine it when…
dkirchan 954c08f
Fixed the ts script that is targeted in the preparation of the build
dkirchan 691d8c7
Fixed delay before environment ready
dkirchan d25ab4e
Addressed comments around errors and burn number
dkirchan 52a7b74
Merge branch 'main' into security/dkirchan-create-envs
dkirchan 756665e
Merge branch 'main' into security/dkirchan-create-envs
MadameSheema b73cf3c
Merge branch 'main' into security/dkirchan-create-envs
MadameSheema 46649ed
Split all tests to non investigations/explore
dkirchan 91708d6
Removed dependencies in Buildkite jobs
dkirchan f10e5ff
Wait for 8 mins
dkirchan 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 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,11 @@ | ||
steps: | ||
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh | ||
label: 'Serverless Security Cypress Tests' | ||
agents: | ||
queue: n2-4-spot | ||
timeout_in_minutes: 300 | ||
parallelism: 6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why 6 as parallelism? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I split the test suites to non explore/investigations and these two categories on their own. |
||
retry: | ||
automatic: | ||
- exit_status: '*' | ||
limit: 1 |
19 changes: 19 additions & 0 deletions
19
.buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.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,19 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/common/util.sh | ||
source .buildkite/scripts/steps/functional/common_cypress.sh | ||
.buildkite/scripts/bootstrap.sh | ||
|
||
export JOB=kibana-security-solution-chrome | ||
|
||
buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true" | ||
|
||
echo "--- Serverless Security Solution Cypress for Second Quality Gate" | ||
cd x-pack/test/security_solution_cypress | ||
set +e | ||
|
||
QA_API_KEY=$(retry 5 5 vault read -field=qa_api_key secret/kibana-issues/dev/security-solution-qg-enc-key) | ||
|
||
CLOUD_QA_API_KEY=$QA_API_KEY yarn cypress:run:qa:serverless:parallel; status=$?; yarn junit:merge || :; exit $status |
18 changes: 2 additions & 16 deletions
18
.buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.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 |
---|---|---|
@@ -1,19 +1,5 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
source .buildkite/scripts/common/util.sh | ||
source .buildkite/scripts/steps/functional/common_cypress.sh | ||
.buildkite/scripts/bootstrap.sh | ||
|
||
export JOB=kibana-security-solution-chrome | ||
|
||
buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true" | ||
|
||
echo "--- Serverless Security Second Quality Gate" | ||
cd x-pack/test/security_solution_cypress | ||
set +e | ||
|
||
VAULT_DEC_KEY=$(vault read -field=key secret/kibana-issues/dev/security-solution-qg-enc-key) | ||
ENV_PWD=$(echo $TEST_ENV_PWD | openssl aes-256-cbc -d -a -pass pass:$VAULT_DEC_KEY) | ||
set -euo pipefail | ||
|
||
CYPRESS_ELASTICSEARCH_URL=$TEST_ENV_ES_URL CYPRESS_BASE_URL=$TEST_ENV_KB_URL CYPRESS_ELASTICSEARCH_USERNAME=$TEST_ENV_USERNAME CYPRESS_ELASTICSEARCH_PASSWORD=$ENV_PWD CYPRESS_KIBANA_URL=$CYPRESS_BASE_URL yarn cypress:run:qa:serverless; status=$?; yarn junit:merge || :; exit $status | ||
ts-node .buildkite/scripts/pipelines/pull_request/pipeline.ts |
38 changes: 38 additions & 0 deletions
38
.buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.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,38 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { execSync } from 'child_process'; | ||
import fs from 'fs'; | ||
|
||
const getPipeline = (filename: string, removeSteps = true) => { | ||
const str = fs.readFileSync(filename).toString(); | ||
return removeSteps ? str.replace(/^steps:/, '') : str; | ||
}; | ||
|
||
const uploadPipeline = (pipelineContent: string | object) => { | ||
const str = | ||
typeof pipelineContent === 'string' ? pipelineContent : JSON.stringify(pipelineContent); | ||
|
||
execSync('buildkite-agent pipeline upload', { | ||
input: str, | ||
stdio: ['pipe', 'inherit', 'inherit'], | ||
}); | ||
}; | ||
|
||
(async () => { | ||
try { | ||
const pipeline = []; | ||
|
||
pipeline.push(getPipeline('.buildkite/pipelines/security_solution/base.yml', false)); | ||
// remove duplicated steps | ||
uploadPipeline([...new Set(pipeline)].join('\n')); | ||
} catch (ex) { | ||
console.error('PR pipeline generation error', ex.message); | ||
process.exit(1); | ||
} | ||
})(); |
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
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.
How often to we plan to run it?
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.
On demand, when triggered by the quality gate, maybe in different PRs..... Not yet strictly defined