Skip to content

Commit

Permalink
Merge branch 'main' into stabilize_scripted_field_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime authored Mar 11, 2022
2 parents 6b43564 + affbed7 commit 819b7b4
Show file tree
Hide file tree
Showing 1,851 changed files with 51,735 additions and 104,449 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ steps:

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 2
parallelism: 3
agents:
queue: n2-4
timeout_in_minutes: 120
Expand Down
12 changes: 12 additions & 0 deletions .buildkite/pipelines/flaky_tests/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
23 changes: 22 additions & 1 deletion .buildkite/pipelines/flaky_tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -113,7 +116,7 @@ steps.push({
label: 'Build Kibana Distribution and Plugins',
agents: { queue: 'c2-8' },
key: 'build',
if: "build.env('BUILD_ID_FOR_ARTIFACTS') == null || build.env('BUILD_ID_FOR_ARTIFACTS') == ''",
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''",
});

for (const testSuite of testSuites) {
Expand Down Expand Up @@ -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;
}
}
Expand Down
86 changes: 16 additions & 70 deletions .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
label: 'Default CI Group'
parallelism: 27
agents:
queue: n2-4-spot
queue: n2-4
depends_on: build
timeout_in_minutes: 250
key: default-cigroup
Expand All @@ -31,7 +31,7 @@ steps:
- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Docker CI Group'
agents:
queue: n2-4-spot
queue: n2-4
depends_on: build
timeout_in_minutes: 120
key: default-cigroup-docker
Expand All @@ -44,7 +44,7 @@ steps:
label: 'OSS CI Group'
parallelism: 11
agents:
queue: n2-4-spot
queue: ci-group-4d
depends_on: build
timeout_in_minutes: 120
key: oss-cigroup
Expand All @@ -56,49 +56,29 @@ steps:
- command: .buildkite/scripts/steps/functional/oss_accessibility.sh
label: 'OSS Accessibility Tests'
agents:
queue: n2-4-spot
queue: ci-group-4d
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '1'
- exit_status: '*'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/functional/xpack_accessibility.sh
label: 'Default Accessibility Tests'
agents:
queue: n2-4-spot
queue: n2-4
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '1'
- exit_status: '*'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/functional/oss_firefox.sh
label: 'OSS Firefox Tests'
agents:
queue: n2-4-spot
queue: ci-group-4d
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -109,28 +89,18 @@ steps:
- command: .buildkite/scripts/steps/functional/xpack_firefox.sh
label: 'Default Firefox Tests'
agents:
queue: n2-4-spot
queue: n2-4
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '1'
- exit_status: '*'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/functional/oss_misc.sh
label: 'OSS Misc Functional Tests'
agents:
queue: n2-4-spot
queue: n2-4
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -141,23 +111,13 @@ steps:
- command: .buildkite/scripts/steps/functional/xpack_saved_object_field_metrics.sh
label: 'Saved Object Field Metrics'
agents:
queue: n2-4-spot
queue: n2-4
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '1'
- exit_status: '*'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
Expand All @@ -169,32 +129,18 @@ steps:

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 2
parallelism: 3
agents:
queue: n2-4
timeout_in_minutes: 90
timeout_in_minutes: 120
key: jest-integration

- command: .buildkite/scripts/steps/test/api_integration.sh
label: 'API Integration Tests'
agents:
queue: n2-4-spot
queue: n2-2
timeout_in_minutes: 120
key: api-integration
retry:
automatic:
- exit_status: '1'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
Expand Down
11 changes: 1 addition & 10 deletions .buildkite/pipelines/performance/daily.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
steps:
- block: ':gear: Performance Tests Configuration'
prompt: 'Fill out the details for performance test'
fields:
- text: ':arrows_counterclockwise: Iterations'
key: 'performance-test-iteration-count'
hint: 'How many times you want to run tests? '
required: true
if: build.env('PERF_TEST_COUNT') == null

- label: ':male-mechanic::skin-tone-2: Pre-Build'
command: .buildkite/scripts/lifecycle/pre_build.sh
agents:
Expand All @@ -24,7 +15,7 @@ steps:
- label: ':muscle: Performance Tests with Playwright config'
command: .buildkite/scripts/steps/functional/performance_playwright.sh
agents:
queue: c2-16
queue: kb-static-ubuntu
depends_on: build

- wait: ~
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ steps:

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 2
parallelism: 3
agents:
queue: n2-4
timeout_in_minutes: 90
timeout_in_minutes: 120
key: jest-integration

- command: .buildkite/scripts/steps/test/api_integration.sh
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/demo_env/kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source "$(dirname "${0}")/config.sh"
export KIBANA_IMAGE="gcr.io/elastic-kibana-184716/demo/kibana:$DEPLOYMENT_NAME-$(git rev-parse HEAD)"

echo '--- Build Kibana'
node scripts/build --debug --docker-images --example-plugins --skip-docker-ubi
node scripts/build --debug --docker-images --example-plugins --skip-docker-ubi --skip-docker-cloud --skip-docker-contexts

echo '--- Build Docker image with example plugins'
cd target/example_plugins
Expand Down
65 changes: 48 additions & 17 deletions .buildkite/scripts/steps/functional/performance_playwright.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,55 @@
#!/bin/bash
#!/usr/bin/env bash

set -uo pipefail
set -euo pipefail

if [ -z "${PERF_TEST_COUNT+x}" ]; then
TEST_COUNT="$(buildkite-agent meta-data get performance-test-iteration-count)"
else
TEST_COUNT=$PERF_TEST_COUNT
fi
source .buildkite/scripts/common/util.sh

tput setab 2; tput setaf 0; echo "Performance test will be run at ${BUILDKITE_BRANCH} ${TEST_COUNT} times"
.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

cat << EOF | buildkite-agent pipeline upload
steps:
- command: .buildkite/scripts/steps/functional/performance_sub_playwright.sh
parallelism: "$TEST_COUNT"
concurrency: 20
concurrency_group: 'performance-test-group'
agents:
queue: c2-16
EOF
echo --- Run Performance Tests with Playwright config

node scripts/es snapshot&

esPid=$!

export TEST_ES_URL=http://elastic:changeme@localhost:9200
export TEST_ES_DISABLE_STARTUP=true

sleep 120

cd "$XPACK_DIR"

jobId=$(npx uuid)
export TEST_JOB_ID="$jobId"

journeys=("ecommerce_dashboard" "flight_dashboard" "web_logs_dashboard" "promotion_tracking_dashboard")

for i in "${journeys[@]}"; do
echo "JOURNEY[${i}] is running"

export TEST_PERFORMANCE_PHASE=WARMUP
export ELASTIC_APM_ACTIVE=false
export JOURNEY_NAME="${i}"

checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: WARMUP)" \
node scripts/functional_tests \
--config test/performance/config.playwright.ts \
--include "test/performance/tests/playwright/${i}.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail

export TEST_PERFORMANCE_PHASE=TEST
export ELASTIC_APM_ACTIVE=true

checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: TEST)" \
node scripts/functional_tests \
--config test/performance/config.playwright.ts \
--include "test/performance/tests/playwright/${i}.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
done

kill "$esPid"
Loading

0 comments on commit 819b7b4

Please sign in to comment.