Skip to content

Commit

Permalink
Merge branch 'main' into remove-unused-telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Sep 26, 2022
2 parents b236c28 + 4ab4b24 commit 54e16e3
Show file tree
Hide file tree
Showing 1,509 changed files with 30,261 additions and 13,531 deletions.
3 changes: 3 additions & 0 deletions .buildkite/disabled_jest_configs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"x-pack/plugins/watcher/jest.config.js"
]
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { load as loadYaml } from 'js-yaml';
import { BuildkiteClient, BuildkiteStep } from '../buildkite';
import { CiStatsClient, TestGroupRunOrderResponse } from './client';

import DISABLED_JEST_CONFIGS from '../../disabled_jest_configs.json';

type RunGroup = TestGroupRunOrderResponse['types'][0];

const getRequiredEnv = (name: string) => {
Expand Down Expand Up @@ -220,6 +222,7 @@ export async function pickTestGroupRunOrder() {
? globby.sync(['**/jest.config.js', '!**/__fixtures__/**'], {
cwd: process.cwd(),
absolute: false,
ignore: DISABLED_JEST_CONFIGS,
})
: [];

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)"
]
}
]
}
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
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/scalability/benchmarking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ 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
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
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts

ARG NODE_VERSION=16.16.0
ARG NODE_VERSION=16.17.1

FROM node:${NODE_VERSION} AS base

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
13 changes: 13 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ x-pack/examples/files_example @elastic/kibana-app-services
/.bazelversion @elastic/kibana-operations
/WORKSPACE.bazel @elastic/kibana-operations
/.buildkite/ @elastic/kibana-operations
/kbn_pm/ @elastic/kibana-operations

# Quality Assurance
/src/dev/code_coverage @elastic/kibana-qa
Expand Down Expand Up @@ -418,6 +419,7 @@ x-pack/examples/files_example @elastic/kibana-app-services
/x-pack/plugins/security_solution/common/search_strategy/security_solution/user @elastic/security-threat-hunting-explore

/x-pack/plugins/security_solution/cypress/e2e/cases @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/cypress/e2e/filters @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/cypress/e2e/host_details @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/cypress/e2e/hosts @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/cypress/e2e/network @elastic/security-threat-hunting-explore
Expand Down Expand Up @@ -752,6 +754,9 @@ packages/core/injected-metadata/core-injected-metadata-browser-mocks @elastic/ki
packages/core/injected-metadata/core-injected-metadata-common-internal @elastic/kibana-core
packages/core/integrations/core-integrations-browser-internal @elastic/kibana-core
packages/core/integrations/core-integrations-browser-mocks @elastic/kibana-core
packages/core/lifecycle/core-lifecycle-browser @elastic/kibana-core
packages/core/lifecycle/core-lifecycle-browser-internal @elastic/kibana-core
packages/core/lifecycle/core-lifecycle-browser-mocks @elastic/kibana-core
packages/core/logging/core-logging-server @elastic/kibana-core
packages/core/logging/core-logging-server-internal @elastic/kibana-core
packages/core/logging/core-logging-server-mocks @elastic/kibana-core
Expand All @@ -771,6 +776,9 @@ packages/core/notifications/core-notifications-browser-mocks @elastic/kibana-cor
packages/core/overlays/core-overlays-browser @elastic/kibana-core
packages/core/overlays/core-overlays-browser-internal @elastic/kibana-core
packages/core/overlays/core-overlays-browser-mocks @elastic/kibana-core
packages/core/plugins/core-plugins-browser @elastic/kibana-core
packages/core/plugins/core-plugins-browser-internal @elastic/kibana-core
packages/core/plugins/core-plugins-browser-mocks @elastic/kibana-core
packages/core/preboot/core-preboot-server @elastic/kibana-core
packages/core/preboot/core-preboot-server-internal @elastic/kibana-core
packages/core/preboot/core-preboot-server-mocks @elastic/kibana-core
Expand Down Expand Up @@ -860,9 +868,12 @@ packages/kbn-eslint-plugin-disable @elastic/kibana-operations
packages/kbn-eslint-plugin-eslint @elastic/kibana-operations
packages/kbn-eslint-plugin-imports @elastic/kibana-operations
packages/kbn-expect @elastic/kibana-operations
packages/kbn-failed-test-reporter-cli @elastic/kibana-operations
packages/kbn-field-types @elastic/kibana-app-services
packages/kbn-find-used-node-modules @elastic/kibana-operations
packages/kbn-flot-charts @elastic/kibana-operations
packages/kbn-ftr-common-functional-services @elastic/kibana-operations
packages/kbn-ftr-screenshot-filename @elastic/kibana-operations
packages/kbn-generate @elastic/kibana-operations
packages/kbn-get-repo-files @elastic/kibana-operations
packages/kbn-handlebars @elastic/kibana-security
Expand All @@ -873,6 +884,7 @@ packages/kbn-import-resolver @elastic/kibana-operations
packages/kbn-interpreter @elastic/kibana-app-services
packages/kbn-io-ts-utils @elastic/apm-ui
packages/kbn-jest-serializers @elastic/kibana-operations
packages/kbn-journeys @elastic/kibana-operations
packages/kbn-kibana-manifest-schema @elastic/kibana-operations
packages/kbn-logging @elastic/kibana-core
packages/kbn-logging-mocks @elastic/kibana-core
Expand All @@ -882,6 +894,7 @@ packages/kbn-mapbox-gl @elastic/kibana-gis
packages/kbn-monaco @elastic/kibana-app-services
packages/kbn-optimizer @elastic/kibana-operations
packages/kbn-optimizer-webpack-helpers @elastic/kibana-operations
packages/kbn-osquery-io-ts-types @elastic/security-asset-management
packages/kbn-performance-testing-dataset-extractor @elastic/kibana-performance-testing
packages/kbn-plugin-discovery @elastic/kibana-operations
packages/kbn-plugin-generator @elastic/kibana-operations
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
16.17.1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
16.17.1
Loading

0 comments on commit 54e16e3

Please sign in to comment.