Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to run integration tests in Jenkins #423

Merged
merged 13 commits into from
Sep 15, 2021
Merged
8 changes: 3 additions & 5 deletions bundle-workflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ Tests the OpenSearch bundle.

This workflow contains integration, backwards compatibility and performance tests.

The following example kicks off all test suites for a distribution of OpenSearch 1.1.0.

```bash
./bundle-workflow/test.sh manifests/opensearch-1.1.0.yml
./bundle-workflow/test.sh integ-test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which manifest?

Copy link
Member Author

@saratvemulapalli saratvemulapalli Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the question was what manifest do we use for integ tests. If it is, it uses build and bundle manifest and it fetches it by itself.
I would like to have #456 update this readme to add the rest of the new parameters to this readme.

```

The following options are available.
Expand All @@ -118,11 +116,11 @@ The following options are available.

#### Integration Tests

This step runs integration tests invoking `integtest.sh` in each component from bundle manifest.
This step runs integration tests invoking `run_integ_test.py` in each component from bundle manifest.

#### Backwards Compatibility Tests

This step run backward compatibility invoking `bwctest.sh` in each component from bundle manifest.
TODO

#### Performance Tests

Expand Down
72 changes: 72 additions & 0 deletions bundle-workflow/jenkins_workflow/integtest/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
pipeline {
agent none
tools {
jdk "JDK14"
maven "maven-3.8.2"
}
stages {
stage('Parameters') {
steps {
script {
properties([
parameters([
string(
defaultValue: '',
name: 's3_bucket',
trim: true
saratvemulapalli marked this conversation as resolved.
Show resolved Hide resolved
),
string(
defaultValue: '',
name: 'opensearch_version',
trim: true
),
string(
defaultValue: '',
name: 'build_id',
trim: true
),
string(
defaultValue: '',
name: 'test_run_id',
trim: true
),
string(
defaultValue: '',
name: 'architecture',
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 --s3-bucket ${s3_bucket} --opensearch-version ${opensearch_version} --build-id ${build_id} --architecture ${architecture} --test-run-id ${test_run_id}"
saratvemulapalli marked this conversation as resolved.
Show resolved Hide resolved
}
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_integration.sh` in Jenkins.
saratvemulapalli marked this conversation as resolved.
Show resolved Hide resolved

#### Job Parameters
| name | description |
|-------------|------------------------------------------------------------|
| s3_bucket | Artifact S3 bucket |
| 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.

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

DIR="$(dirname "$0")"
"$DIR/run.sh" "$DIR/src/test.py" $@
case $1 in
saratvemulapalli marked this conversation as resolved.
Show resolved Hide resolved
"integ-test")
"$DIR/run.sh" "$DIR/src/run_integ_test.py" "${@:2}"
;;
*)
echo "Invalid Test suite"
;;
esac