Skip to content

Commit b71a9f2

Browse files
v1vQard
authored andcommitted
ci(jenkins): add tests with elastic_apm_async_hooks=false (#1231)
* ci(jenkins): add tests with elastic_apm_async_hooks=false * ci(jenkins): add tests with elastic_apm_async_hooks=false * ci(jenkins): add tests with elastic_apm_async_hooks=false * ci: catchError if node version 6.x
1 parent 1ebc369 commit b71a9f2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.ci/docker/docker-compose-node-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ services:
2121
PGUSER: 'postgres'
2222
NODE_VERSION: ${NODE_VERSION}
2323
TAV: ${TAV_VERSIONS}
24+
ELASTIC_APM_ASYNC_HOOKS: ${ELASTIC_APM_ASYNC_HOOKS}
2425
HOME: /tmp
2526
PATH: /app/node_modules/.bin:./node_modules/.bin:/app/node_modules:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
2627
volumes:

Jenkinsfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,17 @@ pipeline {
101101
script {
102102
def node = readYaml(file: '.ci/.jenkins_nodejs.yml')
103103
def parallelTasks = [:]
104+
def parallelTasksWithoutAsyncHooks = [:]
104105
node['NODEJS_VERSION'].each{ version ->
105106
parallelTasks["Node.js-${version}"] = generateStep(version: version)
107+
parallelTasksWithoutAsyncHooks["Node.js-${version}-async-hooks-false"] = generateStep(version: version)
106108
}
109+
110+
env.ELASTIC_APM_ASYNC_HOOKS = "true"
107111
parallel(parallelTasks)
112+
113+
env.ELASTIC_APM_ASYNC_HOOKS = "false"
114+
parallel(parallelTasksWithoutAsyncHooks)
108115
}
109116
}
110117
}
@@ -285,7 +292,13 @@ def generateStep(Map params = [:]){
285292
dir("${BASE_DIR}"){
286293
retry(2){
287294
sleep randomNumber(min:10, max: 30)
288-
sh(label: "Run Tests", script: """.ci/scripts/test.sh "${version}" "${tav}" "${edge}" """)
295+
if (version?.startsWith('6')) {
296+
catchError {
297+
sh(label: 'Run Tests', script: """.ci/scripts/test.sh "${version}" "${tav}" "${edge}" """)
298+
}
299+
} else {
300+
sh(label: "Run Tests", script: """.ci/scripts/test.sh "${version}" "${tav}" "${edge}" """)
301+
}
289302
}
290303
}
291304
} catch(e){

0 commit comments

Comments
 (0)