Skip to content

Commit 9d72236

Browse files
authored
Add smoke tests trigger in distribution build Jenkins job (#5346)
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
1 parent 3b8cc72 commit 9d72236

File tree

1 file changed

+65
-5
lines changed

1 file changed

+65
-5
lines changed

jenkins/opensearch/distribution-build.jenkinsfile

+65-5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ pipeline {
4747
defaultValue: 'integ-test',
4848
trim: true
4949
)
50+
string(
51+
name: 'SMOKE_TEST_JOB_NAME',
52+
description: 'Optional: Name of smoke test job that will be triggered, e.g. smoke-test. A non-null empty value here will skip smoke tests.',
53+
defaultValue: 'smoke-test',
54+
trim: true
55+
)
5056
string(
5157
name: 'BWC_TEST_JOB_NAME',
5258
description: 'Optional: Name of backwards compatibility test job that will be triggered, e.g. Playground/bwc-test. A non-null empty value here will skip BWC tests.',
@@ -227,6 +233,9 @@ pipeline {
227233
'integ-test': {
228234
triggerIntegrationTests(buildManifestUrl, 'linux', 'tar')
229235
},
236+
'smoke-test': {
237+
triggerSmokeTests(buildManifestUrl, 'linux', 'tar')
238+
},
230239
'bwc-test': {
231240
triggerBWCTests(buildManifestUrl, 'linux', 'tar')
232241
}
@@ -340,7 +349,14 @@ pipeline {
340349

341350
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)
342351

343-
triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
352+
parallel([
353+
'integ-test': {
354+
triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
355+
},
356+
'smoke-test': {
357+
triggerSmokeTests(buildManifestUrl, 'linux', 'rpm')
358+
}
359+
])
344360
}
345361
}
346362
post {
@@ -449,7 +465,14 @@ pipeline {
449465

450466
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)
451467

452-
triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
468+
parallel([
469+
'integ-test': {
470+
triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
471+
},
472+
'smoke-test': {
473+
triggerSmokeTests(buildManifestUrl, 'linux', 'deb')
474+
}
475+
])
453476
}
454477
}
455478
post {
@@ -519,7 +542,14 @@ pipeline {
519542
echo "buildManifestUrl (linux, arm64, tar): ${buildManifestUrl}"
520543
echo "artifactUrl (linux, arm64, tar): ${artifactUrl}"
521544

522-
triggerIntegrationTests(buildManifestUrl, 'linux', 'tar')
545+
parallel([
546+
'integ-test': {
547+
triggerIntegrationTests(buildManifestUrl, 'linux', 'tar')
548+
},
549+
'smoke-test': {
550+
triggerSmokeTests(buildManifestUrl, 'linux', 'tar')
551+
}
552+
])
523553
}
524554
}
525555
post {
@@ -629,7 +659,14 @@ pipeline {
629659

630660
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)
631661

632-
triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
662+
parallel([
663+
'integ-test': {
664+
triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
665+
},
666+
'smoke-test': {
667+
triggerSmokeTests(buildManifestUrl, 'linux', 'rpm')
668+
}
669+
])
633670
}
634671
}
635672
post {
@@ -739,7 +776,15 @@ pipeline {
739776

740777
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)
741778

742-
triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
779+
parallel([
780+
'integ-test': {
781+
triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
782+
},
783+
'smoke-test': {
784+
triggerSmokeTests(buildManifestUrl, 'linux', 'deb')
785+
}
786+
])
787+
743788
}
744789
}
745790
post {
@@ -966,6 +1011,21 @@ def triggerIntegrationTests(String buildManifestUrl, String platform, String dis
9661011
}
9671012
}
9681013

1014+
def triggerSmokeTests(String buildManifestUrl, String platform, String distribution) {
1015+
Boolean skipSmokeTests = (SMOKE_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '' || !TEST_PLATFORM.contains(platform) || !TEST_DISTRIBUTION.contains(distribution))
1016+
echo "${skipSmokeTests ? 'Skipping SMOKE tests as one of the values has empty or wrong string: SMOKE_TEST_JOB_NAME, TEST_MANIFEST, buildManifestUrl, TEST_PLATFORM, TEST_DISTRIBUTION' : 'Running SMOKE tests'}"
1017+
if (!skipSmokeTests) {
1018+
def smokeTestResults =
1019+
build job: SMOKE_TEST_JOB_NAME,
1020+
propagate: false,
1021+
wait: false,
1022+
parameters: [
1023+
string(name: 'TEST_MANIFEST', value: TEST_MANIFEST),
1024+
string(name: 'BUILD_MANIFEST_URL', value: buildManifestUrl)
1025+
]
1026+
}
1027+
}
1028+
9691029
def triggerBWCTests(String buildManifestUrl, String platform, String distribution) {
9701030
Boolean skipBwcTests = (BWC_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '' || !TEST_PLATFORM.contains(platform) || !TEST_DISTRIBUTION.contains(distribution))
9711031
echo "${skipBwcTests ? 'Skipping BWC tests as one of the values has empty or wrong string: BWC_TEST_JOB_NAME, TEST_MANIFEST, buildManifestUrl, TEST_PLATFORM, TEST_DISTRIBUTION' : 'Running BWC tests'}"

0 commit comments

Comments
 (0)