Skip to content

Commit 57bb81c

Browse files
committed
Merge remote-tracking branch 'upstream/master' into kertal-pr-2019-12-12-discover-table-header-wrap
2 parents f04a7ef + 4571536 commit 57bb81c

File tree

33,388 files changed

+1743007
-1085322
lines changed

Some content is hidden

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

33,388 files changed

+1743007
-1085322
lines changed

.backportrc.json

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
{
22
"upstream": "elastic/kibana",
3-
"branches": [{ "name": "7.x", "checked": true }, "7.5", "7.4", "7.3", "7.2", "7.1", "7.0", "6.8", "6.7", "6.6", "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
4-
"labels": ["backport"]
3+
"targetBranchChoices": [
4+
{ "name": "master", "checked": true },
5+
{ "name": "7.x", "checked": true },
6+
"7.8",
7+
"7.7",
8+
"7.6",
9+
"7.5",
10+
"7.4",
11+
"7.3",
12+
"7.2",
13+
"7.1",
14+
"7.0",
15+
"6.8",
16+
"6.7",
17+
"6.6",
18+
"6.5",
19+
"6.4",
20+
"6.3",
21+
"6.2",
22+
"6.1",
23+
"6.0",
24+
"5.6"
25+
],
26+
"targetPRLabels": ["backport"],
27+
"branchLabelMapping": {
28+
"^v7.8.0$": "7.x",
29+
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
30+
}
531
}

.browserslistrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[production]
12
last 2 versions
23
> 5%
34
Safari 7 # for PhantomJS support: https://github.com/elastic/kibana/issues/27136
5+
6+
[dev]
7+
last 1 chrome versions
8+
last 1 firefox versions
9+
last 1 safari versions

.ci/Jenkinsfile_coverage

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load() // load from the Jenkins instance
5+
6+
kibanaPipeline(timeoutMinutes: 240) {
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': {
14+
withEnv([
15+
'NODE_ENV=test' // Needed for jest tests only
16+
]) {
17+
workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
18+
}
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', size: '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')
89+
}
90+
}
91+
}
92+
kibanaPipeline.sendMail()
93+
}

.ci/Jenkinsfile_flaky

Lines changed: 38 additions & 45 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_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

@@ -99,16 +93,15 @@ def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWor
9993
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkerProcesses)
10094

10195
for(def i = 1; i <= numberOfWorkers; i++) {
102-
def workerExecutions = numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0)
96+
def workerExecutions = floor(numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0))
10397

10498
workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber ->
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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load()
5+
6+
kibanaPipeline(timeoutMinutes: 120) {
7+
catchError {
8+
parallel([
9+
'oss-visualRegression': {
10+
workers.ci(name: 'oss-visualRegression', size: 's', ramDisk: false) {
11+
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1)
12+
}
13+
},
14+
'xpack-visualRegression': {
15+
workers.ci(name: 'xpack-visualRegression', size: 's', ramDisk: false) {
16+
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1)
17+
}
18+
},
19+
])
20+
}
21+
22+
kibanaPipeline.sendMail()
23+
}

.ci/end2end.groovy

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pipeline {
1313
BASE_DIR = 'src/github.com/elastic/kibana'
1414
HOME = "${env.WORKSPACE}"
1515
APM_ITS = 'apm-integration-testing'
16-
CYPRESS_DIR = 'x-pack/legacy/plugins/apm/cypress'
16+
CYPRESS_DIR = 'x-pack/plugins/apm/e2e'
1717
PIPELINE_LOG_LEVEL = 'DEBUG'
1818
}
1919
options {
@@ -25,7 +25,7 @@ pipeline {
2525
durabilityHint('PERFORMANCE_OPTIMIZED')
2626
}
2727
triggers {
28-
issueCommentTrigger('(?i).*jenkins\\W+run\\W+(?:the\\W+)?e2e(?:\\W+please)?.*')
28+
issueCommentTrigger('(?i)(retest|.*jenkins\\W+run\\W+(?:the\\W+)?e2e?.*)')
2929
}
3030
parameters {
3131
booleanParam(name: 'FORCE', defaultValue: false, description: 'Whether to force the run.')
@@ -39,7 +39,7 @@ pipeline {
3939
shallow: false, reference: "/var/lib/jenkins/.git-references/kibana.git")
4040
script {
4141
dir("${BASE_DIR}"){
42-
def regexps =[ "^x-pack/legacy/plugins/apm/.*" ]
42+
def regexps =[ "^x-pack/plugins/apm/.*" ]
4343
env.APM_UPDATED = isGitRegionMatch(patterns: regexps)
4444
}
4545
}
@@ -60,8 +60,14 @@ pipeline {
6060
}
6161
}
6262
steps {
63+
notifyStatus('Starting services', 'PENDING')
6364
dir("${APM_ITS}"){
64-
sh './scripts/compose.py start master --no-kibana --no-xpack-secure'
65+
sh './scripts/compose.py start master --no-kibana'
66+
}
67+
}
68+
post {
69+
unsuccessful {
70+
notifyStatus('Environmental issue', 'FAILURE')
6571
}
6672
}
6773
}
@@ -77,10 +83,16 @@ pipeline {
7783
JENKINS_NODE_COOKIE = 'dontKillMe'
7884
}
7985
steps {
86+
notifyStatus('Preparing kibana', 'PENDING')
8087
dir("${BASE_DIR}"){
8188
sh script: "${CYPRESS_DIR}/ci/prepare-kibana.sh"
8289
}
8390
}
91+
post {
92+
unsuccessful {
93+
notifyStatus('Kibana warm up failed', 'FAILURE')
94+
}
95+
}
8496
}
8597
stage('Smoke Tests'){
8698
options { skipDefaultCheckout() }
@@ -91,10 +103,11 @@ pipeline {
91103
}
92104
}
93105
steps{
106+
notifyStatus('Running smoke tests', 'PENDING')
94107
dir("${BASE_DIR}"){
95108
sh '''
96109
jobs -l
97-
docker build --tag cypress ${CYPRESS_DIR}/ci
110+
docker build --tag cypress --build-arg NODE_VERSION=$(cat .node-version) ${CYPRESS_DIR}/ci
98111
docker run --rm -t --user "$(id -u):$(id -g)" \
99112
-v `pwd`:/app --network="host" \
100113
--name cypress cypress'''
@@ -103,15 +116,21 @@ pipeline {
103116
post {
104117
always {
105118
dir("${BASE_DIR}"){
106-
archiveArtifacts(allowEmptyArchive: false, artifacts: "${CYPRESS_DIR}/screenshots/**,${CYPRESS_DIR}/videos/**,${CYPRESS_DIR}/*e2e-tests.xml")
107-
junit(allowEmptyResults: true, testResults: "${CYPRESS_DIR}/*e2e-tests.xml")
119+
archiveArtifacts(allowEmptyArchive: false, artifacts: "${CYPRESS_DIR}/**/screenshots/**,${CYPRESS_DIR}/**/videos/**,${CYPRESS_DIR}/**/test-results/*e2e-tests.xml")
120+
junit(allowEmptyResults: true, testResults: "${CYPRESS_DIR}/**/test-results/*e2e-tests.xml")
108121
}
109122
dir("${APM_ITS}"){
110123
sh 'docker-compose logs > apm-its.log || true'
111124
sh 'docker-compose down -v || true'
112125
archiveArtifacts(allowEmptyArchive: false, artifacts: 'apm-its.log')
113126
}
114127
}
128+
unsuccessful {
129+
notifyStatus('Test failures', 'FAILURE')
130+
}
131+
success {
132+
notifyStatus('Tests passed', 'SUCCESS')
133+
}
115134
}
116135
}
117136
}
@@ -123,3 +142,7 @@ pipeline {
123142
}
124143
}
125144
}
145+
146+
def notifyStatus(String description, String status) {
147+
withGithubNotify.notify('end2end-for-apm-ui', description, status, getBlueoceanDisplayURL())
148+
}

0 commit comments

Comments
 (0)