mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[CI] Backport flaky test runner changes (#73500)
This commit is contained in:
parent
e01d1672ac
commit
0a539776a9
1 changed files with 54 additions and 42 deletions
|
@ -3,10 +3,13 @@
|
|||
library 'kibana-pipeline-library'
|
||||
kibanaLibrary.load()
|
||||
|
||||
// Looks like 'oss:ciGroup:1' or 'oss:firefoxSmoke'
|
||||
def JOB_PARTS = params.CI_GROUP.split(':')
|
||||
def CI_GROUP_PARAM = params.CI_GROUP
|
||||
|
||||
// Looks like 'oss:ciGroup:1', 'oss:firefoxSmoke', or 'all:serverMocha'
|
||||
def JOB_PARTS = CI_GROUP_PARAM.split(':')
|
||||
def IS_XPACK = JOB_PARTS[0] == 'xpack'
|
||||
def JOB = JOB_PARTS[1]
|
||||
def NEED_BUILD = JOB != 'serverMocha'
|
||||
def CI_GROUP = JOB_PARTS.size() > 2 ? JOB_PARTS[2] : ''
|
||||
def EXECUTIONS = params.NUMBER_EXECUTIONS.toInteger()
|
||||
def AGENT_COUNT = getAgentCount(EXECUTIONS)
|
||||
|
@ -18,61 +21,71 @@ def workerFailures = []
|
|||
currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
|
||||
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"
|
||||
|
||||
stage("Kibana Pipeline") {
|
||||
timeout(time: 180, unit: 'MINUTES') {
|
||||
timestamps {
|
||||
ansiColor('xterm') {
|
||||
def agents = [:]
|
||||
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
|
||||
def agentNumberInside = agentNumber
|
||||
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
|
||||
agents["agent-${agentNumber}"] = {
|
||||
catchError {
|
||||
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
|
||||
kibanaPipeline(timeoutMinutes: 180) {
|
||||
def agents = [:]
|
||||
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
|
||||
def agentNumberInside = agentNumber
|
||||
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
|
||||
agents["agent-${agentNumber}"] = {
|
||||
catchErrors {
|
||||
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
|
||||
|
||||
kibanaPipeline.withWorkers('flaky-test-runner', {
|
||||
if (!IS_XPACK) {
|
||||
kibanaPipeline.buildOss()
|
||||
} else {
|
||||
kibanaPipeline.buildXpack()
|
||||
}
|
||||
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
|
||||
workers.functional('flaky-test-runner', {
|
||||
if (NEED_BUILD) {
|
||||
if (!IS_XPACK) {
|
||||
kibanaPipeline.buildOss()
|
||||
} else {
|
||||
kibanaPipeline.buildXpack()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parallel(agents)
|
||||
|
||||
currentBuild.description += ", Failures: ${workerFailures.size()}"
|
||||
|
||||
if (workerFailures.size() > 0) {
|
||||
print "There were ${workerFailures.size()} test suite failures."
|
||||
print "The executions that failed were:"
|
||||
print workerFailures.join("\n")
|
||||
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
|
||||
}
|
||||
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parallel(agents)
|
||||
|
||||
currentBuild.description += ", Failures: ${workerFailures.size()}"
|
||||
|
||||
if (workerFailures.size() > 0) {
|
||||
print "There were ${workerFailures.size()} test suite failures."
|
||||
print "The executions that failed were:"
|
||||
print workerFailures.join("\n")
|
||||
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
|
||||
}
|
||||
}
|
||||
|
||||
def getWorkerFromParams(isXpack, job, ciGroup) {
|
||||
if (!isXpack) {
|
||||
if (job == 'firefoxSmoke') {
|
||||
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') })
|
||||
if (job == 'serverMocha') {
|
||||
return kibanaPipeline.functionalTestProcess('serverMocha', {
|
||||
kibanaPipeline.bash(
|
||||
"""
|
||||
source src/dev/ci_setup/setup_env.sh
|
||||
node scripts/mocha
|
||||
""",
|
||||
"run `node scripts/mocha`"
|
||||
)
|
||||
})
|
||||
} else if (job == 'accessibility') {
|
||||
return kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh')
|
||||
} else if (job == 'firefoxSmoke') {
|
||||
return kibanaPipeline.functionalTestProcess('firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh')
|
||||
} else if(job == 'visualRegression') {
|
||||
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') })
|
||||
return kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh')
|
||||
} else {
|
||||
return kibanaPipeline.getOssCiGroupWorker(ciGroup)
|
||||
return kibanaPipeline.ossCiGroupProcess(ciGroup)
|
||||
}
|
||||
}
|
||||
|
||||
if (job == 'firefoxSmoke') {
|
||||
return kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') })
|
||||
if (job == 'accessibility') {
|
||||
return kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh')
|
||||
} else if (job == 'firefoxSmoke') {
|
||||
return kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh')
|
||||
} else if(job == 'visualRegression') {
|
||||
return kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') })
|
||||
return kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
|
||||
} else {
|
||||
return kibanaPipeline.getXpackCiGroupWorker(ciGroup)
|
||||
return kibanaPipeline.xpackCiGroupProcess(ciGroup)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,10 +100,9 @@ def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWor
|
|||
for(def j = 0; j < workerExecutions; j++) {
|
||||
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
|
||||
withEnv([
|
||||
"JOB=agent-${agentNumber}-worker-${workerNumber}-${j}",
|
||||
"REMOVE_KIBANA_INSTALL_DIR=1",
|
||||
]) {
|
||||
catchError {
|
||||
catchErrors {
|
||||
try {
|
||||
worker(workerNumber)
|
||||
} catch (ex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue