Skip to content

Commit

Permalink
Add smoke tests trigger in distribution build Jenkins job (#5346)
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
zelinh authored Mar 3, 2025
1 parent 3b8cc72 commit 9d72236
Showing 1 changed file with 65 additions and 5 deletions.
70 changes: 65 additions & 5 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ pipeline {
defaultValue: 'integ-test',
trim: true
)
string(
name: 'SMOKE_TEST_JOB_NAME',
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.',
defaultValue: 'smoke-test',
trim: true
)
string(
name: 'BWC_TEST_JOB_NAME',
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.',
Expand Down Expand Up @@ -227,6 +233,9 @@ pipeline {
'integ-test': {
triggerIntegrationTests(buildManifestUrl, 'linux', 'tar')
},
'smoke-test': {
triggerSmokeTests(buildManifestUrl, 'linux', 'tar')
},
'bwc-test': {
triggerBWCTests(buildManifestUrl, 'linux', 'tar')
}
Expand Down Expand Up @@ -340,7 +349,14 @@ pipeline {

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
parallel([
'integ-test': {
triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
},
'smoke-test': {
triggerSmokeTests(buildManifestUrl, 'linux', 'rpm')
}
])
}
}
post {
Expand Down Expand Up @@ -449,7 +465,14 @@ pipeline {

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
parallel([
'integ-test': {
triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
},
'smoke-test': {
triggerSmokeTests(buildManifestUrl, 'linux', 'deb')
}
])
}
}
post {
Expand Down Expand Up @@ -519,7 +542,14 @@ pipeline {
echo "buildManifestUrl (linux, arm64, tar): ${buildManifestUrl}"
echo "artifactUrl (linux, arm64, tar): ${artifactUrl}"

triggerIntegrationTests(buildManifestUrl, 'linux', 'tar')
parallel([
'integ-test': {
triggerIntegrationTests(buildManifestUrl, 'linux', 'tar')
},
'smoke-test': {
triggerSmokeTests(buildManifestUrl, 'linux', 'tar')
}
])
}
}
post {
Expand Down Expand Up @@ -629,7 +659,14 @@ pipeline {

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
parallel([
'integ-test': {
triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
},
'smoke-test': {
triggerSmokeTests(buildManifestUrl, 'linux', 'rpm')
}
])
}
}
post {
Expand Down Expand Up @@ -739,7 +776,15 @@ pipeline {

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
parallel([
'integ-test': {
triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
},
'smoke-test': {
triggerSmokeTests(buildManifestUrl, 'linux', 'deb')
}
])

}
}
post {
Expand Down Expand Up @@ -966,6 +1011,21 @@ def triggerIntegrationTests(String buildManifestUrl, String platform, String dis
}
}

def triggerSmokeTests(String buildManifestUrl, String platform, String distribution) {
Boolean skipSmokeTests = (SMOKE_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '' || !TEST_PLATFORM.contains(platform) || !TEST_DISTRIBUTION.contains(distribution))
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'}"
if (!skipSmokeTests) {
def smokeTestResults =
build job: SMOKE_TEST_JOB_NAME,
propagate: false,
wait: false,
parameters: [
string(name: 'TEST_MANIFEST', value: TEST_MANIFEST),
string(name: 'BUILD_MANIFEST_URL', value: buildManifestUrl)
]
}
}

def triggerBWCTests(String buildManifestUrl, String platform, String distribution) {
Boolean skipBwcTests = (BWC_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '' || !TEST_PLATFORM.contains(platform) || !TEST_DISTRIBUTION.contains(distribution))
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'}"
Expand Down

0 comments on commit 9d72236

Please sign in to comment.