Skip to content

Commit 34ff860

Browse files
Merge branch '7.x' into reporting/csv-export-fix
2 parents 7db7614 + 2937c7d commit 34ff860

File tree

3,591 files changed

+40499
-35861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,591 files changed

+40499
-35861
lines changed

.buildkite/hooks/post-command

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
.buildkite/scripts/lifecycle/post_command.sh

.buildkite/pipelines/es_snapshots/verify.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ steps:
2828
parallelism: 13
2929
agents:
3030
queue: ci-group-6
31-
artifact_paths: target/junit/**/*.xml
3231
depends_on: build
32+
timeout_in_minutes: 150
3333
key: default-cigroup
3434
retry:
3535
automatic:
@@ -40,8 +40,8 @@ steps:
4040
label: 'Docker CI Group'
4141
agents:
4242
queue: ci-group-6
43-
artifact_paths: target/junit/**/*.xml
4443
depends_on: build
44+
timeout_in_minutes: 120
4545
key: default-cigroup-docker
4646
retry:
4747
automatic:
@@ -50,11 +50,11 @@ steps:
5050

5151
- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
5252
label: 'OSS CI Group'
53-
parallelism: 12
53+
parallelism: 11
5454
agents:
5555
queue: ci-group-4d
56-
artifact_paths: target/junit/**/*.xml
5756
depends_on: build
57+
timeout_in_minutes: 120
5858
key: oss-cigroup
5959
retry:
6060
automatic:
@@ -65,7 +65,7 @@ steps:
6565
label: 'Jest Integration Tests'
6666
agents:
6767
queue: jest
68-
artifact_paths: target/junit/**/*.xml
68+
timeout_in_minutes: 120
6969
key: jest-integration
7070
retry:
7171
automatic:
@@ -76,7 +76,7 @@ steps:
7676
label: 'API Integration Tests'
7777
agents:
7878
queue: jest
79-
artifact_paths: target/junit/**/*.xml
79+
timeout_in_minutes: 120
8080
key: api-integration
8181

8282
- command: .buildkite/scripts/steps/es_snapshots/trigger_promote.sh
@@ -94,6 +94,7 @@ steps:
9494
- plugins:
9595
- junit-annotate#v1.9.0:
9696
artifacts: target/junit/**/*.xml
97+
job-uuid-file-pattern: '-bk__(.*).xml'
9798

9899
- wait: ~
99100
continue_on_failure: true

.buildkite/pipelines/hourly.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
steps:
2+
- command: .buildkite/scripts/lifecycle/pre_build.sh
3+
label: Pre-Build
4+
5+
- wait
6+
7+
- command: .buildkite/scripts/steps/build_kibana.sh
8+
label: Build Kibana Distribution and Plugins
9+
agents:
10+
queue: c2-8
11+
key: build
12+
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
13+
14+
- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
15+
label: 'Default CI Group'
16+
parallelism: 13
17+
agents:
18+
queue: ci-group-6
19+
depends_on: build
20+
timeout_in_minutes: 150
21+
key: default-cigroup
22+
retry:
23+
automatic:
24+
- exit_status: '*'
25+
limit: 1
26+
27+
- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
28+
label: 'Docker CI Group'
29+
agents:
30+
queue: ci-group-6
31+
depends_on: build
32+
timeout_in_minutes: 120
33+
key: default-cigroup-docker
34+
retry:
35+
automatic:
36+
- exit_status: '*'
37+
limit: 1
38+
39+
- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
40+
label: 'OSS CI Group'
41+
parallelism: 11
42+
agents:
43+
queue: ci-group-4d
44+
depends_on: build
45+
timeout_in_minutes: 120
46+
key: oss-cigroup
47+
retry:
48+
automatic:
49+
- exit_status: '*'
50+
limit: 1
51+
52+
- command: .buildkite/scripts/steps/functional/oss_accessibility.sh
53+
label: 'OSS Accessibility Tests'
54+
agents:
55+
queue: ci-group-4d
56+
depends_on: build
57+
timeout_in_minutes: 120
58+
retry:
59+
automatic:
60+
- exit_status: '*'
61+
limit: 1
62+
63+
- command: .buildkite/scripts/steps/functional/xpack_accessibility.sh
64+
label: 'Default Accessibility Tests'
65+
agents:
66+
queue: ci-group-6
67+
depends_on: build
68+
timeout_in_minutes: 120
69+
retry:
70+
automatic:
71+
- exit_status: '*'
72+
limit: 1
73+
74+
- command: .buildkite/scripts/steps/functional/oss_firefox.sh
75+
label: 'OSS Firefox Tests'
76+
agents:
77+
queue: ci-group-4d
78+
depends_on: build
79+
timeout_in_minutes: 120
80+
retry:
81+
automatic:
82+
- exit_status: '*'
83+
limit: 1
84+
85+
- command: .buildkite/scripts/steps/functional/xpack_firefox.sh
86+
label: 'Default Firefox Tests'
87+
agents:
88+
queue: ci-group-6
89+
depends_on: build
90+
timeout_in_minutes: 120
91+
retry:
92+
automatic:
93+
- exit_status: '*'
94+
limit: 1
95+
96+
- command: .buildkite/scripts/steps/functional/oss_misc.sh
97+
label: 'OSS Misc Functional Tests'
98+
agents:
99+
queue: ci-group-4d
100+
depends_on: build
101+
timeout_in_minutes: 120
102+
retry:
103+
automatic:
104+
- exit_status: '*'
105+
limit: 1
106+
107+
- command: .buildkite/scripts/steps/functional/xpack_saved_object_field_metrics.sh
108+
label: 'Saved Object Field Metrics'
109+
agents:
110+
queue: ci-group-6
111+
depends_on: build
112+
timeout_in_minutes: 120
113+
retry:
114+
automatic:
115+
- exit_status: '*'
116+
limit: 1
117+
118+
- command: .buildkite/scripts/steps/test/jest_integration.sh
119+
label: 'Jest Integration Tests'
120+
agents:
121+
queue: jest
122+
timeout_in_minutes: 120
123+
key: jest-integration
124+
125+
- command: .buildkite/scripts/steps/test/api_integration.sh
126+
label: 'API Integration Tests'
127+
agents:
128+
queue: jest
129+
timeout_in_minutes: 120
130+
key: api-integration
131+
132+
- command: .buildkite/scripts/steps/test/jest.sh
133+
label: 'Jest Tests'
134+
agents:
135+
queue: c2-16
136+
timeout_in_minutes: 120
137+
key: jest
138+
139+
- command: .buildkite/scripts/steps/lint.sh
140+
label: 'Linting'
141+
agents:
142+
queue: n2-2
143+
key: linting
144+
145+
- command: .buildkite/scripts/steps/checks.sh
146+
label: 'Checks'
147+
agents:
148+
queue: c2-4
149+
key: checks
150+
151+
- command: .buildkite/scripts/steps/storybooks/build_and_upload.sh
152+
label: 'Build Storybooks'
153+
agents:
154+
queue: c2-4
155+
key: storybooks
156+
157+
- wait: ~
158+
continue_on_failure: true
159+
160+
- plugins:
161+
- junit-annotate#v1.9.0:
162+
artifacts: target/junit/**/*.xml
163+
job-uuid-file-pattern: '-bk__(.*).xml'
164+
165+
- wait: ~
166+
continue_on_failure: true
167+
168+
- command: .buildkite/scripts/lifecycle/post_build.sh
169+
label: Post-Build

.buildkite/scripts/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
source .buildkite/scripts/common/util.sh
66

77
echo "--- yarn install and bootstrap"
8-
yarn kbn bootstrap
8+
retry 2 15 yarn kbn bootstrap
99

1010
###
1111
### upload ts-refs-cache artifacts as quickly as possible so they are available for download

.buildkite/scripts/build_kibana_plugins.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,3 @@ node scripts/build_kibana_platform_plugins \
1919
--scan-dir "$XPACK_DIR/test/usage_collection/plugins" \
2020
--scan-dir "$XPACK_DIR/test/security_functional/fixtures/common" \
2121
--scan-dir "$XPACK_DIR/examples"
22-
23-
echo "--- Archive built plugins"
24-
shopt -s globstar
25-
tar -zcf \
26-
target/kibana-default-plugins.tar.gz \
27-
x-pack/plugins/**/target/public \
28-
x-pack/test/**/target/public \
29-
examples/**/target/public \
30-
x-pack/examples/**/target/public \
31-
test/**/target/public

.buildkite/scripts/common/env.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ PARENT_DIR="$(cd "$KIBANA_DIR/.."; pwd)"
1111
export PARENT_DIR
1212
export WORKSPACE="${WORKSPACE:-$PARENT_DIR}"
1313

14+
# A few things, such as Chrome, respect this variable
15+
# For many agent types, the workspace is mounted on a local ssd, so will be faster than the default tmp dir location
16+
if [[ -d /opt/local-ssd/buildkite ]]; then
17+
export TMPDIR="/opt/local-ssd/buildkite/tmp"
18+
mkdir -p "$TMPDIR"
19+
fi
20+
1421
KIBANA_PKG_BRANCH="$(jq -r .branch "$KIBANA_DIR/package.json")"
1522
export KIBANA_PKG_BRANCH
1623
export KIBANA_BASE_BRANCH="$KIBANA_PKG_BRANCH"
@@ -28,11 +35,9 @@ export TEST_BROWSER_HEADLESS=1
2835
export ELASTIC_APM_ENVIRONMENT=ci
2936
export ELASTIC_APM_TRANSACTION_SAMPLE_RATE=0.1
3037

31-
CI_REPORTING_ENABLED=false # TODO enable when ready, only controls checks reporter and APM
32-
3338
if is_pr; then
3439
export ELASTIC_APM_ACTIVE=false
35-
export CHECKS_REPORTER_ACTIVE="${CI_REPORTING_ENABLED-}"
40+
export CHECKS_REPORTER_ACTIVE=true
3641

3742
# These can be removed once we're not supporting Jenkins and Buildkite at the same time
3843
# These are primarily used by github checks reporter and can be configured via /github_checks_api.json
@@ -42,7 +47,7 @@ if is_pr; then
4247

4348
# set_git_merge_base # TODO for PRs
4449
else
45-
export ELASTIC_APM_ACTIVE="${CI_REPORTING_ENABLED-}"
50+
export ELASTIC_APM_ACTIVE=true
4651
export CHECKS_REPORTER_ACTIVE=false
4752
fi
4853

.buildkite/scripts/common/setup_bazel.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

3-
KIBANA_BUILDBUDDY_CI_API_KEY=$(vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
3+
source .buildkite/scripts/common/util.sh
4+
5+
KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
46
export KIBANA_BUILDBUDDY_CI_API_KEY
57

68
cp "$KIBANA_DIR/src/dev/ci_setup/.bazelrc-ci" "$HOME/.bazelrc"

.buildkite/scripts/common/util.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,28 @@ docker_run() {
4949

5050
docker run "${args[@]}" "$@"
5151
}
52+
53+
is_test_execution_step() {
54+
buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" 'true'
55+
}
56+
57+
retry() {
58+
local retries=$1; shift
59+
local delay=$1; shift
60+
local attempts=1
61+
62+
until "$@"; do
63+
retry_exit_status=$?
64+
echo "Exited with $retry_exit_status" >&2
65+
if (( retries == "0" )); then
66+
return $retry_exit_status
67+
elif (( attempts == retries )); then
68+
echo "Failed $attempts retries" >&2
69+
return $retry_exit_status
70+
else
71+
echo "Retrying $((retries - attempts)) more times..." >&2
72+
attempts=$((attempts + 1))
73+
sleep "$delay"
74+
fi
75+
done
76+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
IS_TEST_EXECUTION_STEP="$(buildkite-agent meta-data get "${BUILDKITE_JOB_ID}_is_test_execution_step" --default '')"
6+
7+
if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
8+
buildkite-agent artifact upload 'target/junit/**/*'
9+
buildkite-agent artifact upload 'target/kibana-*'
10+
buildkite-agent artifact upload 'target/kibana-coverage/jest/**/*'
11+
buildkite-agent artifact upload 'target/kibana-security-solution/**/*.png'
12+
buildkite-agent artifact upload 'target/test-metrics/*'
13+
buildkite-agent artifact upload 'target/test-suites-ci-plan.json'
14+
buildkite-agent artifact upload 'test/**/screenshots/diff/*.png'
15+
buildkite-agent artifact upload 'test/**/screenshots/failure/*.png'
16+
buildkite-agent artifact upload 'test/**/screenshots/session/*.png'
17+
buildkite-agent artifact upload 'test/functional/failure_debug/html/*.html'
18+
buildkite-agent artifact upload 'x-pack/test/**/screenshots/diff/*.png'
19+
buildkite-agent artifact upload 'x-pack/test/**/screenshots/failure/*.png'
20+
buildkite-agent artifact upload 'x-pack/test/**/screenshots/session/*.png'
21+
buildkite-agent artifact upload 'x-pack/test/functional/apps/reporting/reports/session/*.pdf'
22+
buildkite-agent artifact upload 'x-pack/test/functional/failure_debug/html/*.html'
23+
buildkite-agent artifact upload '.es/**/*.hprof'
24+
25+
# TODO - re-enable when Jenkins is disabled
26+
# node scripts/report_failed_tests --build-url="${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}" 'target/junit/**/*.xml'
27+
fi

.buildkite/scripts/lifecycle/pre_build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
set -euo pipefail
44

5+
source .buildkite/scripts/common/util.sh
6+
57
"$(dirname "${0}")/commit_status_start.sh"
68

7-
export CI_STATS_TOKEN="$(vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
8-
export CI_STATS_HOST="$(vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"
9+
export CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
10+
export CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"
911

1012
node "$(dirname "${0}")/ci_stats_start.js"

0 commit comments

Comments
 (0)