Skip to content

Commit

Permalink
add ci-group arg for OSD integ tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Singh <[email protected]>
  • Loading branch information
rishabh6788 committed Nov 14, 2024
1 parent 42c8c5d commit 7a84c42
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
53 changes: 53 additions & 0 deletions vars/processAndRunOsdIntegTest.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
void call(Map args = [:]) {
lib = library(identifier: 'jenkins@main', retriever: legacySCM(scm))

unstash "integtest-opensearch-dashboards-${BUILD_NUMBER}"

if (env.platform == 'windows') {
echo "On Windows Platform, unstash repository and download the artifacts"
echo "Downloading from S3: ${artifactPathOpenSearch}"
downloadFromS3(
assumedRoleName: 'opensearch-bundle',
roleAccountNumberCred: 'jenkins-aws-account-public',
downloadPath: "${artifactPathOpenSearch}/",
bucketName: "${ARTIFACT_BUCKET_NAME}",
localPath: "${WORKSPACE}/artifacts",
force: true
)
sh("cp -a ${WORKSPACE}/artifacts/${artifactPathOpenSearch} ${WORKSPACE}")

echo "Downloading from S3: ${artifactPath}"
downloadFromS3(
assumedRoleName: 'opensearch-bundle',
roleAccountNumberCred: 'jenkins-aws-account-public',
downloadPath: "${artifactPath}/",
bucketName: "${ARTIFACT_BUCKET_NAME}",
localPath: "${WORKSPACE}/artifacts",
force: true
)
sh("cp -a ${WORKSPACE}/artifacts/${artifactPath} ${WORKSPACE}")
sh("rm -rf ${WORKSPACE}/artifacts")
}
else {
echo "Not on Windows, unstash repository+artifacts"
}

sh("rm -rf test-results")
runIntegTestScript(
jobName: "${BUILD_JOB_NAME}",
componentName: "${local_component}",
buildManifest: "${BUILD_MANIFEST}",
testManifest: "manifests/${TEST_MANIFEST}",
localPath: "${WORKSPACE}/${distribution}",
switchUserNonRoot: "${switch_user_non_root}",
ciGroup: args.ciGroup
)
}
4 changes: 3 additions & 1 deletion vars/runIntegTestScript.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void call(Map args = [:]) {
'integ-test',
"${args.testManifest}",
"--component ${component}",
"--ci-group ${args.ciGroup}",
isNullOrEmpty(args.ciGroup.toString()) ? "" : "--ci-group ${args.ciGroup}",
"--test-run-id ${env.BUILD_NUMBER}",
"--paths ${paths}",
"--base-path ${basePath}",
Expand Down Expand Up @@ -98,3 +98,5 @@ String generatePaths(buildManifest, artifactRootUrl, localPath) {
String generateBasePaths(buildManifest) {
return ["${env.PUBLIC_ARTIFACT_URL}", "${env.JOB_NAME}", buildManifest.build.version, buildManifest.build.id, buildManifest.build.platform, buildManifest.build.architecture, buildManifest.build.distribution].join("/")
}

boolean isNullOrEmpty(String str) { return (str == null || str.allWhitespace || str.isEmpty()) }

0 comments on commit 7a84c42

Please sign in to comment.