Skip to content

Commit

Permalink
Add smoke tests trigger in distribution build Jenkins job
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
zelinh committed Feb 25, 2025
1 parent 96ab4ab commit 1e4439e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 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 @@ -341,6 +350,7 @@ pipeline {
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
triggerSmokeTests(buildManifestUrl, 'linux', 'rpm')
}
}
post {
Expand Down Expand Up @@ -450,6 +460,7 @@ pipeline {
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
triggerSmokeTests(buildManifestUrl, 'linux', 'deb')
}
}
post {
Expand Down Expand Up @@ -520,6 +531,7 @@ pipeline {
echo "artifactUrl (linux, arm64, tar): ${artifactUrl}"

triggerIntegrationTests(buildManifestUrl, 'linux', 'tar')
triggerSmokeTests(buildManifestUrl, 'linux', 'tar')
}
}
post {
Expand Down Expand Up @@ -630,6 +642,7 @@ pipeline {
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'rpm')
triggerSmokeTests(buildManifestUrl, 'linux', 'rpm')
}
}
post {
Expand Down Expand Up @@ -740,6 +753,7 @@ pipeline {
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

triggerIntegrationTests(buildManifestUrl, 'linux', 'deb')
triggerSmokeTests(buildManifestUrl, 'linux', 'deb')
}
}
post {
Expand Down Expand Up @@ -966,6 +980,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 1e4439e

Please sign in to comment.