Skip to content

Commit

Permalink
Adding support to run integration tests in Jenkins (#423)
Browse files Browse the repository at this point in the history
* Adding Jenkins Job support for Integtests.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
  • Loading branch information
saratvemulapalli authored Sep 15, 2021
1 parent bf03b2f commit def90f5
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 30 deletions.
67 changes: 67 additions & 0 deletions bundle-workflow/jenkins_workflow/integtest/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}
15 changes: 15 additions & 0 deletions bundle-workflow/jenkins_workflow/integtest/README.md
Original file line number Diff line number Diff line change
@@ -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 |

Empty file modified bundle-workflow/src/run_integ_test.py
100644 → 100755
Empty file.
29 changes: 0 additions & 29 deletions bundle-workflow/src/test.py

This file was deleted.

2 changes: 1 addition & 1 deletion bundle-workflow/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
set -e

DIR="$(dirname "$0")"
"$DIR/run.sh" "$DIR/src/test.py" $@
"$DIR/run.sh" "$DIR/src/test.py" $@

0 comments on commit def90f5

Please sign in to comment.