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 1 commit
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
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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these as parallel as well like above example?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Working on it. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

}
}
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
Loading