Skip to content

Commit a25cf30

Browse files
committed
Merge branch 'master' into dynamic-action
2 parents 55b8721 + 455b2f5 commit a25cf30

File tree

2,158 files changed

+99500
-44265
lines changed

Some content is hidden

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

2,158 files changed

+99500
-44265
lines changed

.ci/Jenkinsfile_coverage

Lines changed: 81 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -3,99 +3,91 @@
33
library 'kibana-pipeline-library'
44
kibanaLibrary.load() // load from the Jenkins instance
55

6-
stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a little bit
7-
timeout(time: 180, unit: 'MINUTES') {
8-
timestamps {
9-
ansiColor('xterm') {
10-
catchError {
6+
kibanaPipeline(timeoutMinutes: 180) {
7+
catchErrors {
8+
withEnv([
9+
'CODE_COVERAGE=1', // Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
10+
]) {
11+
parallel([
12+
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
13+
'x-pack-intake-agent': {
1114
withEnv([
12-
'CODE_COVERAGE=1', // Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
15+
'NODE_ENV=test' // Needed for jest tests only
1316
]) {
14-
parallel([
15-
'kibana-intake-agent': {
16-
kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh')()
17-
},
18-
'x-pack-intake-agent': {
19-
withEnv([
20-
'NODE_ENV=test' // Needed for jest tests only
21-
]) {
22-
kibanaPipeline.intakeWorker('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
23-
}
24-
},
25-
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
26-
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
27-
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
28-
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
29-
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
30-
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
31-
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
32-
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
33-
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
34-
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
35-
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
36-
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
37-
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
38-
]),
39-
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
40-
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
41-
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
42-
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
43-
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
44-
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
45-
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
46-
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
47-
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
48-
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
49-
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
50-
]),
51-
])
52-
kibanaPipeline.jobRunner('tests-l', false) {
53-
kibanaPipeline.downloadCoverageArtifacts()
54-
kibanaPipeline.bash(
55-
'''
56-
# bootstrap from x-pack folder
57-
source src/dev/ci_setup/setup_env.sh
58-
cd x-pack
59-
yarn kbn bootstrap --prefer-offline
60-
cd ..
61-
# extract archives
62-
mkdir -p /tmp/extracted_coverage
63-
echo extracting intakes
64-
tar -xzf /tmp/downloaded_coverage/coverage/kibana-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
65-
tar -xzf /tmp/downloaded_coverage/coverage/x-pack-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
66-
echo extracting kibana-oss-tests
67-
tar -xzf /tmp/downloaded_coverage/coverage/kibana-oss-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
68-
echo extracting kibana-xpack-tests
69-
tar -xzf /tmp/downloaded_coverage/coverage/kibana-xpack-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
70-
# replace path in json files to have valid html report
71-
pwd=$(pwd)
72-
du -sh /tmp/extracted_coverage/target/kibana-coverage/
73-
echo replacing path in json files
74-
for i in {1..9}; do
75-
sed -i "s|/dev/shm/workspace/kibana|$pwd|g" /tmp/extracted_coverage/target/kibana-coverage/functional/${i}*.json &
76-
done
77-
wait
78-
# merge oss & x-pack reports
79-
echo merging coverage reports
80-
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/jest --report-dir target/kibana-coverage/jest-combined --reporter=html --reporter=json-summary
81-
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/functional --report-dir target/kibana-coverage/functional-combined --reporter=html --reporter=json-summary
82-
echo copy mocha reports
83-
mkdir -p target/kibana-coverage/mocha-combined
84-
cp -r /tmp/extracted_coverage/target/kibana-coverage/mocha target/kibana-coverage/mocha-combined
85-
''',
86-
"run `yarn kbn bootstrap && merge coverage`"
87-
)
88-
sh 'tar -czf kibana-jest-coverage.tar.gz target/kibana-coverage/jest-combined/*'
89-
kibanaPipeline.uploadCoverageArtifacts("coverage/jest-combined", 'kibana-jest-coverage.tar.gz')
90-
sh 'tar -czf kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined/*'
91-
kibanaPipeline.uploadCoverageArtifacts("coverage/functional-combined", 'kibana-functional-coverage.tar.gz')
92-
sh 'tar -czf kibana-mocha-coverage.tar.gz target/kibana-coverage/mocha-combined/*'
93-
kibanaPipeline.uploadCoverageArtifacts("coverage/mocha-combined", 'kibana-mocha-coverage.tar.gz')
94-
}
17+
workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
9518
}
96-
}
97-
kibanaPipeline.sendMail()
19+
},
20+
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
21+
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
22+
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
23+
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
24+
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
25+
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
26+
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
27+
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
28+
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
29+
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
30+
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
31+
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
32+
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
33+
]),
34+
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
35+
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
36+
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
37+
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
38+
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
39+
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
40+
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
41+
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
42+
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
43+
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
44+
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
45+
]),
46+
])
47+
workers.base(name: 'coverage-worker', label: 'tests-l', ramDisk: false, bootstrapped: false) {
48+
kibanaPipeline.downloadCoverageArtifacts()
49+
kibanaPipeline.bash(
50+
'''
51+
# bootstrap from x-pack folder
52+
source src/dev/ci_setup/setup_env.sh
53+
cd x-pack
54+
yarn kbn bootstrap --prefer-offline
55+
cd ..
56+
# extract archives
57+
mkdir -p /tmp/extracted_coverage
58+
echo extracting intakes
59+
tar -xzf /tmp/downloaded_coverage/coverage/kibana-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
60+
tar -xzf /tmp/downloaded_coverage/coverage/x-pack-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
61+
echo extracting kibana-oss-tests
62+
tar -xzf /tmp/downloaded_coverage/coverage/kibana-oss-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
63+
echo extracting kibana-xpack-tests
64+
tar -xzf /tmp/downloaded_coverage/coverage/kibana-xpack-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
65+
# replace path in json files to have valid html report
66+
pwd=$(pwd)
67+
du -sh /tmp/extracted_coverage/target/kibana-coverage/
68+
echo replacing path in json files
69+
for i in {1..9}; do
70+
sed -i "s|/dev/shm/workspace/kibana|$pwd|g" /tmp/extracted_coverage/target/kibana-coverage/functional/${i}*.json &
71+
done
72+
wait
73+
# merge oss & x-pack reports
74+
echo merging coverage reports
75+
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/jest --report-dir target/kibana-coverage/jest-combined --reporter=html --reporter=json-summary
76+
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/functional --report-dir target/kibana-coverage/functional-combined --reporter=html --reporter=json-summary
77+
echo copy mocha reports
78+
mkdir -p target/kibana-coverage/mocha-combined
79+
cp -r /tmp/extracted_coverage/target/kibana-coverage/mocha target/kibana-coverage/mocha-combined
80+
''',
81+
"run `yarn kbn bootstrap && merge coverage`"
82+
)
83+
sh 'tar -czf kibana-jest-coverage.tar.gz target/kibana-coverage/jest-combined/*'
84+
kibanaPipeline.uploadCoverageArtifacts("coverage/jest-combined", 'kibana-jest-coverage.tar.gz')
85+
sh 'tar -czf kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined/*'
86+
kibanaPipeline.uploadCoverageArtifacts("coverage/functional-combined", 'kibana-functional-coverage.tar.gz')
87+
sh 'tar -czf kibana-mocha-coverage.tar.gz target/kibana-coverage/mocha-combined/*'
88+
kibanaPipeline.uploadCoverageArtifacts("coverage/mocha-combined", 'kibana-mocha-coverage.tar.gz')
9889
}
9990
}
10091
}
92+
kibanaPipeline.sendMail()
10193
}

.ci/Jenkinsfile_flaky

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,53 +21,47 @@ def workerFailures = []
2121
currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
2222
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"
2323

24-
stage("Kibana Pipeline") {
25-
timeout(time: 180, unit: 'MINUTES') {
26-
timestamps {
27-
ansiColor('xterm') {
28-
def agents = [:]
29-
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
30-
def agentNumberInside = agentNumber
31-
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
32-
agents["agent-${agentNumber}"] = {
33-
catchError {
34-
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
35-
36-
kibanaPipeline.withWorkers('flaky-test-runner', {
37-
if (NEED_BUILD) {
38-
if (!IS_XPACK) {
39-
kibanaPipeline.buildOss()
40-
if (CI_GROUP == '1') {
41-
runbld("./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
42-
}
43-
} else {
44-
kibanaPipeline.buildXpack()
45-
}
46-
}
47-
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
24+
kibanaPipeline(timeoutMinutes: 180) {
25+
def agents = [:]
26+
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
27+
def agentNumberInside = agentNumber
28+
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
29+
agents["agent-${agentNumber}"] = {
30+
catchErrors {
31+
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
32+
33+
workers.functional('flaky-test-runner', {
34+
if (NEED_BUILD) {
35+
if (!IS_XPACK) {
36+
kibanaPipeline.buildOss()
37+
if (CI_GROUP == '1') {
38+
runbld("./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
39+
}
40+
} else {
41+
kibanaPipeline.buildXpack()
4842
}
4943
}
50-
}
44+
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
45+
}
46+
}
47+
}
5148

52-
parallel(agents)
49+
parallel(agents)
5350

54-
currentBuild.description += ", Failures: ${workerFailures.size()}"
51+
currentBuild.description += ", Failures: ${workerFailures.size()}"
5552

56-
if (workerFailures.size() > 0) {
57-
print "There were ${workerFailures.size()} test suite failures."
58-
print "The executions that failed were:"
59-
print workerFailures.join("\n")
60-
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
61-
}
62-
}
63-
}
53+
if (workerFailures.size() > 0) {
54+
print "There were ${workerFailures.size()} test suite failures."
55+
print "The executions that failed were:"
56+
print workerFailures.join("\n")
57+
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
6458
}
6559
}
6660

6761
def getWorkerFromParams(isXpack, job, ciGroup) {
6862
if (!isXpack) {
6963
if (job == 'serverMocha') {
70-
return kibanaPipeline.getPostBuildWorker('serverMocha', {
64+
return kibanaPipeline.functionalTestProcess('serverMocha', {
7165
kibanaPipeline.bash(
7266
"""
7367
source src/dev/ci_setup/setup_env.sh
@@ -77,20 +71,20 @@ def getWorkerFromParams(isXpack, job, ciGroup) {
7771
)
7872
})
7973
} else if (job == 'firefoxSmoke') {
80-
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') })
74+
return kibanaPipeline.functionalTestProcess('firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh')
8175
} else if(job == 'visualRegression') {
82-
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') })
76+
return kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh')
8377
} else {
84-
return kibanaPipeline.getOssCiGroupWorker(ciGroup)
78+
return kibanaPipeline.ossCiGroupProcess(ciGroup)
8579
}
8680
}
8781

8882
if (job == 'firefoxSmoke') {
89-
return kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') })
83+
return kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh')
9084
} else if(job == 'visualRegression') {
91-
return kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') })
85+
return kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
9286
} else {
93-
return kibanaPipeline.getXpackCiGroupWorker(ciGroup)
87+
return kibanaPipeline.xpackCiGroupProcess(ciGroup)
9488
}
9589
}
9690

@@ -105,10 +99,9 @@ def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWor
10599
for(def j = 0; j < workerExecutions; j++) {
106100
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
107101
withEnv([
108-
"JOB=agent-${agentNumber}-worker-${workerNumber}-${j}",
109102
"REMOVE_KIBANA_INSTALL_DIR=1",
110103
]) {
111-
catchError {
104+
catchErrors {
112105
try {
113106
worker(workerNumber)
114107
} catch (ex) {

.ci/Jenkinsfile_visual_baseline

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load()
5+
6+
kibanaPipeline(timeoutMinutes: 120) {
7+
catchError {
8+
parallel([
9+
workers.base(name: 'oss-visualRegression', label: 'linux && immutable') {
10+
kibanaPipeline.buildOss()
11+
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')
12+
},
13+
workers.base(name: 'xpack-visualRegression', label: 'linux && immutable') {
14+
kibanaPipeline.buildXpack()
15+
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
16+
},
17+
])
18+
}
19+
20+
kibanaPipeline.sendMail()
21+
}

.ci/es-snapshots/Jenkinsfile_build_es

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ timeout(time: 120, unit: 'MINUTES') {
2626
timestamps {
2727
ansiColor('xterm') {
2828
node('linux && immutable') {
29-
catchError {
29+
catchErrors {
3030
def VERSION
3131
def SNAPSHOT_ID
3232
def DESTINATION

0 commit comments

Comments
 (0)