Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <[email protected]>
  • Loading branch information
gaiksaya committed Jan 16, 2024
1 parent b639d5f commit 9a8a03a
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 79 deletions.
124 changes: 61 additions & 63 deletions jenkins/opensearch/integ-test.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ pipeline {
def componentDefaultList = testManifestObj.getComponentNames()
def componentsInBuildManifest = buildManifestObj.getNames()
def componentList = COMPONENT_NAME ? COMPONENT_NAME.trim().split(" ") as List : componentDefaultList
// String switch_user_non_root = (distribution.equals('rpm') || distribution.equals('deb')) ? 'true' : 'false'
// echo "switch_user_non_root: ${switch_user_non_root}"
String switch_user_non_root = (distribution.equals('rpm') || distribution.equals('deb')) ? 'true' : 'false'
echo "switch_user_non_root: ${switch_user_non_root}"
echo "componentList: ${componentList}"

for (component_check in componentList) {
Expand All @@ -146,8 +146,7 @@ pipeline {
}

if (env.platform != 'windows') {
echo "Not on Windows, stash repository+artifacts"
echo "Downloading from S3: ${artifactPath}"
echo "Downloading from ${artifactPath} and stashing both artifacts and repository"
downloadFromS3(
assumedRoleName: 'opensearch-bundle',
roleAccountNumberCred: 'jenkins-aws-account-public',
Expand All @@ -159,7 +158,7 @@ pipeline {
sh("rm -rf $WORKSPACE/$distribution && mv -v $WORKSPACE/artifacts/${artifactPath} $WORKSPACE")
}
else {
echo "On Windows Platform, stash repository only"
echo 'Skipping artifacts downloads since platform is Windows and only stashing the repository'
}

// Stash the current working directory files, aka opensearch-build repo
Expand All @@ -177,7 +176,7 @@ pipeline {
def wait_seconds = local_component_index * 20

echo "Add Component: ${local_component}"
componentTests["Run Integtest ${local_component}"] = {
componentTests["Testing ${local_component}"] = {
// Using scripted pipelines to trigger dynamic parallel stages
timeout(time: 2, unit: 'HOURS') {
node(AGENT_LABEL) {
Expand All @@ -192,8 +191,7 @@ pipeline {
sh("echo ${local_component} with index ${local_component_index} will sleep ${wait_seconds} seconds to reduce load && sleep ${wait_seconds}")
unstash "integtest-opensearch-$BUILD_NUMBER"
if (env.platform == 'windows') {
echo "On Windows Platform, unstash repository and download the artifacts"
echo "Downloading from S3: ${artifactPath}"
echo "Unstashing the repository and downloading the artifacts from S3: ${artifactPath}"
downloadFromS3(
assumedRoleName: 'opensearch-bundle',
roleAccountNumberCred: 'jenkins-aws-account-public',
Expand All @@ -205,7 +203,7 @@ pipeline {
sh("rm -rf $WORKSPACE/$distribution && mv -v $WORKSPACE/artifacts/${artifactPath} $WORKSPACE")
}
else {
echo "Not on Windows, unstash repository+artifacts"
echo 'Unstashing both artifacts and repository'
}

sh('rm -rf test-results')
Expand Down Expand Up @@ -258,68 +256,68 @@ pipeline {
}
post {
always {
// script {
// node(AGENT_LABEL) {
// docker.withRegistry('https://public.ecr.aws/') {
// docker.image(docker_images["$distribution"]).inside(docker_args["$distribution"]) {
// checkout scm
script {
node(AGENT_LABEL) {
docker.withRegistry('https://public.ecr.aws/') {
docker.image(docker_images["$distribution"]).inside(docker_args["$distribution"]) {
checkout scm

// // downloadBuildManifest(
// // url: BUILD_MANIFEST_URL,
// // path: BUILD_MANIFEST
// // )
downloadBuildManifest(
url: BUILD_MANIFEST_URL,
path: BUILD_MANIFEST
)

// // createUploadTestReportManifest(
// // testManifest: "manifests/${TEST_MANIFEST}",
// // buildManifest: BUILD_MANIFEST,
// // testRunID: "${env.BUILD_NUMBER}",
// // testType: "integ-test",
// // componentName: "${COMPONENT_NAME}",
// // )
// // echo("Download report manifest from https://ci.opensearch.org/ci/dbc/integ-test/${env.version}/${env.buildId}/${env.platform}/${env.architecture}/${env.distribution}/test-results/${env.BUILD_NUMBER}/integ-test/test-report.yml")
// // archiveArtifacts artifacts: 'test-report.yml'
// }
// }
// }
// }
createUploadTestReportManifest(
testManifest: "manifests/${TEST_MANIFEST}",
buildManifest: BUILD_MANIFEST,
testRunID: "${env.BUILD_NUMBER}",
testType: "integ-test",
componentName: "${COMPONENT_NAME}",
)
echo("Download report manifest from https://ci.opensearch.org/ci/dbc/integ-test/${env.version}/${env.buildId}/${env.platform}/${env.architecture}/${env.distribution}/test-results/${env.BUILD_NUMBER}/integ-test/test-report.yml")
archiveArtifacts artifacts: 'test-report.yml'
}
}
}
}
postCleanup()
}
}
}
}

// post {
// success {
// node(AGENT_LABEL) {
// script {
// def stashed = lib.jenkins.Messages.new(this).get(['integ-test'])
// publishNotification(
// icon: ':white_check_mark:',
// message: 'Integration Tests Successful',
// extra: stashed,
// credentialsId: 'jenkins-integ-test-webhook',
// manifest: TEST_MANIFEST,
// )
post {
success {
node(AGENT_LABEL) {
script {
def stashed = lib.jenkins.Messages.new(this).get(['integ-test'])
publishNotification(
icon: ':white_check_mark:',
message: 'Integration Tests Successful',
extra: stashed,
credentialsId: 'jenkins-integ-test-webhook',
manifest: TEST_MANIFEST,
)

// postCleanup()
// }
// }
// }
// failure {
// node(AGENT_LABEL) {
// script {
// def stashed = lib.jenkins.Messages.new(this).get(['integ-test'])
// publishNotification(
// icon: ':warning:',
// message: 'Failed Integration Tests',
// extra: stashed,
// credentialsId: 'jenkins-integ-test-webhook',
// manifest: TEST_MANIFEST,
// )
postCleanup()
}
}
}
failure {
node(AGENT_LABEL) {
script {
def stashed = lib.jenkins.Messages.new(this).get(['integ-test'])
publishNotification(
icon: ':warning:',
message: 'Failed Integration Tests',
extra: stashed,
credentialsId: 'jenkins-integ-test-webhook',
manifest: TEST_MANIFEST,
)

// postCleanup()
// }
// }
// }
// }
postCleanup()
}
}
}
}
}
4 changes: 2 additions & 2 deletions tests/jenkins/TestOpenSearchIntegTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class TestOpenSearchIntegTest extends BuildPipelineTest {

helper.registerSharedLibrary(
library().name('jenkins')
.defaultVersion('5.11.1')
.defaultVersion('add-getNames')
.allowOverride(true)
.implicit(true)
.targetPath('vars')
.retriever(gitSource('https://github.com/opensearch-project/opensearch-build-libraries.git'))
.retriever(gitSource('https://github.com/gaiksaya/opensearch-build-libraries.git'))
.build()
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
integ-test.run()
integ-test.modernSCM({$class=GitSCMSource, remote=https://github.com/opensearch-project/opensearch-build-libraries.git})
integ-test.library({identifier=jenkins@5.11.1, retriever=null})
integ-test.modernSCM({$class=GitSCMSource, remote=https://github.com/gaiksaya/opensearch-build-libraries.git})
integ-test.library({identifier=jenkins@add-getNames, retriever=null})
integ-test.pipeline(groovy.lang.Closure)
integ-test.credentials(jenkins-artifact-bucket-name)
integ-test.timeout({time=4, unit=HOURS})
Expand All @@ -17,13 +17,15 @@
integ-test.fileExists(manifests/tests/jenkins/data/opensearch-3.0.0-test.yml)
integ-test.downloadBuildManifest({url=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/8184/linux/x64/tar/dist/opensearch/opensearch-3.0.0-linux-x64.tar.gz, path=tests/jenkins/data/opensearch-3.0.0-build.yml})
downloadBuildManifest.legacySCM(groovy.lang.Closure)
downloadBuildManifest.library({identifier=jenkins@5.11.1, retriever=null})
downloadBuildManifest.library({identifier=jenkins@main, retriever=null})
downloadBuildManifest.sh(curl -sSL https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/8184/linux/x64/tar/dist/opensearch/opensearch-3.0.0-linux-x64.tar.gz --output tests/jenkins/data/opensearch-3.0.0-build.yml)
downloadBuildManifest.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
BuildManifest.asBoolean()
integ-test.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
BuildManifest.asBoolean()
BuildManifest.getNames()
integ-test.readYaml({file=manifests/tests/jenkins/data/opensearch-3.0.0-test.yml})
TestManifest.asBoolean()
TestManifest.getComponentNames()
BuildManifest.getArtifactArchitecture()
BuildManifest.getArtifactPlatform()
BuildManifest.getArtifactBuildId()
Expand All @@ -37,17 +39,19 @@
integ-test.script(groovy.lang.Closure)
integ-test.downloadBuildManifest({url=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/8184/linux/x64/tar/dist/opensearch/opensearch-3.0.0-linux-x64.tar.gz, path=tests/jenkins/data/opensearch-3.0.0-build.yml})
downloadBuildManifest.legacySCM(groovy.lang.Closure)
downloadBuildManifest.library({identifier=jenkins@5.11.1, retriever=null})
downloadBuildManifest.library({identifier=jenkins@main, retriever=null})
downloadBuildManifest.sh(curl -sSL https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/8184/linux/x64/tar/dist/opensearch/opensearch-3.0.0-linux-x64.tar.gz --output tests/jenkins/data/opensearch-3.0.0-build.yml)
downloadBuildManifest.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
BuildManifest.asBoolean()
integ-test.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
BuildManifest.asBoolean()
integ-test.readYaml({file=manifests/tests/jenkins/data/opensearch-3.0.0-test.yml})
TestManifest.asBoolean()
TestManifest.getComponentNames()
BuildManifest.getNames()
integ-test.echo(switch_user_non_root: false)
integ-test.echo(componentList: [OpenSearch])
integ-test.echo(Not on Windows, stash repository+artifacts)
integ-test.echo(Downloading from S3: distribution-build-opensearch/3.0.0/8184/linux/x64/tar)
integ-test.echo(Downloading from distribution-build-opensearch/3.0.0/8184/linux/x64/tar and stashing both artifacts and repository)
integ-test.downloadFromS3({assumedRoleName=opensearch-bundle, roleAccountNumberCred=jenkins-aws-account-public, downloadPath=distribution-build-opensearch/3.0.0/8184/linux/x64/tar/, bucketName=job-s3-bucket-name, localPath=/tmp/workspace/artifacts, force=true})
downloadFromS3.string({credentialsId=jenkins-aws-account-public, variable=AWS_ACCOUNT_NUMBER})
downloadFromS3.withCredentials([AWS_ACCOUNT_NUMBER], groovy.lang.Closure)
Expand All @@ -56,16 +60,16 @@
integ-test.sh(rm -rf /tmp/workspace/tar && mv -v /tmp/workspace/artifacts/distribution-build-opensearch/3.0.0/8184/linux/x64/tar /tmp/workspace)
integ-test.stash({includes=**, name=integtest-opensearch-234})
integ-test.echo(Add Component: OpenSearch)
integ-test.parallel({Run Integtest OpenSearch=groovy.lang.Closure})
integ-test.parallel({Testing OpenSearch=groovy.lang.Closure})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.sh(echo OpenSearch with index 0 will sleep 0 seconds to reduce load && sleep 0)
integ-test.unstash(integtest-opensearch-234)
integ-test.echo(Not on Windows, unstash repository+artifacts)
integ-test.echo(Unstashing both artifacts and repository)
integ-test.sh(rm -rf test-results)
integ-test.runIntegTestScript({jobName=distribution-build-opensearch, componentName=OpenSearch, buildManifest=tests/jenkins/data/opensearch-3.0.0-build.yml, testManifest=manifests/tests/jenkins/data/opensearch-3.0.0-test.yml, localPath=/tmp/workspace/tar, switchUserNonRoot=false})
runIntegTestScript.legacySCM(groovy.lang.Closure)
runIntegTestScript.library({identifier=jenkins@5.11.1, retriever=null})
runIntegTestScript.library({identifier=jenkins@main, retriever=null})
runIntegTestScript.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
BuildManifest.asBoolean()
BuildManifest.getArtifactArchitecture()
Expand All @@ -74,7 +78,7 @@
runIntegTestScript.echo(Start integTest on: tar x64 linux)
runIntegTestScript.detectTestDockerAgent({testManifest=manifests/tests/jenkins/data/opensearch-3.0.0-test.yml})
detectTestDockerAgent.legacySCM(groovy.lang.Closure)
detectTestDockerAgent.library({identifier=jenkins@5.11.1, retriever=null})
detectTestDockerAgent.library({identifier=jenkins@main, retriever=null})
detectTestDockerAgent.readYaml({file=manifests/tests/jenkins/data/opensearch-3.0.0-test.yml})
TestManifest.asBoolean()
detectTestDockerAgent.echo(Using Docker image opensearchstaging/ci-runner:ci-runner-centos7-v1 (null))
Expand All @@ -100,7 +104,7 @@ ccc -R opensearch-project/OpenSearch --comment "Closing the issue as the Integra
integ-test.echo(Completed running integtest for component OpenSearch)
integ-test.uploadTestResults({buildManifestFileName=tests/jenkins/data/opensearch-3.0.0-build.yml, jobName=dummy_job})
uploadTestResults.legacySCM(groovy.lang.Closure)
uploadTestResults.library({identifier=jenkins@5.11.1, retriever=null})
uploadTestResults.library({identifier=jenkins@main, retriever=null})
uploadTestResults.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
BuildManifest.asBoolean()
uploadTestResults.echo(Build Id: 8184)
Expand All @@ -123,13 +127,13 @@ ccc -R opensearch-project/OpenSearch --comment "Closing the issue as the Integra
integ-test.checkout(groovy.lang.Closure)
integ-test.downloadBuildManifest({url=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/8184/linux/x64/tar/dist/opensearch/opensearch-3.0.0-linux-x64.tar.gz, path=tests/jenkins/data/opensearch-3.0.0-build.yml})
downloadBuildManifest.legacySCM(groovy.lang.Closure)
downloadBuildManifest.library({identifier=jenkins@5.11.1, retriever=null})
downloadBuildManifest.library({identifier=jenkins@main, retriever=null})
downloadBuildManifest.sh(curl -sSL https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/8184/linux/x64/tar/dist/opensearch/opensearch-3.0.0-linux-x64.tar.gz --output tests/jenkins/data/opensearch-3.0.0-build.yml)
downloadBuildManifest.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
BuildManifest.asBoolean()
integ-test.createUploadTestReportManifest({testManifest=manifests/tests/jenkins/data/opensearch-3.0.0-test.yml, buildManifest=tests/jenkins/data/opensearch-3.0.0-build.yml, testRunID=234, testType=integ-test, componentName=})
createUploadTestReportManifest.legacySCM(groovy.lang.Closure)
createUploadTestReportManifest.library({identifier=jenkins@5.11.1, retriever=null})
createUploadTestReportManifest.library({identifier=jenkins@main, retriever=null})
createUploadTestReportManifest.readYaml({file=manifests/tests/jenkins/data/opensearch-3.0.0-test.yml})
TestManifest.asBoolean()
createUploadTestReportManifest.readYaml({file=tests/jenkins/data/opensearch-3.0.0-build.yml})
Expand Down

0 comments on commit 9a8a03a

Please sign in to comment.