diff --git a/bundle-workflow/jenkins_workflow/integtest/Jenkinsfile b/bundle-workflow/jenkins_workflow/integtest/Jenkinsfile new file mode 100644 index 0000000000..1bc729b054 --- /dev/null +++ b/bundle-workflow/jenkins_workflow/integtest/Jenkinsfile @@ -0,0 +1,67 @@ +pipeline { + agent none + tools { + jdk "JDK14" + maven "maven-3.8.2" + } + stages { + stage('Parameters') { + steps { + script { + properties([ + parameters([ + string( + defaultValue: '', + name: 'opensearch_version', + trim: true + ), + string( + defaultValue: '', + name: 'build_id', + trim: true + ), + string( + defaultValue: '', + name: 'architecture', + trim: true + ), + string( + defaultValue: '', + name: 'test_run_id', + trim: true + ), + ]) + ]) + } + } + } + stage('Choose Agent Node') { + steps { + script { + if ("${architecture}" == 'x64') { + agentLabel = "Jenkins-Agent-al2-x64-m5xlarge" + } else if ("${architecture}" == 'arm64') { + agentLabel = "Jenkins-Agent-al2-arm64-m6gxlarge" + } else { + error("Unknown CPU architecture is provided") + } + } + } + } + stage('Run Integration Tests') { + agent { + node { + label "${agentLabel}" + } + } + steps { + sh "./bundle-workflow/test.sh integ-test --s3-bucket ${ARTIFACT_BUCKET_NAME} --opensearch-version ${opensearch_version} --build-id ${build_id} --architecture ${architecture} --test-run-id ${test_run_id}" + } + post() { + always { + cleanWs disableDeferredWipeout: true, deleteDirs: true + } + } + } + } +} \ No newline at end of file diff --git a/bundle-workflow/jenkins_workflow/integtest/README.md b/bundle-workflow/jenkins_workflow/integtest/README.md new file mode 100644 index 0000000000..78c1f9d5bd --- /dev/null +++ b/bundle-workflow/jenkins_workflow/integtest/README.md @@ -0,0 +1,15 @@ +- [Integration Tests Jenkins Job](#integration-tests-jenkins-job) + - [Job Parameters](#job-parameters) +### Integration Tests Jenkins Job + +This job runs integration tests for a bundle via `test.sh` in Jenkins. + +#### Job Parameters +| name | description | +|-------------|------------------------------------------------------------| +| ARTIFACT_BUCKET_NAME | Artifact S3 bucket in Jenkins ENV | +| opensearch_version | OpenSearch version | +| build_id | Unique identifier for a bundle build | +| architecture | CPU Architecture of bundle | +| test_run_id | Unique identifier for a test run | + \ No newline at end of file diff --git a/bundle-workflow/src/run_integ_test.py b/bundle-workflow/src/run_integ_test.py old mode 100644 new mode 100755 diff --git a/bundle-workflow/src/test.py b/bundle-workflow/src/test.py deleted file mode 100755 index 7cc21b0cfb..0000000000 --- a/bundle-workflow/src/test.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python - -# 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. - -import os - -from manifests.bundle_manifest import BundleManifest -from system import console -from test_workflow.bwc_test.bwc_test_suite import BwcTestSuite -from test_workflow.test_args import TestArgs -from test_workflow.test_recorder import TestRecorder - -args = TestArgs() -console.configure(level=args.logging_level) - -manifest = BundleManifest.from_file(args.manifest) -test_recorder = TestRecorder(os.path.dirname(manifest.name)) - - -def bwc_test_suite(): - test_suite = BwcTestSuite(manifest, args.component, args.keep) - test_suite.execute() - - -bwc_test_suite() diff --git a/bundle-workflow/test.sh b/bundle-workflow/test.sh index 2cce01cdd1..611431ca77 100755 --- a/bundle-workflow/test.sh +++ b/bundle-workflow/test.sh @@ -9,4 +9,4 @@ set -e DIR="$(dirname "$0")" -"$DIR/run.sh" "$DIR/src/test.py" $@ +"$DIR/run.sh" "$DIR/src/test.py" $@ \ No newline at end of file