From 7e667b77bf1ac8a90e2a1ab51e3026d33d5f472b Mon Sep 17 00:00:00 2001
From: Prudhvi Godithi <pgodithi@amazon.com>
Date: Fri, 26 Jul 2024 15:30:59 -0700
Subject: [PATCH] OSD integ test bug

Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
---
 jenkins/opensearch-dashboards/integ-test.jenkinsfile   | 6 ++++--
 tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/jenkins/opensearch-dashboards/integ-test.jenkinsfile b/jenkins/opensearch-dashboards/integ-test.jenkinsfile
index c3bbfd4d7f..13c79026bc 100644
--- a/jenkins/opensearch-dashboards/integ-test.jenkinsfile
+++ b/jenkins/opensearch-dashboards/integ-test.jenkinsfile
@@ -366,7 +366,8 @@ pipeline {
                         }
                         node(agent_nodes['linux_x64']) {
                             def rc = (params.RC_NUMBER.toInteger() > 0)
-                            sh "curl -s -o test-report.yml https://ci.opensearch.org/ci/dbc/integ-test-opensearch-dashboards/${env.version}/${env.buildId}/${env.platform}/${env.architecture}/${env.distribution}/test-results/${env.BUILD_NUMBER}/integ-test/test-report.yml"
+                            sh "mkdir -p test-results-osd-${env.BUILD_NUMBER}"
+                            sh "curl -sSL https://ci.opensearch.org/ci/dbc/integ-test-opensearch-dashboards/${env.version}/${env.buildId}/${env.platform}/${env.architecture}/${env.distribution}/test-results/${env.BUILD_NUMBER}/integ-test/test-report.yml --output test-results-osd-${env.BUILD_NUMBER}/test-report.yml"
                             publishIntegTestResults(
                                 version: env.version,
                                 distributionBuildNumber: env.buildId,
@@ -377,8 +378,9 @@ pipeline {
                                 platform: env.platform,
                                 architecture: env.architecture,
                                 distribution: env.distribution,
-                                testReportManifestYml: "test-report.yml"
+                                testReportManifestYml: "test-results-osd-${env.BUILD_NUMBER}/test-report.yml"
                             )
+                            postCleanup()
                         }
                     }
                     postCleanup()
diff --git a/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy b/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy
index c8bf2d4999..3b074c4ee2 100644
--- a/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy
+++ b/tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy
@@ -115,8 +115,8 @@ class TestOpenSearchDashboardsIntegTest extends BuildPipelineTest {
                 'env PATH=$PATH  ./test.sh integ-test manifests/tests/jenkins/data/opensearch-dashboards-3.0.0-test.yml --component observabilityDashboards --test-run-id 215 --paths opensearch=/tmp/workspace/tar opensearch-dashboards=/tmp/workspace/tar --base-path DUMMY_PUBLIC_ARTIFACT_URL/dummy_job/3.0.0/215/linux/x64/tar '.toString()
         ))
         assertThat(getCommandExecutions('sh', 'report.sh'), hasItems('./report.sh manifests/tests/jenkins/data/opensearch-dashboards-3.0.0-test.yml --artifact-paths opensearch=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/215/linux/x64/tar opensearch-dashboards=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/3.0.0/215/linux/x64/tar --test-run-id 215 --test-type integ-test --base-path DUMMY_PUBLIC_ARTIFACT_URL/dummy_job/3.0.0/215/linux/x64/tar '))
-        assertCallStack().contains('{version=3.0.0, distributionBuildNumber=215, distributionBuildUrl=https://build.ci.opensearch.org/blue/organizations/jenkins/distribution-build-opensearch-dashboards/detail/distribution-build-opensearch-dashboards/215/pipeline, rc=false, jobName=dummy_job, rcNumber=null, platform=linux, architecture=x64, distribution=tar, testReportManifestYml=test-report.yml}')
-        assertCallStack().contains('curl -s -o test-report.yml https://ci.opensearch.org/ci/dbc/integ-test-opensearch-dashboards/3.0.0/215/linux/x64/tar/test-results/215/integ-test/test-report.yml')
+        assertCallStack().contains('curl -sSL https://ci.opensearch.org/ci/dbc/integ-test-opensearch-dashboards/3.0.0/215/linux/x64/tar/test-results/215/integ-test/test-report.yml --output test-results-osd-215/test-report.yml')
+        assertCallStack().contains('{version=3.0.0, distributionBuildNumber=215, distributionBuildUrl=https://build.ci.opensearch.org/blue/organizations/jenkins/distribution-build-opensearch-dashboards/detail/distribution-build-opensearch-dashboards/215/pipeline, rc=false, jobName=dummy_job, rcNumber=null, platform=linux, architecture=x64, distribution=tar, testReportManifestYml=test-results-osd-215/test-report.yml}')
     }
 
     @Test