Skip to content

Commit

Permalink
Merge branch 'main' into ti-feature-flag-removal
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeOberti authored Sep 23, 2022
2 parents 71e0a8d + 02a07f3 commit 02f0245
Show file tree
Hide file tree
Showing 2,381 changed files with 65,607 additions and 23,883 deletions.
3 changes: 2 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"repoName": "kibana",
"targetBranchChoices": [
"main",
"8.5",
"8.4",
"8.3",
"8.2",
Expand Down Expand Up @@ -41,7 +42,7 @@
"backport"
],
"branchLabelMapping": {
"^v8.5.0$": "main",
"^v8.6.0$": "main",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
},
"autoMerge": true,
Expand Down
16 changes: 8 additions & 8 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ disabled:
- x-pack/test/fleet_packages/config.ts

# Scalability testing config that we run in its own pipeline
- x-pack/test/performance/scalability/config.ts
- x-pack/test/scalability/config.ts

defaultQueue: 'n2-4-spot'
enabled:
Expand Down Expand Up @@ -267,10 +267,10 @@ enabled:
- x-pack/test/ui_capabilities/spaces_only/config.ts
- x-pack/test/upgrade_assistant_integration/config.js
- x-pack/test/usage_collection/config.ts
- x-pack/test/performance/journeys/ecommerce_dashboard/config.ts
- x-pack/test/performance/journeys/flight_dashboard/config.ts
- x-pack/test/performance/journeys/login/config.ts
- x-pack/test/performance/journeys/many_fields_discover/config.ts
- x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts
- x-pack/test/performance/journeys/web_logs_dashboard/config.ts
- x-pack/test/performance/journeys/data_stress_test_lens/config.ts
- x-pack/performance/journeys/ecommerce_dashboard.ts
- x-pack/performance/journeys/flight_dashboard.ts
- x-pack/performance/journeys/login.ts
- x-pack/performance/journeys/many_fields_discover.ts
- x-pack/performance/journeys/promotion_tracking_dashboard.ts
- x-pack/performance/journeys/web_logs_dashboard.ts
- x-pack/performance/journeys/data_stress_test_lens.ts
1 change: 1 addition & 0 deletions .buildkite/pipelines/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ steps:
label: 'Cloud Deployment'
soft_fail:
- exit_status: 255
- exit_status: -1
agents:
queue: n2-2
timeout_in_minutes: 30
Expand Down
12 changes: 6 additions & 6 deletions .buildkite/pipelines/performance/daily.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
steps:
- label: ':male-mechanic::skin-tone-2: Pre-Build'
- label: '👨‍🔧 Pre-Build'
command: .buildkite/scripts/lifecycle/pre_build.sh
agents:
queue: kibana-default

- wait

- label: ':factory_worker: Build Kibana Distribution and Plugins'
- label: '🧑‍🏭 Build Kibana Distribution and Plugins'
command: .buildkite/scripts/steps/build_kibana.sh
agents:
queue: c2-16
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"

- label: ':muscle: Performance Tests with Playwright config'
- label: '💪 Performance Tests with Playwright config'
command: .buildkite/scripts/steps/functional/performance_playwright.sh
agents:
queue: kb-static-ubuntu
depends_on: build
key: tests
timeout_in_minutes: 60

- label: ':shipit: Performance Tests dataset extraction for scalability benchmarking'
- label: '🚢 Performance Tests dataset extraction for scalability benchmarking'
command: .buildkite/scripts/steps/functional/scalability_dataset_extraction.sh
agents:
queue: n2-2
depends_on: tests

- label: ':chart_with_upwards_trend: Report performance metrics to ci-stats'
- label: '📈 Report performance metrics to ci-stats'
command: .buildkite/scripts/steps/functional/report_performance_metrics.sh
agents:
queue: n2-2
Expand All @@ -36,7 +36,7 @@ steps:
- wait: ~
continue_on_failure: true

- label: ':male_superhero::skin-tone-2: Post-Build'
- label: '🦸 Post-Build'
command: .buildkite/scripts/lifecycle/post_build.sh
agents:
queue: kibana-default
7 changes: 6 additions & 1 deletion .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
"kibana_versions_check": true,
"kibana_build_reuse": true,
"kibana_build_reuse_pipeline_slugs": ["kibana-pull-request", "kibana-on-merge"],
"kibana_build_reuse_regexes": ["^test/", "^x-pack/test/"]
"kibana_build_reuse_regexes": [
"^test/",
"^x-pack/test/",
"/__snapshots__/",
"\\.test\\.(ts|tsx|js|jsx)"
]
}
]
}
2 changes: 1 addition & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const uploadPipeline = (pipelineContent: string | object) => {
}

if (
(await doAnyChangesMatch([/^x-pack\/plugins\/apm/])) ||
(await doAnyChangesMatch([/^x-pack\/plugins\/apm/, /^packages\/kbn-apm-synthtrace/])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/apm_cypress.yml'));
Expand Down
7 changes: 2 additions & 5 deletions .buildkite/scripts/steps/artifacts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ fi

if [[ "$RELEASE_BUILD" == "true" ]]; then
FULL_VERSION="$QUALIFIER_VERSION"

# Beats artifacts will need to match a specific commit sha that matches other stack images
# for release builds. For now we are skipping Cloud builds until there's a pointer.
BUILD_ARGS="--release --skip-docker-cloud --version-qualifier=$VERSION_QUALIFIER"
BUILD_ARGS="--release --version-qualifier=$VERSION_QUALIFIER"
WORKFLOW="staging"
else
FULL_VERSION="$QUALIFIER_VERSION-SNAPSHOT"
BUILD_ARGS="--skip-docker-cloud --version-qualifier=$VERSION_QUALIFIER"
BUILD_ARGS="--version-qualifier=$VERSION_QUALIFIER"
WORKFLOW="snapshot"
fi

Expand Down
2 changes: 2 additions & 0 deletions .buildkite/scripts/steps/artifacts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ cd target

download "kibana-$FULL_VERSION-docker-image.tar.gz"
download "kibana-$FULL_VERSION-docker-image-aarch64.tar.gz"
download "kibana-cloud-$FULL_VERSION-docker-image.tar.gz"
download "kibana-cloud-$FULL_VERSION-docker-image-aarch64.tar.gz"
download "kibana-ubi8-$FULL_VERSION-docker-image.tar.gz"

download "kibana-$FULL_VERSION-arm64.deb"
Expand Down
77 changes: 42 additions & 35 deletions .buildkite/scripts/steps/functional/performance_playwright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,33 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

is_test_execution_step

.buildkite/scripts/bootstrap.sh
# These tests are running on static workers so we have to make sure we delete previous build of Kibana
rm -rf "$KIBANA_BUILD_LOCATION"
.buildkite/scripts/download_build_artifacts.sh

echo --- Run Performance Tests with Playwright config
echo "--- 🦺 Starting Elasticsearch"

node scripts/es snapshot&
export esPid=$!
trap 'kill ${esPid}' EXIT

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

# Pings the es server every second for up to 2 minutes until it is green
curl \
--fail \
--silent \
--retry 120 \
--retry-delay 1 \
--retry-connrefused \
-XGET "${TEST_ES_URL}/_cluster/health?wait_for_nodes=>=1&wait_for_status=yellow" \
> /dev/null

echo "✅ ES is ready and will continue to run in the background"

# unset env vars defined in other parts of CI for automatic APM collection of
# Kibana. We manage APM config in our FTR config and performance service, and
Expand All @@ -29,39 +46,29 @@ unset ELASTIC_APM_SERVER_URL
unset ELASTIC_APM_SECRET_TOKEN
unset ELASTIC_APM_GLOBAL_LABELS


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

# Pings the es server every seconds 2 mins until it is status is green
curl --retry 120 \
--retry-delay 1 \
--retry-all-errors \
-I -XGET "${TEST_ES_URL}/_cluster/health?wait_for_nodes=>=1&wait_for_status=yellow"

journeys=("login" "ecommerce_dashboard" "flight_dashboard" "web_logs_dashboard" "promotion_tracking_dashboard" "many_fields_discover" "data_stress_test_lens")

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

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

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

export TEST_PERFORMANCE_PHASE=TEST

checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: TEST)" \
node scripts/functional_tests \
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
for journey in "${journeys[@]}"; do
set +e

phases=("WARMUP" "TEST")
for phase in "${phases[@]}"; do
echo "--- $journey - $phase"

export TEST_PERFORMANCE_PHASE="$phase"
node scripts/functional_tests \
--config "x-pack/performance/journeys/$journey.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail

status=$?
if [ $status -ne 0 ]; then
echo "^^^ +++"
echo "❌ FTR failed with status code: $status"
exit 1
fi
done

set -e
done

kill "$esPid"
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ OUTPUT_DIR="${KIBANA_DIR}/${OUTPUT_REL}"
.buildkite/scripts/bootstrap.sh

echo "--- Extract APM metrics"
scalabilityJourneys=("login" "ecommerce_dashboard" "flight_dashboard" "web_logs_dashboard" "promotion_tracking_dashboard" "many_fields_discover")

for i in "${scalabilityJourneys[@]}"; do
JOURNEY_NAME="${i}"
echo "Looking for JOURNEY=${JOURNEY_NAME} and BUILD_ID=${BUILD_ID} in APM traces"

node scripts/extract_performance_testing_dataset \
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--buildId "${BUILD_ID}" \
--es-url "${ES_SERVER_URL}" \
--es-username "${USER_FROM_VAULT}" \
--es-password "${PASS_FROM_VAULT}" \
--without-static-resources
for journey in x-pack/performance/journeys/*; do
echo "Looking for journey=${journey} and BUILD_ID=${BUILD_ID} in APM traces"

node scripts/extract_performance_testing_dataset \
--config "${journey}" \
--buildId "${BUILD_ID}" \
--es-url "${ES_SERVER_URL}" \
--es-username "${USER_FROM_VAULT}" \
--es-password "${PASS_FROM_VAULT}" \
--without-static-resources
done

echo "--- Creating scalability dataset in ${OUTPUT_REL}"
Expand Down
8 changes: 6 additions & 2 deletions .buildkite/scripts/steps/scalability/benchmarking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ checkout_and_compile_load_runner() {

upload_test_results() {
cd "${KIBANA_DIR}"
echo "--- Archive Gatling reports and upload as build artifacts"
echo "Upload server logs as build artifacts"
tar -czf server-logs.tar.gz data/ftr_servers_logs/**/*
buildkite-agent artifact upload server-logs.tar.gz
echo "--- Upload Gatling reports as build artifacts"
tar -czf "scalability_test_report.tar.gz" --exclude=simulation.log -C kibana-load-testing/target gatling
buildkite-agent artifact upload "scalability_test_report.tar.gz"
cd "${LATEST_RUN_ARTIFACTS_DIR}"
Expand Down Expand Up @@ -113,8 +116,9 @@ for journey in scalability_traces/server/*; do
export SCALABILITY_JOURNEY_PATH="$KIBANA_DIR/$journey"
echo "--- Run scalability file: $SCALABILITY_JOURNEY_PATH"
node scripts/functional_tests \
--config x-pack/test/performance/scalability/config.ts \
--config x-pack/test/scalability/config.ts \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--logToFile \
--debug
done

Expand Down
14 changes: 11 additions & 3 deletions .buildkite/scripts/steps/test/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ exitCode=0
results=()

if [[ "$1" == 'jest.config.js' ]]; then
# run unit tests in parallel
parallelism="-w2"
# we used to run jest tests in parallel but started to see a lot of flakiness in libraries like react-dom/test-utils:
# https://github.com/elastic/kibana/issues/141477
# parallelism="-w2"
parallelism="--runInBand"
TEST_TYPE="unit"
else
# run integration tests in-band
Expand All @@ -26,11 +28,17 @@ configs=$(jq -r 'getpath([env.TEST_TYPE]) | .groups[env.JOB | tonumber].names |

while read -r config; do
echo "--- $ node scripts/jest --config $config"

cmd="NODE_OPTIONS=\"--max-old-space-size=14336\" node ./scripts/jest --config=\"$config\" $parallelism --coverage=false --passWithNoTests"
echo "actual full command is:"
echo "$cmd"
echo ""

start=$(date +%s)

# prevent non-zero exit code from breaking the loop
set +e;
NODE_OPTIONS="--max-old-space-size=14336" node ./scripts/jest --config="$config" "$parallelism" --coverage=false --passWithNoTests
eval "$cmd"
lastCode=$?
set -e;

Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const DEV_PATTERNS = [
'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*',
'x-pack/plugins/*/server/scripts/**/*',
'x-pack/plugins/fleet/cypress',
'x-pack/performance/**/*',
];

/** Restricted imports with suggested alternatives */
Expand Down
Loading

0 comments on commit 02f0245

Please sign in to comment.