Skip to content

Commit

Permalink
Merge branch 'main' into fix/synthetics-flaky-test
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke authored Mar 14, 2022
2 parents 7bd1cd1 + 6d87f12 commit 00c9246
Show file tree
Hide file tree
Showing 3,791 changed files with 158,253 additions and 136,517 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .buildkite/pipelines/bazel_cache.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
steps:
- label: ':pipeline: Create pipeline with priority'
agents:
queue: kibana-default
concurrency_group: bazel_macos
concurrency: 1
concurrency_method: eager
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/es_snapshots/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ steps:
required: true
- label: Promote Snapshot
command: .buildkite/scripts/steps/es_snapshots/promote.sh
agents:
queue: kibana-default
8 changes: 7 additions & 1 deletion .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10
agents:
queue: kibana-default

- wait

Expand Down Expand Up @@ -65,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 All @@ -85,6 +87,8 @@ steps:
- command: .buildkite/scripts/steps/es_snapshots/trigger_promote.sh
label: Trigger promotion
timeout_in_minutes: 10
agents:
queue: kibana-default
depends_on:
- default-cigroup
- default-cigroup-docker
Expand All @@ -98,3 +102,5 @@ steps:
- command: .buildkite/scripts/lifecycle/post_build.sh
label: Post-Build
timeout_in_minutes: 10
agents:
queue: kibana-default
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
3 changes: 3 additions & 0 deletions .buildkite/pipelines/flaky_tests/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const pipeline = {
{
command: '.buildkite/pipelines/flaky_tests/runner.sh',
label: 'Create pipeline',
agents: {
queue: 'kibana-default',
},
},
],
};
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
8 changes: 6 additions & 2 deletions .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10
agents:
queue: kibana-default

- wait

Expand Down Expand Up @@ -127,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 Expand Up @@ -174,3 +176,5 @@ steps:
- command: .buildkite/scripts/lifecycle/post_build.sh
label: Post-Build
timeout_in_minutes: 10
agents:
queue: kibana-default
4 changes: 4 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10
agents:
queue: kibana-default

- wait

Expand Down Expand Up @@ -34,3 +36,5 @@ steps:
- command: .buildkite/scripts/lifecycle/post_build.sh
label: Post-Build
timeout_in_minutes: 10
agents:
queue: kibana-default
24 changes: 9 additions & 15 deletions .buildkite/pipelines/performance/daily.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
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"
- label: ':male-mechanic::skin-tone-2: Pre-Build'
command: .buildkite/scripts/lifecycle/pre_build.sh
agents:
queue: kibana-default

- wait

- label: ":factory_worker: Build Kibana Distribution and Plugins"
- label: ':factory_worker: Build Kibana Distribution and Plugins'
command: .buildkite/scripts/steps/build_kibana.sh
agents:
queue: c2-16
key: build

- label: ":muscle: Performance Tests with Playwright config"
- 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: ~
continue_on_failure: true

- label: ":male_superhero::skin-tone-2: Post-Build"
- label: ':male_superhero::skin-tone-2: Post-Build'
command: .buildkite/scripts/lifecycle/post_build.sh

agents:
queue: kibana-default
17 changes: 0 additions & 17 deletions .buildkite/pipelines/pull_request.yml

This file was deleted.

6 changes: 4 additions & 2 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10
agents:
queue: kibana-default

- wait

Expand Down Expand Up @@ -127,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: 2 additions & 0 deletions .buildkite/pipelines/pull_request/post_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ steps:

- command: .buildkite/scripts/lifecycle/post_build.sh
label: Post-Build
agents:
queue: kibana-default
2 changes: 2 additions & 0 deletions .buildkite/pipelines/purge_cloud_deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ steps:
- command: .buildkite/scripts/steps/cloud/purge.sh
label: Purge old cloud deployments
timeout_in_minutes: 10
agents:
queue: kibana-default
2 changes: 2 additions & 0 deletions .buildkite/pipelines/update_demo_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ steps:
- command: .buildkite/scripts/steps/demo_env/es_and_init.sh
label: Initialize Environment and Deploy ES
timeout_in_minutes: 10
agents:
queue: kibana-default

- command: .buildkite/scripts/steps/demo_env/kibana.sh
label: Build and Deploy Kibana
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"
41 changes: 0 additions & 41 deletions .buildkite/scripts/steps/functional/performance_sub_playwright.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/uptime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ echo "--- Uptime @elastic/synthetics Tests"
cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION"
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
Loading

0 comments on commit 00c9246

Please sign in to comment.