Skip to content

Commit 7fbc71b

Browse files
Merge branch 'master' into fix/spriteloading
2 parents 46787ed + 5a8fabd commit 7fbc71b

File tree

4,365 files changed

+183330
-160492
lines changed

Some content is hidden

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

4,365 files changed

+183330
-160492
lines changed

.ci/Jenkinsfile_flaky

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load()
5+
6+
// Looks like 'oss:ciGroup:1' or 'oss:firefoxSmoke'
7+
def JOB_PARTS = params.CI_GROUP.split(':')
8+
def IS_XPACK = JOB_PARTS[0] == 'xpack'
9+
def JOB = JOB_PARTS[1]
10+
def CI_GROUP = JOB_PARTS.size() > 2 ? JOB_PARTS[2] : ''
11+
def EXECUTIONS = params.NUMBER_EXECUTIONS.toInteger()
12+
def AGENT_COUNT = getAgentCount(EXECUTIONS)
13+
14+
def worker = getWorkerFromParams(IS_XPACK, JOB, CI_GROUP)
15+
16+
def workerFailures = []
17+
18+
currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
19+
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"
20+
21+
stage("Kibana Pipeline") {
22+
timeout(time: 180, unit: 'MINUTES') {
23+
timestamps {
24+
ansiColor('xterm') {
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+
catchError {
31+
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
32+
33+
kibanaPipeline.withWorkers('flaky-test-runner', {
34+
if (!IS_XPACK) {
35+
kibanaPipeline.buildOss()
36+
if (CI_GROUP == '1') {
37+
runbld "./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh"
38+
}
39+
} else {
40+
kibanaPipeline.buildXpack()
41+
}
42+
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
43+
}
44+
}
45+
}
46+
47+
parallel(agents)
48+
49+
currentBuild.description += ", Failures: ${workerFailures.size()}"
50+
51+
if (workerFailures.size() > 0) {
52+
print "There were ${workerFailures.size()} test suite failures."
53+
print "The executions that failed were:"
54+
print workerFailures.join("\n")
55+
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
56+
}
57+
}
58+
}
59+
}
60+
}
61+
62+
def getWorkerFromParams(isXpack, job, ciGroup) {
63+
if (!isXpack) {
64+
if (job == 'firefoxSmoke') {
65+
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld './test/scripts/jenkins_firefox_smoke.sh' })
66+
} else if(job == 'visualRegression') {
67+
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld './test/scripts/jenkins_visual_regression.sh' })
68+
} else {
69+
return kibanaPipeline.getOssCiGroupWorker(ciGroup)
70+
}
71+
}
72+
73+
if (job == 'firefoxSmoke') {
74+
return kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld './test/scripts/jenkins_xpack_firefox_smoke.sh' })
75+
} else if(job == 'visualRegression') {
76+
return kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld './test/scripts/jenkins_xpack_visual_regression.sh' })
77+
} else {
78+
return kibanaPipeline.getXpackCiGroupWorker(ciGroup)
79+
}
80+
}
81+
82+
def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWorkerProcesses = 12) {
83+
def workerMap = [:]
84+
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkerProcesses)
85+
86+
for(def i = 1; i <= numberOfWorkers; i++) {
87+
def workerExecutions = numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0)
88+
89+
workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber ->
90+
for(def j = 0; j < workerExecutions; j++) {
91+
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
92+
withEnv([
93+
"JOB=agent-${agentNumber}-worker-${workerNumber}-${j}",
94+
"REMOVE_KIBANA_INSTALL_DIR=1",
95+
]) {
96+
catchError {
97+
try {
98+
worker(workerNumber)
99+
} catch (ex) {
100+
workerFailures << "agent-${agentNumber} worker-${workerNumber}-${j}"
101+
throw ex
102+
}
103+
}
104+
}
105+
}
106+
}
107+
}
108+
109+
return workerMap
110+
}
111+
112+
def getAgentCount(executions) {
113+
// Increase agent count every 24 worker processess, up to 3 agents maximum
114+
return Math.min(3, 1 + floor(executions/24))
115+
}
116+
117+
def trunc(str, length) {
118+
if (str.size() >= length) {
119+
return str.take(length) + "..."
120+
}
121+
122+
return str;
123+
}
124+
125+
// All of the real rounding/truncating methods are sandboxed
126+
def floor(num) {
127+
return num
128+
.toString()
129+
.split('\\.')[0]
130+
.toInteger()
131+
}

.ci/jobs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ JOB:
1414
- kibana-ciGroup10
1515
- kibana-ciGroup11
1616
- kibana-ciGroup12
17-
# - kibana-visualRegression
17+
- kibana-accessibility
18+
- kibana-visualRegression
1819

1920
# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
2021
- x-pack-firefoxSmoke
@@ -28,7 +29,8 @@ JOB:
2829
- x-pack-ciGroup8
2930
- x-pack-ciGroup9
3031
- x-pack-ciGroup10
31-
# - x-pack-visualRegression
32+
- x-pack-accessibility
33+
- x-pack-visualRegression
3234

3335
# `~` is yaml for `null`
3436
exclude: ~

.ci/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ kibana-ciGroup*)
2121
kibana-visualRegression*)
2222
./test/scripts/jenkins_visual_regression.sh
2323
;;
24+
kibana-accessibility*)
25+
./test/scripts/jenkins_accessibility.sh
26+
;;
2427
kibana-firefoxSmoke*)
2528
./test/scripts/jenkins_firefox_smoke.sh
2629
;;
@@ -34,6 +37,9 @@ x-pack-ciGroup*)
3437
x-pack-visualRegression*)
3538
./test/scripts/jenkins_xpack_visual_regression.sh
3639
;;
40+
x-pack-accessibility*)
41+
./test/scripts/jenkins_xpack_accessibility.sh
42+
;;
3743
x-pack-firefoxSmoke*)
3844
./test/scripts/jenkins_xpack_firefox_smoke.sh
3945
;;

.eslintrc.js

Lines changed: 190 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,193 @@ module.exports = {
5555
extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'],
5656

5757
overrides: [
58+
/**
59+
* Temporarily disable some react rules for specific plugins, remove in separate PRs
60+
*/
61+
{
62+
files: ['packages/kbn-ui-framework/**/*.{js,ts,tsx}'],
63+
rules: {
64+
'jsx-a11y/no-onchange': 'off',
65+
},
66+
},
67+
{
68+
files: ['src/core/public/application/**/*.{js,ts,tsx}'],
69+
rules: {
70+
'react/no-danger': 'off',
71+
},
72+
},
73+
{
74+
files: ['src/legacy/core_plugins/console/**/*.{js,ts,tsx}'],
75+
rules: {
76+
'react-hooks/exhaustive-deps': 'off',
77+
},
78+
},
79+
{
80+
files: ['src/legacy/core_plugins/data/**/*.{js,ts,tsx}'],
81+
rules: {
82+
'react-hooks/exhaustive-deps': 'off',
83+
},
84+
},
85+
{
86+
files: ['src/legacy/core_plugins/expressions/**/*.{js,ts,tsx}'],
87+
rules: {
88+
'react-hooks/exhaustive-deps': 'off',
89+
},
90+
},
91+
{
92+
files: ['src/legacy/core_plugins/kbn_vislib_vis_types/**/*.{js,ts,tsx}'],
93+
rules: {
94+
'react-hooks/exhaustive-deps': 'off',
95+
},
96+
},
97+
{
98+
files: ['src/legacy/core_plugins/kibana/**/*.{js,ts,tsx}'],
99+
rules: {
100+
'react-hooks/rules-of-hooks': 'off',
101+
'react-hooks/exhaustive-deps': 'off',
102+
},
103+
},
104+
{
105+
files: ['src/legacy/core_plugins/tile_map/**/*.{js,ts,tsx}'],
106+
rules: {
107+
'react-hooks/exhaustive-deps': 'off',
108+
},
109+
},
110+
{
111+
files: ['src/legacy/core_plugins/vis_type_markdown/**/*.{js,ts,tsx}'],
112+
rules: {
113+
'react-hooks/exhaustive-deps': 'off',
114+
},
115+
},
116+
{
117+
files: ['src/legacy/core_plugins/vis_type_metric/**/*.{js,ts,tsx}'],
118+
rules: {
119+
'jsx-a11y/click-events-have-key-events': 'off',
120+
},
121+
},
122+
{
123+
files: ['src/legacy/core_plugins/vis_type_table/**/*.{js,ts,tsx}'],
124+
rules: {
125+
'react-hooks/exhaustive-deps': 'off',
126+
},
127+
},
128+
{
129+
files: ['src/legacy/core_plugins/vis_type_vega/**/*.{js,ts,tsx}'],
130+
rules: {
131+
'react-hooks/exhaustive-deps': 'off',
132+
},
133+
},
134+
{
135+
files: ['src/legacy/ui/public/vis/**/*.{js,ts,tsx}'],
136+
rules: {
137+
'react-hooks/exhaustive-deps': 'off',
138+
},
139+
},
140+
{
141+
files: ['src/plugins/es_ui_shared/**/*.{js,ts,tsx}'],
142+
rules: {
143+
'react-hooks/exhaustive-deps': 'off',
144+
},
145+
},
146+
{
147+
files: ['src/plugins/eui_utils/**/*.{js,ts,tsx}'],
148+
rules: {
149+
'react-hooks/exhaustive-deps': 'off',
150+
},
151+
},
152+
{
153+
files: ['src/plugins/kibana_react/**/*.{js,ts,tsx}'],
154+
rules: {
155+
'react-hooks/rules-of-hooks': 'off',
156+
'react-hooks/exhaustive-deps': 'off',
157+
},
158+
},
159+
{
160+
files: ['src/plugins/kibana_utils/**/*.{js,ts,tsx}'],
161+
rules: {
162+
'react-hooks/exhaustive-deps': 'off',
163+
},
164+
},
165+
{
166+
files: ['x-pack/legacy/plugins/canvas/**/*.{js,ts,tsx}'],
167+
rules: {
168+
'react-hooks/exhaustive-deps': 'off',
169+
'jsx-a11y/click-events-have-key-events': 'off',
170+
},
171+
},
172+
{
173+
files: ['x-pack/legacy/plugins/cross_cluster_replication/**/*.{js,ts,tsx}'],
174+
rules: {
175+
'jsx-a11y/click-events-have-key-events': 'off',
176+
},
177+
},
178+
{
179+
files: ['x-pack/legacy/plugins/graph/**/*.{js,ts,tsx}'],
180+
rules: {
181+
'react-hooks/exhaustive-deps': 'off',
182+
},
183+
},
184+
{
185+
files: ['x-pack/legacy/plugins/index_management/**/*.{js,ts,tsx}'],
186+
rules: {
187+
'react-hooks/exhaustive-deps': 'off',
188+
'react-hooks/rules-of-hooks': 'off',
189+
},
190+
},
191+
{
192+
files: ['x-pack/legacy/plugins/infra/**/*.{js,ts,tsx}'],
193+
rules: {
194+
'react-hooks/exhaustive-deps': 'off',
195+
'react-hooks/rules-of-hooks': 'off',
196+
},
197+
},
198+
{
199+
files: ['x-pack/legacy/plugins/lens/**/*.{js,ts,tsx}'],
200+
rules: {
201+
'react-hooks/exhaustive-deps': 'off',
202+
'react-hooks/rules-of-hooks': 'off',
203+
},
204+
},
205+
{
206+
files: ['x-pack/legacy/plugins/ml/**/*.{js,ts,tsx}'],
207+
rules: {
208+
'react-hooks/exhaustive-deps': 'off',
209+
},
210+
},
211+
{
212+
files: ['x-pack/legacy/plugins/monitoring/**/*.{js,ts,tsx}'],
213+
rules: {
214+
'jsx-a11y/click-events-have-key-events': 'off',
215+
},
216+
},
217+
{
218+
files: ['x-pack/legacy/plugins/siem/**/*.{js,ts,tsx}'],
219+
rules: {
220+
'react-hooks/exhaustive-deps': 'off',
221+
'react-hooks/rules-of-hooks': 'off',
222+
},
223+
},
224+
{
225+
files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}'],
226+
rules: {
227+
'react-hooks/exhaustive-deps': 'off',
228+
},
229+
},
230+
{
231+
files: ['x-pack/legacy/plugins/uptime/**/*.{js,ts,tsx}'],
232+
rules: {
233+
'react-hooks/exhaustive-deps': 'off',
234+
'react-hooks/rules-of-hooks': 'off',
235+
},
236+
},
237+
{
238+
files: ['x-pack/legacy/plugins/watcher/**/*.{js,ts,tsx}'],
239+
rules: {
240+
'react-hooks/rules-of-hooks': 'off',
241+
'react-hooks/exhaustive-deps': 'off',
242+
},
243+
},
244+
58245
/**
59246
* Prettier
60247
*/
@@ -175,10 +362,10 @@ module.exports = {
175362
'!src/core/server/*.test.mocks.ts',
176363

177364
'src/plugins/**/public/**/*',
178-
'!src/plugins/**/public/index*',
365+
'!src/plugins/**/public/index.{js,ts,tsx}',
179366

180367
'src/plugins/**/server/**/*',
181-
'!src/plugins/**/server/index*',
368+
'!src/plugins/**/server/index.{js,ts,tsx}',
182369
],
183370
allowSameFolder: true,
184371
},
@@ -213,6 +400,7 @@ module.exports = {
213400
'x-pack/test/functional/apps/**/*.js',
214401
'x-pack/legacy/plugins/apm/**/*.js',
215402
'test/*/config.ts',
403+
'test/*/{tests,test_suites,apis,apps}/**/*',
216404
'test/visual_regression/tests/**/*',
217405
'x-pack/test/*/{tests,test_suites,apis,apps}/**/*',
218406
'x-pack/test/*/*config.*ts',

0 commit comments

Comments
 (0)