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

Refactor and enable triggering integ-test for RPM, debian and windows #4368

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
108 changes: 53 additions & 55 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,7 @@ pipeline {

parallel([
'integ-test': {
Boolean skipIntegTests = (INTEG_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '')
echo "${skipIntegTests ? 'Skipping integration tests as one of the values has empty string: INTEG_TEST_JOB_NAME, TEST_MANIFEST, buildManifestUrl' : 'Running integration tests'}"
if (!skipIntegTests) {
def integTestResults =
build job: INTEG_TEST_JOB_NAME,
propagate: false,
wait: false,
parameters: [
string(name: 'TEST_MANIFEST', value: TEST_MANIFEST),
string(name: 'BUILD_MANIFEST_URL', value: buildManifestUrl),
booleanParam(name: 'UPDATE_GITHUB_ISSUES', value: true)
]
}
triggerIntegrationTests(buildManifestUrl)
},
'bwc-test': {
Boolean skipBwcTests = (BWC_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '')
Expand All @@ -210,7 +198,7 @@ pipeline {
]
}
}
])
])
}
}
post {
Expand Down Expand Up @@ -284,7 +272,7 @@ pipeline {
if (params.CONTINUE_ON_ERROR) {
markStageUnstableIfPluginsFailedToBuild()
}
postCleanup()
postCleanup()
}
}
}
Expand Down Expand Up @@ -318,16 +306,14 @@ pipeline {
echo "artifactUrl (linux, x64, rpm): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

echo "Trigger rpm validation for linux x64 rpm ${bundleManifestUrl}"
def rpmValidationResults =
build job: 'rpm-validation',
propagate: false,
wait: false,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_LINUX_X64)
]
parallel([
'integ-test': {
triggerIntegrationTests(buildManifestUrl)
},
'rpm-validation': {
triggerRpmValidation(bundleManifestUrl)
}
])
}
}
post {
Expand Down Expand Up @@ -400,7 +386,7 @@ pipeline {
if (params.CONTINUE_ON_ERROR) {
markStageUnstableIfPluginsFailedToBuild()
}
postCleanup()
postCleanup()
}
}
}
Expand Down Expand Up @@ -434,6 +420,7 @@ pipeline {
echo "artifactUrl (linux, x64, deb): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)
triggerIntegrationTests(buildManifestUrl)
}
}
post {
Expand Down Expand Up @@ -502,24 +489,7 @@ pipeline {

echo "buildManifestUrl (linux, arm64, tar): ${buildManifestUrl}"
echo "artifactUrl (linux, arm64, tar): ${artifactUrl}"

parallel([
'integ-test': {
Boolean skipIntegTests = (INTEG_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '')
echo "${skipIntegTests ? 'Skipping integration tests as one of the values has empty string: INTEG_TEST_JOB_NAME, TEST_MANIFEST, buildManifestUrl' : 'Running integration tests'}"
if (!skipIntegTests) {
def integTestResults =
build job: INTEG_TEST_JOB_NAME,
propagate: false,
wait: false,
parameters: [
string(name: 'TEST_MANIFEST', value: TEST_MANIFEST),
string(name: 'BUILD_MANIFEST_URL', value: buildManifestUrl),
booleanParam(name: 'UPDATE_GITHUB_ISSUES', value: true)
]
}
}
])
triggerIntegrationTests(buildManifestUrl)
}
}
post {
Expand Down Expand Up @@ -627,16 +597,14 @@ pipeline {
echo "artifactUrl (linux, arm64, rpm): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

echo "Trigger rpm validation for linux arm64 rpm ${bundleManifestUrl}"
def rpmValidationResults =
build job: 'rpm-validation',
propagate: false,
wait: false,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_LINUX_ARM64)
]
parallel([
'integ-test': {
triggerIntegrationTests(buildManifestUrl)
},
'rpm-validation': {
triggerRpmValidation(bundleManifestUrl)
}
])
}
}
post {
Expand Down Expand Up @@ -743,6 +711,7 @@ pipeline {
echo "artifactUrl (linux, arm64, deb): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)
triggerIntegrationTests(buildManifestUrl)
}
}
post {
Expand Down Expand Up @@ -811,6 +780,7 @@ pipeline {

echo "buildManifestUrl (windows, x64, zip): ${buildManifestUrl}"
echo "artifactUrl (windows, x64, zip): ${artifactUrl}"
triggerIntegrationTests(buildManifestUrl)
}
}
post {
Expand Down Expand Up @@ -959,7 +929,35 @@ pipeline {

def markStageUnstableIfPluginsFailedToBuild() {
def stageLogs = getLogsForStage(stageName: "${STAGE_NAME}")
if (stageLogs.any{e -> e.contains('Failed plugins are')}) {
if (stageLogs.any { e -> e.contains('Failed plugins are') }) {
unstable('Some plugins failed to build. See the ./build.sh step for logs and more details')
}
}

def triggerIntegrationTests(String buildManifestUrl) {
Boolean skipIntegTests = (INTEG_TEST_JOB_NAME == '' || TEST_MANIFEST == '' || buildManifestUrl == '')
echo "${skipIntegTests ? 'Skipping integration tests as one of the values has empty string: INTEG_TEST_JOB_NAME, TEST_MANIFEST, buildManifestUrl' : 'Running integration tests'}"
if (!skipIntegTests) {
def integTestResults =
build job: INTEG_TEST_JOB_NAME,
propagate: false,
wait: false,
parameters: [
string(name: 'TEST_MANIFEST', value: TEST_MANIFEST),
string(name: 'BUILD_MANIFEST_URL', value: buildManifestUrl),
booleanParam(name: 'UPDATE_GITHUB_ISSUES', value: true)
]
}
}

def triggerRpmValidation(String bundleManifestUrl) {
echo "Triggering RPM validation for ${bundleManifestUrl}"
def rpmValidationResults =
build job: 'rpm-validation',
propagate: false,
wait: false,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_LINUX_X64)
]
}
Loading