Skip to content

Commit

Permalink
Adding orchestrator pipeline and refactoring testsuite job (#523)
Browse files Browse the repository at this point in the history
* Adding orchestrator pipeline and refactoring testsuite job

Signed-off-by: Himanshu Setia <setiah@amazon.com>

* Updating README

Signed-off-by: Himanshu Setia <setiah@amazon.com>

* Addressing PR comments

Signed-off-by: Himanshu Setia <setiah@amazon.com>
  • Loading branch information
setiah authored Sep 18, 2021
1 parent 5918ce9 commit 0ac7e2b
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 11 deletions.
25 changes: 20 additions & 5 deletions bundle-workflow/jenkins_workflow/test/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
- [Tests Jenkins Job](#tests-jenkins-job)
- [Job Parameters](#job-parameters)
### Tests Jenkins Job
- [Orchestrator](#orchestrator)
- [Input Parameters](#input-parameters)
- [Testsuite](#testsuite)
- [Input Parameters](#input-parameters)

This job runs integration/bwc tests for a bundle via `test.sh` in Jenkins.
### Orchestrator

This is a jenkins pipeline that kicks off all long running test jobs on a given build artifact. It accepts `build_id`, `opensearch_version` and `architecture` as input parameters to uniquely identify a build artifact. It kicks off `integ-test`, `bwc-test`, `perf-test` jobs in parallel and notifies the designated channels when the workflow finishes.

#### Input parameters

| name | description |
|-------------|------------------------------------------------------------|
| opensearch_version | OpenSearch version |
| build_id | Unique identifier for a bundle build |
| architecture | CPU Architecture of bundle |


### Testsuite

This job runs integration/bwc/perf tests for a bundle via `test.sh` in Jenkins.

#### Job Parameters
| name | description |
Expand All @@ -12,4 +28,3 @@ This job runs integration/bwc tests for a bundle via `test.sh` in Jenkins.
| build_id | Unique identifier for a bundle build |
| architecture | CPU Architecture of bundle |
| test_run_id | Unique identifier for a test run |
| test_suite | Run a specific test suite. [integ-test, bwc-test] |
52 changes: 52 additions & 0 deletions bundle-workflow/jenkins_workflow/test/orchestrator/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
pipeline {
agent none
environment {
TEST_RUN_ID = "${BUILD_NUMBER}"
}
parameters {
string(name: 'opensearch_version')
string(name: 'build_id')
string(name: 'architecture')
}
stages {
stage('Execute Tests') {
steps {
parallel (
IntegTests: {
build job: 'integ-test',
parameters: [
string(name: 'opensearch_version', value: "${params.opensearch_version}"),
string(name: 'build_id', value: "${params.build_id}"),
string(name: 'architecture', value: "${params.architecture}"),
string(name: 'test_run_id', value: "${TEST_RUN_ID}")
]
},
PerfTests: {
build job: 'perf-test',
parameters: [
string(name: 'opensearch_version', value: "${params.opensearch_version}"),
string(name: 'build_id', value: "${params.build_id}"),
string(name: 'architecture', value: "${params.architecture}"),
string(name: 'test_run_id', value: "${TEST_RUN_ID}")
]
},
BwcTests: {
build job: 'bwc-test',
parameters: [
string(name: 'opensearch_version', value: "${params.opensearch_version}"),
string(name: 'build_id', value: "${params.build_id}"),
string(name: 'architecture', value: "${params.architecture}"),
string(name: 'test_run_id', value: "${TEST_RUN_ID}")
]
},
failFast: false)
}
}
stage('Notify') {
steps {
echo "This step is stubbed. Its purpose is to notify different channels for successful build"
}
failFast false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ pipeline {
name: 'test_run_id',
trim: true
),
string(
defaultValue: '',
name: 'test_suite',
trim: true
),
])
])
}
Expand All @@ -64,7 +59,7 @@ pipeline {
}
}
steps {
sh "./bundle-workflow/test.sh ${test_suite} --s3-bucket ${ARTIFACT_BUCKET_NAME} --opensearch-version ${opensearch_version} --build-id ${build_id} --architecture ${architecture} --test-run-id ${test_run_id}"
sh "./bundle-workflow/test.sh ${JOB_NAME} --s3-bucket ${ARTIFACT_BUCKET_NAME} --opensearch-version ${opensearch_version} --build-id ${build_id} --architecture ${architecture} --test-run-id ${test_run_id}"
}
post() {
always {
Expand Down

0 comments on commit 0ac7e2b

Please sign in to comment.