-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support to run integration tests in Jenkins (#423)
* Adding Jenkins Job support for Integtests. Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
- Loading branch information
1 parent
bf03b2f
commit def90f5
Showing
5 changed files
with
83 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
set -e | ||
|
||
DIR="$(dirname "$0")" | ||
"$DIR/run.sh" "$DIR/src/test.py" $@ | ||
"$DIR/run.sh" "$DIR/src/test.py" $@ |