diff --git a/build.gradle b/build.gradle index cb16eb51..53a65ded 100644 --- a/build.gradle +++ b/build.gradle @@ -127,7 +127,7 @@ jacocoTestReport { } } -String version = '6.6.2' +String version = '6.7.0' task updateVersion { doLast { diff --git a/vars/publishDistributionBuildResults.groovy b/vars/publishDistributionBuildResults.groovy index 9871fc58..ed601bbc 100644 --- a/vars/publishDistributionBuildResults.groovy +++ b/vars/publishDistributionBuildResults.groovy @@ -14,7 +14,6 @@ * @param args.rcNumber - The RC number against which the integration test is executed. * @param args.failureMessages - Failure message retrieved from buildFailureMessage() method. * @param args.passMessages - Passing message retrieved from buildFailureMessage() method. Used to get the passed components list. - * @param args.distribution - The distribution of the integration test build. Used to get the failed components list. * @param args.componentCategory - The OpenSearch or OpenSearch Dashboards plugin * @param args.inputManifestPath - Path to input manifest. */ diff --git a/vars/publishIntegTestResults.groovy b/vars/publishIntegTestResults.groovy index b192da9e..10b3b826 100644 --- a/vars/publishIntegTestResults.groovy +++ b/vars/publishIntegTestResults.groovy @@ -9,7 +9,6 @@ /** Library to fetch the failing Integration test details at the end of Integration Test Jenkins build and index the results to OpenSearch Metrics cluster. * - * @param Map args = [:] args A map of the following parameters. * @param args.version - The version against which the integration test is executed. * @param args.distributionBuildNumber - The jenkins distribution build number. @@ -20,7 +19,6 @@ * @param args.architecture - The architecture of the integration test build. * @param args.distribution - The distribution of the integration test build. * @param args.testReportManifestYml - The generated test report YAML file using test report workflow. - */ import groovy.json.JsonOutput @@ -28,6 +26,29 @@ import java.text.SimpleDateFormat import java.util.Date void call(Map args = [:]) { + + + // To ensure the test TestOpenSearchIntegTest from opensearch-build repo passes. + def isNullOrEmpty = { str -> + str == null || (str instanceof String && str.trim().isEmpty()) + } + if (isNullOrEmpty(args.version) || isNullOrEmpty(args.distributionBuildNumber) || isNullOrEmpty(args.distributionBuildUrl) || + isNullOrEmpty(args.rcNumber) || isNullOrEmpty(args.rc) || isNullOrEmpty(args.platform) || + isNullOrEmpty(args.architecture) || isNullOrEmpty(args.distribution) || isNullOrEmpty(args.testReportManifestYml)) { + println("At least one argument is null or empty:") + println("version: ${args.version}") + println("distributionBuildNumber: ${args.distributionBuildNumber}") + println("distributionBuildUrl: ${args.distributionBuildUrl}") + println("rcNumber: ${args.rcNumber}") + println("rc: ${args.rc}") + println("platform: ${args.platform}") + println("architecture: ${args.architecture}") + println("distribution: ${args.distribution}") + println("testReportManifestYml: ${args.testReportManifestYml}") + return null + } + + def version = args.version.toString() def integTestBuildNumber = currentBuild.number def integTestBuildUrl = env.RUN_DISPLAY_URL @@ -76,6 +97,8 @@ void call(Map args = [:]) { indexFailedTestData(indexName, "test-records.json") } +boolean argCheck(String str) { return (str == null || str.allWhitespace || str.isEmpty()) } + void indexFailedTestData(indexName, testRecordsFile) { withCredentials([ string(credentialsId: 'jenkins-health-metrics-account-number', variable: 'METRICS_HOST_ACCOUNT'), @@ -217,3 +240,4 @@ def generateJson(component, version, integTestBuildNumber, integTestBuildUrl, di ] return JsonOutput.toJson(json) } + diff --git a/vars/uploadMinSnapshotsToS3.groovy b/vars/uploadMinSnapshotsToS3.groovy index ab3520c0..e185a02b 100644 --- a/vars/uploadMinSnapshotsToS3.groovy +++ b/vars/uploadMinSnapshotsToS3.groovy @@ -52,11 +52,16 @@ void call(Map args = [:]) { echo("Start copying files: version-${version} architecture-${architecture} platform-${platform} buildid-${id} distribution-${distribution} extension-${extension}") + String sedCmd = "sed" + if (platform == "darwin") { + sedCmd = "gsed" + } + sh """ cp -v ${srcDir}/${baseName}.${extension} ${srcDir}/${baseName}-latest.${extension} cp -v ${srcDir}/${baseName}.${extension}.sha512 ${srcDir}/${baseName}-latest.${extension}.sha512 cp -v ${srcDir}/../manifest.yml ${srcDir}/${baseName}-latest.${extension}.build-manifest.yml - sed -i "s/.${extension}/-latest.${extension}/g" ${srcDir}/${baseName}-latest.${extension}.sha512 + ${sedCmd} -i "s/.${extension}/-latest.${extension}/g" ${srcDir}/${baseName}-latest.${extension}.sha512 """ withCredentials([ string(credentialsId: 'jenkins-artifact-promotion-role', variable: 'ARTIFACT_PROMOTION_ROLE_NAME'),