Skip to content

Commit 868db17

Browse files
authored
Merge branch '9.1' into backport/9.1/pr-235642
2 parents acd1ee9 + 12bc662 commit 868db17

File tree

634 files changed

+15806
-52933
lines changed

Some content is hidden

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

634 files changed

+15806
-52933
lines changed

.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,15 @@ function getEnabledFtrConfigs(patterns?: string[], solutions?: string[]) {
127127

128128
const mappedSolutions = solutions?.map((s) => (s === 'observability' ? 'oblt' : s));
129129
for (const manifestRelPath of ALL_FTR_MANIFEST_REL_PATHS) {
130-
if (mappedSolutions && !mappedSolutions.some((s) => manifestRelPath.includes(`ftr_${s}_`))) {
130+
if (
131+
mappedSolutions &&
132+
!(
133+
mappedSolutions.some((s) => manifestRelPath.includes(`ftr_${s}_`)) ||
134+
// When applying the solution filter, still allow platform tests
135+
manifestRelPath.includes('ftr_platform_') ||
136+
manifestRelPath.includes('ftr_base_')
137+
)
138+
) {
131139
continue;
132140
}
133141
try {
@@ -306,8 +314,16 @@ export async function pickTestGroupRunOrder() {
306314
return patterns;
307315
}
308316

309-
return LIMIT_SOLUTIONS.flatMap((solution: string) =>
310-
patterns.map((p: string) => `x-pack/solutions/${solution}/${p}`)
317+
const platformPatterns = ['src/', 'x-pack/platform/'].flatMap((platformPrefix: string) =>
318+
patterns.map((pattern: string) => `${platformPrefix}${pattern}`)
319+
);
320+
321+
return (
322+
LIMIT_SOLUTIONS.flatMap((solution: string) =>
323+
patterns.map((p: string) => `x-pack/solutions/${solution}/${p}`)
324+
)
325+
// When applying the solution filter, still allow platform tests
326+
.concat(platformPatterns)
311327
);
312328
};
313329

@@ -571,6 +587,15 @@ export async function pickTestGroupRunOrder() {
571587
);
572588
}
573589

590+
// copied from src/platform/packages/shared/kbn-scout/src/config/discovery/search_configs.ts
591+
interface ScoutTestDiscoveryConfig {
592+
group: string;
593+
path: string;
594+
usesParallelWorkers: boolean;
595+
configs: string[];
596+
type: 'plugin' | 'package';
597+
}
598+
574599
export async function pickScoutTestGroupRunOrder(scoutConfigsPath: string) {
575600
const bk = new BuildkiteClient();
576601
const envFromlabels: Record<string, string> = collectEnvFromLabels();
@@ -579,33 +604,37 @@ export async function pickScoutTestGroupRunOrder(scoutConfigsPath: string) {
579604
throw new Error(`Scout configs file not found at ${scoutConfigsPath}`);
580605
}
581606

582-
const rawScoutConfigs = JSON.parse(Fs.readFileSync(scoutConfigsPath, 'utf-8'));
583-
const pluginsWithScoutConfigs: string[] = Object.keys(rawScoutConfigs);
607+
const rawScoutConfigs = JSON.parse(Fs.readFileSync(scoutConfigsPath, 'utf-8')) as Record<
608+
string,
609+
ScoutTestDiscoveryConfig
610+
>;
611+
const pluginsOrPackagesWithScoutTests: string[] = Object.keys(rawScoutConfigs);
584612

585-
if (pluginsWithScoutConfigs.length === 0) {
613+
if (pluginsOrPackagesWithScoutTests.length === 0) {
586614
// no scout configs found, nothing to need to upload steps
587615
return;
588616
}
589617

590-
const scoutGroups = pluginsWithScoutConfigs.map((plugin) => ({
591-
title: plugin,
592-
key: plugin,
593-
usesParallelWorkers: rawScoutConfigs[plugin].usesParallelWorkers,
594-
group: rawScoutConfigs[plugin].group,
618+
const scoutCiRunGroups = pluginsOrPackagesWithScoutTests.map((name) => ({
619+
label: `Scout: [ ${rawScoutConfigs[name].group} / ${name} ] ${rawScoutConfigs[name].type}`,
620+
key: name,
621+
agents: expandAgentQueue(rawScoutConfigs[name].usesParallelWorkers ? 'n2-8-spot' : 'n2-4-spot'),
622+
group: rawScoutConfigs[name].group,
595623
}));
596624

597625
// upload the step definitions to Buildkite
598626
bk.uploadSteps(
599627
[
600628
{
601629
group: 'Scout Configs',
602-
depends_on: ['build'],
603-
steps: scoutGroups.map(
604-
({ title, key, group, usesParallelWorkers }): BuildkiteStep => ({
605-
label: `Scout: [ ${group} / ${title} ] plugin`,
630+
key: 'scout-configs',
631+
depends_on: ['build_scout_tests'],
632+
steps: scoutCiRunGroups.map(
633+
({ label, key, group, agents }): BuildkiteStep => ({
634+
label,
606635
command: getRequiredEnv('SCOUT_CONFIGS_SCRIPT'),
607636
timeout_in_minutes: 60,
608-
agents: expandAgentQueue(usesParallelWorkers ? 'n2-8-spot' : 'n2-4-spot'),
637+
agents,
609638
env: {
610639
SCOUT_CONFIG_GROUP_KEY: key,
611640
SCOUT_CONFIG_GROUP_TYPE: group,

.buildkite/pipelines/chrome_forward_testing.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ steps:
6161
- exit_status: '*'
6262
limit: 1
6363

64+
- command: .buildkite/scripts/steps/test/scout_test_run_builder.sh
65+
label: 'Scout Test Run Builder'
66+
agents:
67+
machineType: n2-standard-4
68+
key: build_scout_tests
69+
timeout_in_minutes: 10
70+
env:
71+
SCOUT_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/scout_configs.sh'
72+
retry:
73+
automatic:
74+
- exit_status: '*'
75+
limit: 1
76+
6477
- command: .buildkite/scripts/steps/functional/security_solution_rule_management.sh
6578
label: 'Rule Management - Security Solution Cypress Tests'
6679
agents:

.buildkite/pipelines/es_snapshots/verify.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ steps:
5656
- exit_status: '*'
5757
limit: 1
5858

59+
- command: .buildkite/scripts/steps/test/scout_test_run_builder.sh
60+
label: 'Scout Test Run Builder'
61+
agents:
62+
image: family/kibana-ubuntu-2404
63+
imageProject: elastic-images-prod
64+
provider: gcp
65+
machineType: n2-standard-4
66+
key: build_scout_tests
67+
timeout_in_minutes: 10
68+
depends_on:
69+
- build
70+
env:
71+
SCOUT_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/scout_configs.sh'
72+
retry:
73+
automatic:
74+
- exit_status: '*'
75+
limit: 1
76+
5977
- command: .buildkite/scripts/steps/es_snapshots/trigger_promote.sh
6078
label: Trigger promotion
6179
timeout_in_minutes: 10

.buildkite/pipelines/flaky_tests/pipeline.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ function getTestSuitesFromJson(json: string) {
8080
}
8181

8282
const type = item.type;
83-
if (type !== 'ftrConfig' && type !== 'group') {
84-
fail(`testSuite.type must be either "ftrConfig" or "group"`);
83+
if (type !== 'ftrConfig' && type !== 'scoutConfig' && type !== 'group') {
84+
fail(`testSuite.type must be either "ftrConfig" or "scoutConfig" or "group"`);
8585
}
8686

8787
if (item.type === 'ftrConfig') {
@@ -98,6 +98,20 @@ function getTestSuitesFromJson(json: string) {
9898
continue;
9999
}
100100

101+
if (item.type === 'scoutConfig') {
102+
const scoutConfig = item.scoutConfig;
103+
if (typeof scoutConfig !== 'string') {
104+
fail(`testSuite.scoutConfig must be a string`);
105+
}
106+
107+
testSuites.push({
108+
type: 'scoutConfig',
109+
scoutConfig,
110+
count,
111+
});
112+
continue;
113+
}
114+
101115
const key = item.key;
102116
if (typeof key !== 'string') {
103117
fail(`testSuite.key must be a string`);
@@ -191,7 +205,7 @@ for (const testSuite of testSuites) {
191205
concurrency_method: 'eager',
192206
agents: expandAgentQueue(usesParallelWorkers ? 'n2-8-spot' : 'n2-4-spot'),
193207
depends_on: 'build',
194-
timeout_in_minutes: 30,
208+
timeout_in_minutes: 60,
195209
cancel_on_build_failing: true,
196210
retry: {
197211
automatic: [{ exit_status: '-1', limit: 3 }],

.buildkite/pipelines/fleet/package_registry.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ steps:
4646
- exit_status: '*'
4747
limit: 1
4848

49+
- command: .buildkite/scripts/steps/test/scout_test_run_builder.sh
50+
label: 'Scout Test Run Builder'
51+
agents:
52+
image: family/kibana-ubuntu-2404
53+
imageProject: elastic-images-prod
54+
provider: gcp
55+
machineType: n2-standard-4
56+
key: build_scout_tests
57+
timeout_in_minutes: 10
58+
env:
59+
SCOUT_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/scout_configs.sh'
60+
retry:
61+
automatic:
62+
- exit_status: '*'
63+
limit: 1
64+
4965
- command: .buildkite/scripts/steps/functional/defend_workflows.sh
5066
label: 'Defend Workflows Cypress Tests'
5167
agents:

.buildkite/pipelines/on_merge.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,25 @@ steps:
178178
- exit_status: '*'
179179
limit: 1
180180

181+
- command: .buildkite/scripts/steps/test/scout_test_run_builder.sh
182+
label: 'Scout Test Run Builder'
183+
agents:
184+
image: family/kibana-ubuntu-2404
185+
imageProject: elastic-images-prod
186+
provider: gcp
187+
machineType: n2-standard-4
188+
diskSizeGb: 85
189+
key: build_scout_tests
190+
timeout_in_minutes: 10
191+
depends_on:
192+
- build
193+
env:
194+
SCOUT_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/scout_configs.sh'
195+
retry:
196+
automatic:
197+
- exit_status: '*'
198+
limit: 1
199+
181200
- command: .buildkite/scripts/steps/functional/security_solution_rule_management.sh
182201
label: 'Rule Management - Security Solution Cypress Tests'
183202
agents:

.buildkite/pipelines/on_merge_unsupported_ftrs.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,3 @@ steps:
4848
limit: 3
4949
- exit_status: '*'
5050
limit: 1
51-
52-
- command: .buildkite/scripts/steps/test/scout_test_run_builder.sh
53-
label: 'Scout Test Run Builder'
54-
agents:
55-
image: family/kibana-ubuntu-2404
56-
imageProject: elastic-images-prod
57-
provider: gcp
58-
machineType: n2-standard-2
59-
preemptible: true
60-
depends_on: build
61-
timeout_in_minutes: 10
62-
env:
63-
SCOUT_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/scout_configs.sh'
64-
PING_SLACK_TEAM: "@appex-qa-team"
65-
retry:
66-
automatic:
67-
- exit_status: 10
68-
limit: 0
69-
- exit_status: '*'
70-
limit: 1

.buildkite/pipelines/pointer_compression.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ steps:
4949
- exit_status: '*'
5050
limit: 1
5151

52+
- command: .buildkite/scripts/steps/test/scout_test_run_builder.sh
53+
label: 'Scout Test Run Builder'
54+
agents:
55+
image: family/kibana-ubuntu-2404
56+
imageProject: elastic-images-prod
57+
provider: gcp
58+
machineType: n2-standard-4
59+
key: build_scout_tests
60+
timeout_in_minutes: 10
61+
depends_on:
62+
- build
63+
env:
64+
SCOUT_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/scout_configs.sh'
65+
retry:
66+
automatic:
67+
- exit_status: '*'
68+
limit: 1
69+
5270
- command: .buildkite/scripts/steps/functional/security_serverless_rule_management.sh
5371
label: 'Serverless Rule Management - Security Solution Cypress Tests'
5472
agents:

.buildkite/pipelines/pull_request/scout_tests.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ steps:
22
- command: .buildkite/scripts/steps/test/scout_test_run_builder.sh
33
label: 'Scout Test Run Builder'
44
agents:
5-
machineType: n2-standard-2
5+
machineType: n2-standard-4
6+
key: build_scout_tests
67
timeout_in_minutes: 10
8+
depends_on:
9+
- build
10+
- quick_checks
11+
- checks
12+
- linting
13+
- linting_with_types
14+
- check_types
15+
- check_oas_snapshot
716
env:
817
SCOUT_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/scout_configs.sh'
918
retry:
1019
automatic:
11-
# No retry when Scout configs fail
12-
- exit_status: 10
13-
limit: 0
1420
- exit_status: '*'
1521
limit: 1

.buildkite/scout_ci_config.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Define which plugins should be run or skipped in Scout CI pipeline
2-
ui_tests:
1+
# Define which plugins and packages should be run or skipped in Kibana CI pipeline
2+
plugins:
33
enabled:
44
- apm
55
- discover_enhanced
@@ -9,3 +9,7 @@ ui_tests:
99
- security_solution
1010
- streams_app
1111
disabled:
12+
13+
packages:
14+
enabled:
15+
disabled:

0 commit comments

Comments
 (0)