Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smoke tests trigger in distribution build Jenkins job #5346

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading