From c5270ebdc447d8b9bad95ff8467db55e880f191e Mon Sep 17 00:00:00 2001 From: Divya Madala Date: Wed, 3 May 2023 12:59:45 -0700 Subject: [PATCH] Update nits and suggestions Signed-off-by: Divya Madala --- .../integ-test.jenkinsfile | 16 ++++++---- .../TestOpenSearchDashboardsIntegTest.groovy | 2 +- .../integ-test.jenkinsfile.txt | 30 +++++++------------ 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/jenkins/opensearch-dashboards/integ-test.jenkinsfile b/jenkins/opensearch-dashboards/integ-test.jenkinsfile index fe80e5934a..686d351bca 100644 --- a/jenkins/opensearch-dashboards/integ-test.jenkinsfile +++ b/jenkins/opensearch-dashboards/integ-test.jenkinsfile @@ -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( @@ -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}")) { @@ -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 @@ -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") } } @@ -167,7 +172,7 @@ 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') { @@ -175,8 +180,7 @@ pipeline { 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 diff --git a/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy b/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy index 7c7b3b4445..aabad0b5f2 100644 --- a/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy +++ b/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy @@ -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( diff --git a/tests/jenkins/jenkinsjob-regression-files/opensearch-dashboards/integ-test.jenkinsfile.txt b/tests/jenkins/jenkinsjob-regression-files/opensearch-dashboards/integ-test.jenkinsfile.txt index 4bc82548ee..2b52b4d977 100644 --- a/tests/jenkins/jenkinsjob-regression-files/opensearch-dashboards/integ-test.jenkinsfile.txt +++ b/tests/jenkins/jenkinsjob-regression-files/opensearch-dashboards/integ-test.jenkinsfile.txt @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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)