Skip to content

Commit

Permalink
Update nits and suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <[email protected]>
  • Loading branch information
Divyaasm committed May 3, 2023
1 parent f69b1f0 commit c5270eb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
16 changes: 10 additions & 6 deletions jenkins/opensearch-dashboards/integ-test.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pipeline {
)
string(
name: 'BUILD_MANIFEST_URL',
description: 'The build manifest URL OpenSearch Dashboards, e.g. "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.5.0/5367/linux/x64/tar/builds/opensearch-dashboards/manifest.yml".',
description: 'The build manifest URL for OpenSearch Dashboards, e.g. https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.5.0/5367/linux/x64/tar/builds/opensearch-dashboards/manifest.yml.',
trim: true
)
string(
Expand All @@ -56,7 +56,7 @@ pipeline {
}
stages {
stage('verify-parameters') {
agent { label agent_nodes["x64"]}
agent { label agent_nodes["x64"] }
steps {
script {
if (TEST_MANIFEST == '' || !fileExists("manifests/${TEST_MANIFEST}")) {
Expand All @@ -69,6 +69,11 @@ pipeline {
error("Integration Tests failed to start. Build manifest url was not provided.")
}

if (BUILD_MANIFEST_URL_OPENSEARCH == '') {
currentBuild.result = 'ABORTED'
error("Integration Tests failed to start. Build manifest url OpenSearch was not provided.")
}

downloadBuildManifest(
url: BUILD_MANIFEST_URL,
path: BUILD_MANIFEST
Expand Down Expand Up @@ -126,7 +131,7 @@ pipeline {
echo "componentList: ${componentList}"

for (component_check in componentList) {
if (! componentDefaultList.contains(component_check)) {
if (!componentDefaultList.contains(component_check)) {
error("${component_check} is not in build manifest: ${componentDefaultList}, exit 1")
}
}
Expand Down Expand Up @@ -167,16 +172,15 @@ pipeline {
def local_component_index = componentList.indexOf(local_component)
def wait_seconds = local_component_index * 10

echo "Add Component: ${local_component}"
echo "Adding Component: ${local_component}"
componentTests["Run Integtest ${local_component}"] = {
// Using scripted pipelines to trigger dynamic parallel stages
timeout(time: 2, unit: 'HOURS') {
node(AGENT_LABEL) {
docker.withRegistry('https://public.ecr.aws/') {
docker.image(docker_images["$distribution"]).inside(docker_args["$distribution"]) {
try {
stage("Run Integtest ${local_component}") {
echo "Component Name: ${local_component}"
stage("${local_component}") {
// Jenkins tend to not clean up workspace at times even though ws clean is called
// Due to docker is mounting the agent directory so it can communicated with the agent
// This sometimes causes the workspace to retain last run test-results and ends with build failures
Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class TestOpenSearchDashboardsIntegTest extends BuildPipelineTest {
}

@Test
void integTests_runs_consistently() {
void integTests_runs_for_all_components() {
super.testPipeline('jenkins/opensearch-dashboards/integ-test.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/opensearch-dashboards/integ-test.jenkinsfile')
assertThat(getCommandExecutions('sh', 'test.sh'), hasItems(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,19 @@
downloadFromS3.s3Download({file=/tmp/workspace/artifacts, bucket=DUMMY_ARTIFACT_BUCKET_NAME, path=distribution-build-opensearch-dashboards/1.2.0/215/linux/x64/tar/, force=true})
integ-test.sh(cp -a /tmp/workspace/artifacts/distribution-build-opensearch-dashboards/1.2.0/215/linux/x64/tar /tmp/workspace)
integ-test.stash({includes=**, name=integtest-opensearch-dashboards-215})
integ-test.echo(Add Component: ganttChartDashboards)
integ-test.echo(Add Component: indexManagementDashboards)
integ-test.echo(Add Component: anomalyDetectionDashboards)
integ-test.echo(Add Component: OpenSearch-Dashboards)
integ-test.echo(Add Component: securityDashboards)
integ-test.echo(Add Component: functionalTestDashboards)
integ-test.echo(Add Component: alertingDashboards)
integ-test.echo(Add Component: queryWorkbenchDashboards)
integ-test.echo(Add Component: reportsDashboards)
integ-test.echo(Add Component: observabilityDashboards)
integ-test.echo(Adding Component: ganttChartDashboards)
integ-test.echo(Adding Component: indexManagementDashboards)
integ-test.echo(Adding Component: anomalyDetectionDashboards)
integ-test.echo(Adding Component: OpenSearch-Dashboards)
integ-test.echo(Adding Component: securityDashboards)
integ-test.echo(Adding Component: functionalTestDashboards)
integ-test.echo(Adding Component: alertingDashboards)
integ-test.echo(Adding Component: queryWorkbenchDashboards)
integ-test.echo(Adding Component: reportsDashboards)
integ-test.echo(Adding Component: observabilityDashboards)
integ-test.parallel({Run Integtest ganttChartDashboards=groovy.lang.Closure, Run Integtest indexManagementDashboards=groovy.lang.Closure, Run Integtest anomalyDetectionDashboards=groovy.lang.Closure, Run Integtest OpenSearch-Dashboards=groovy.lang.Closure, Run Integtest securityDashboards=groovy.lang.Closure, Run Integtest functionalTestDashboards=groovy.lang.Closure, Run Integtest alertingDashboards=groovy.lang.Closure, Run Integtest queryWorkbenchDashboards=groovy.lang.Closure, Run Integtest reportsDashboards=groovy.lang.Closure, Run Integtest observabilityDashboards=groovy.lang.Closure})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: ganttChartDashboards)
integ-test.sh(echo ganttChartDashboards with index 0 will sleep 0 seconds to reduce load && sleep 0)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -120,7 +119,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: indexManagementDashboards)
integ-test.sh(echo indexManagementDashboards with index 1 will sleep 10 seconds to reduce load && sleep 10)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -164,7 +162,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: anomalyDetectionDashboards)
integ-test.sh(echo anomalyDetectionDashboards with index 2 will sleep 20 seconds to reduce load && sleep 20)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -208,7 +205,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: OpenSearch-Dashboards)
integ-test.sh(echo OpenSearch-Dashboards with index 3 will sleep 30 seconds to reduce load && sleep 30)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -252,7 +248,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: securityDashboards)
integ-test.sh(echo securityDashboards with index 4 will sleep 40 seconds to reduce load && sleep 40)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -296,7 +291,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: functionalTestDashboards)
integ-test.sh(echo functionalTestDashboards with index 5 will sleep 50 seconds to reduce load && sleep 50)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -340,7 +334,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: alertingDashboards)
integ-test.sh(echo alertingDashboards with index 6 will sleep 60 seconds to reduce load && sleep 60)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -384,7 +377,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: queryWorkbenchDashboards)
integ-test.sh(echo queryWorkbenchDashboards with index 7 will sleep 70 seconds to reduce load && sleep 70)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -428,7 +420,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: reportsDashboards)
integ-test.sh(echo reportsDashboards with index 8 will sleep 80 seconds to reduce load && sleep 80)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down Expand Up @@ -472,7 +463,6 @@
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
integ-test.timeout({time=2, unit=HOURS}, groovy.lang.Closure)
integ-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
integ-test.echo(Component Name: observabilityDashboards)
integ-test.sh(echo observabilityDashboards with index 9 will sleep 90 seconds to reduce load && sleep 90)
integ-test.unstash(integtest-opensearch-dashboards-215)
integ-test.sh(rm -rf test-results)
Expand Down

0 comments on commit c5270eb

Please sign in to comment.