diff --git a/build.gradle b/build.gradle index 5af66919a..54e691cd4 100644 --- a/build.gradle +++ b/build.gradle @@ -120,7 +120,7 @@ jacocoTestReport { } } -String version = '5.9.0' +String version = '5.9.1' task updateVersion { doLast { diff --git a/tests/jenkins/TestRunIntegTestScript.groovy b/tests/jenkins/TestRunIntegTestScript.groovy index 1597eb994..7ede2e7da 100644 --- a/tests/jenkins/TestRunIntegTestScript.groovy +++ b/tests/jenkins/TestRunIntegTestScript.groovy @@ -22,12 +22,12 @@ class TestRunIntegTestScript extends BuildPipelineTest { @Test public void TestRunIntegTestScript() { this.registerLibTester(new RunIntegTestScriptLibTester( - 'dummy_job', - 'OpenSearch', - 'tests/data/opensearch-1.3.0-build.yml', - 'tests/data/opensearch-1.3.0-test.yml', - '', - '', + 'dummy_job', + 'OpenSearch', + 'tests/data/opensearch-1.3.0-build.yml', + 'tests/data/opensearch-1.3.0-test.yml', + '', + '', ) ) super.setUp() @@ -37,12 +37,12 @@ class TestRunIntegTestScript extends BuildPipelineTest { @Test public void TestRunIntegTestScript_OpenSearch_Dashboards() { this.registerLibTester(new RunIntegTestScriptLibTester( - 'dummy_job', - 'functionalTestDashboards', - 'tests/data/opensearch-dashboards-1.2.0-build.yml', - 'tests/data/opensearch-dashboards-1.2.0-test.yml', - '', - '', + 'dummy_job', + 'functionalTestDashboards', + 'tests/data/opensearch-dashboards-1.2.0-build.yml', + 'tests/data/opensearch-dashboards-1.2.0-test.yml', + '', + '', ) ) super.setUp() @@ -52,12 +52,12 @@ class TestRunIntegTestScript extends BuildPipelineTest { @Test public void TestRunIntegTestScript_LocalPath() { this.registerLibTester(new RunIntegTestScriptLibTester( - 'dummy_job', - 'OpenSearch', - 'tests/data/opensearch-1.3.0-build.yml', - 'tests/data/opensearch-1.3.0-test.yml', - 'tests/jenkins/artifacts/tar', - '', + 'dummy_job', + 'OpenSearch-Dashboards', + 'tests/data/opensearch-dashboards-1.2.0-build.yml', + 'tests/data/opensearch-dashboards-1.2.0-test.yml', + 'tests/jenkins/artifacts/tar', + '', ) ) super.setUp() @@ -67,12 +67,12 @@ class TestRunIntegTestScript extends BuildPipelineTest { @Test public void TestRunIntegTestScript_LocalPath_Switch_Non_Root() { this.registerLibTester(new RunIntegTestScriptLibTester( - 'distribution-build-opensearch', - 'OpenSearch', - 'tests/data/opensearch-1.3.0-build.yml', - 'tests/data/opensearch-1.3.0-test.yml', - 'tests/jenkins/artifacts/tar', - 'true', + 'dummy_job', + 'OpenSearch', + 'tests/data/opensearch-1.3.0-build.yml', + 'tests/data/opensearch-1.3.0-test.yml', + 'tests/jenkins/artifacts/tar', + 'true', ) ) super.setUp() @@ -100,28 +100,28 @@ class TestRunIntegTestScript extends BuildPipelineTest { void 'IntegTest LocalPath SwitchNonRoot=false'() { this.registerLibTester(new RunIntegTestScriptLibTester( 'dummy_job', - 'OpenSearch', - 'tests/data/opensearch-1.3.0-build.yml', - 'tests/data/opensearch-1.3.0-test.yml', + 'OpenSearch-Dashboards', + 'tests/data/opensearch-dashboards-1.2.0-build.yml', + 'tests/data/opensearch-dashboards-1.2.0-test.yml', 'tests/jenkins/artifacts/tar', - 'false' + 'false', ) ) super.setUp() runScript("tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile") - assertThat(getShellCommands('sh', 'test.sh'), hasItems('env PATH=$PATH ./test.sh integ-test tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id 987 --paths opensearch=tests/jenkins/artifacts/tar --base-path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar ')) + assertThat(getShellCommands('sh', 'test.sh'), hasItems('env PATH=$PATH ./test.sh integ-test tests/data/opensearch-dashboards-1.2.0-test.yml --component OpenSearch-Dashboards --test-run-id 987 --paths opensearch=tests/jenkins/artifacts/tar opensearch-dashboards=tests/jenkins/artifacts/tar --base-path https://dummy_link/dummy_integ_test/1.2.0/215/linux/x64/tar ')) } @Test void 'IntegTest LocalPath SwitchNonRoot=true with JAVA_HOME'() { this.registerLibTester(new RunIntegTestScriptLibTester( - 'distribution-build-opensearch', + 'dummy_job', 'OpenSearch', 'tests/data/opensearch-1.3.0-build.yml', 'tests/data/opensearch-1.3.0-test.yml', 'tests/jenkins/artifacts/tar', - 'true' + 'true', ) ) super.setUp() diff --git a/tests/jenkins/jobs/RunIntegTestScript_Jenkinsfile.txt b/tests/jenkins/jobs/RunIntegTestScript_Jenkinsfile.txt index 56174e473..825a109b3 100644 --- a/tests/jenkins/jobs/RunIntegTestScript_Jenkinsfile.txt +++ b/tests/jenkins/jobs/RunIntegTestScript_Jenkinsfile.txt @@ -12,7 +12,14 @@ BuildManifest.getDistribution() BuildManifest.getArtifactPlatform() runIntegTestScript.echo(Start integTest on: tar x64 linux) - runIntegTestScript.echo(Possible Java Home: ) + runIntegTestScript.detectTestDockerAgent({testManifest=tests/data/opensearch-1.3.0-test.yml}) + detectTestDockerAgent.legacySCM(groovy.lang.Closure) + detectTestDockerAgent.library({identifier=jenkins@main, retriever=null}) + detectTestDockerAgent.readYaml({file=tests/data/opensearch-1.3.0-test.yml}) + TestManifest.asBoolean() + detectTestDockerAgent.echo(Using Docker image opensearchstaging/ci-runner:ci-runner-centos7-v1 (-e JAVA_HOME=/opt/java/openjdk-11)) + detectTestDockerAgent.echo(Using java version openjdk-11) + runIntegTestScript.echo(Possible Java Home: JAVA_HOME=/opt/java/openjdk-11) runIntegTestScript.echo(Build Id: c3ff7a232d25403fa8cc14c97799c323) BuildManifest.getArtifactRootUrl(dummy_job, c3ff7a232d25403fa8cc14c97799c323) runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy_job/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar) @@ -21,5 +28,5 @@ runIntegTestScript.echo(Base Path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar) runIntegTestScript.echo(Component: OpenSearch) runIntegTestScript.echo(Switch User to Non-Root (uid=1000): false) - runIntegTestScript.echo(Run command: env PATH=$PATH ./test.sh integ-test tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id 987 --paths opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar --base-path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar ) - runIntegTestScript.sh(env PATH=$PATH ./test.sh integ-test tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id 987 --paths opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar --base-path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar ) + runIntegTestScript.echo(Run command: env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id 987 --paths opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar --base-path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar ) + runIntegTestScript.sh(env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id 987 --paths opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar --base-path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar ) diff --git a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile index 36a10de2f..3d528e989 100644 --- a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile +++ b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile @@ -15,9 +15,9 @@ pipeline { script { runIntegTestScript( jobName: 'dummy_job', - componentName: 'OpenSearch', - buildManifest: 'tests/data/opensearch-1.3.0-build.yml', - testManifest: 'tests/data/opensearch-1.3.0-test.yml', + componentName: 'OpenSearch-Dashboards', + buildManifest: 'tests/data/opensearch-dashboards-1.2.0-build.yml', + testManifest: 'tests/data/opensearch-dashboards-1.2.0-test.yml', localPath: 'tests/jenkins/artifacts/tar', ) } diff --git a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile.txt b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile.txt index a751711c9..972fa002c 100644 --- a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile.txt +++ b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Jenkinsfile.txt @@ -3,23 +3,23 @@ RunIntegTestScript_LocalPath_Jenkinsfile.echo(Executing on agent [label:none]) RunIntegTestScript_LocalPath_Jenkinsfile.stage(integ-test, groovy.lang.Closure) RunIntegTestScript_LocalPath_Jenkinsfile.script(groovy.lang.Closure) - RunIntegTestScript_LocalPath_Jenkinsfile.runIntegTestScript({jobName=dummy_job, componentName=OpenSearch, buildManifest=tests/data/opensearch-1.3.0-build.yml, testManifest=tests/data/opensearch-1.3.0-test.yml, localPath=tests/jenkins/artifacts/tar}) + RunIntegTestScript_LocalPath_Jenkinsfile.runIntegTestScript({jobName=dummy_job, componentName=OpenSearch-Dashboards, buildManifest=tests/data/opensearch-dashboards-1.2.0-build.yml, testManifest=tests/data/opensearch-dashboards-1.2.0-test.yml, localPath=tests/jenkins/artifacts/tar}) runIntegTestScript.legacySCM(groovy.lang.Closure) runIntegTestScript.library({identifier=jenkins@main, retriever=null}) - runIntegTestScript.readYaml({file=tests/data/opensearch-1.3.0-build.yml}) + runIntegTestScript.readYaml({file=tests/data/opensearch-dashboards-1.2.0-build.yml}) BuildManifest.asBoolean() BuildManifest.getArtifactArchitecture() BuildManifest.getDistribution() BuildManifest.getArtifactPlatform() runIntegTestScript.echo(Start integTest on: tar x64 linux) runIntegTestScript.echo(Possible Java Home: ) - runIntegTestScript.echo(Build Id: c3ff7a232d25403fa8cc14c97799c323) - BuildManifest.getArtifactRootUrl(dummy_job, c3ff7a232d25403fa8cc14c97799c323) - runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy_job/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar) + runIntegTestScript.echo(Build Id: 215) + BuildManifest.getArtifactRootUrl(dummy_job, 215) + runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy_job/1.2.0/215/linux/x64/tar) runIntegTestScript.echo(User provides localPath, use local artifacts: tests/jenkins/artifacts/tar) - runIntegTestScript.echo(Paths: opensearch=tests/jenkins/artifacts/tar) - runIntegTestScript.echo(Base Path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar) - runIntegTestScript.echo(Component: OpenSearch) + runIntegTestScript.echo(Paths: opensearch=tests/jenkins/artifacts/tar opensearch-dashboards=tests/jenkins/artifacts/tar) + runIntegTestScript.echo(Base Path https://dummy_link/dummy_integ_test/1.2.0/215/linux/x64/tar) + runIntegTestScript.echo(Component: OpenSearch-Dashboards) runIntegTestScript.echo(Switch User to Non-Root (uid=1000): false) - runIntegTestScript.echo(Run command: env PATH=$PATH ./test.sh integ-test tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id 987 --paths opensearch=tests/jenkins/artifacts/tar --base-path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar ) - runIntegTestScript.sh(env PATH=$PATH ./test.sh integ-test tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id 987 --paths opensearch=tests/jenkins/artifacts/tar --base-path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar ) + runIntegTestScript.echo(Run command: env PATH=$PATH ./test.sh integ-test tests/data/opensearch-dashboards-1.2.0-test.yml --component OpenSearch-Dashboards --test-run-id 987 --paths opensearch=tests/jenkins/artifacts/tar opensearch-dashboards=tests/jenkins/artifacts/tar --base-path https://dummy_link/dummy_integ_test/1.2.0/215/linux/x64/tar ) + runIntegTestScript.sh(env PATH=$PATH ./test.sh integ-test tests/data/opensearch-dashboards-1.2.0-test.yml --component OpenSearch-Dashboards --test-run-id 987 --paths opensearch=tests/jenkins/artifacts/tar opensearch-dashboards=tests/jenkins/artifacts/tar --base-path https://dummy_link/dummy_integ_test/1.2.0/215/linux/x64/tar ) diff --git a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile index b3801a110..02579aeeb 100644 --- a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile +++ b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile @@ -14,7 +14,7 @@ pipeline { steps { script { runIntegTestScript( - jobName: 'distribution-build-opensearch', + jobName: 'dummy_job', componentName: 'OpenSearch', buildManifest: 'tests/data/opensearch-1.3.0-build.yml', testManifest: 'tests/data/opensearch-1.3.0-test.yml', diff --git a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.txt b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.txt index 89ced635b..3b633e010 100644 --- a/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.txt +++ b/tests/jenkins/jobs/RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.txt @@ -3,7 +3,7 @@ RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.echo(Executing on agent [label:none]) RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.stage(integ-test, groovy.lang.Closure) RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.script(groovy.lang.Closure) - RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.runIntegTestScript({jobName=distribution-build-opensearch, componentName=OpenSearch, buildManifest=tests/data/opensearch-1.3.0-build.yml, testManifest=tests/data/opensearch-1.3.0-test.yml, localPath=tests/jenkins/artifacts/tar, switchUserNonRoot=true}) + RunIntegTestScript_LocalPath_Switch_Non_Root_Jenkinsfile.runIntegTestScript({jobName=dummy_job, componentName=OpenSearch, buildManifest=tests/data/opensearch-1.3.0-build.yml, testManifest=tests/data/opensearch-1.3.0-test.yml, localPath=tests/jenkins/artifacts/tar, switchUserNonRoot=true}) runIntegTestScript.legacySCM(groovy.lang.Closure) runIntegTestScript.library({identifier=jenkins@main, retriever=null}) runIntegTestScript.readYaml({file=tests/data/opensearch-1.3.0-build.yml}) @@ -21,8 +21,8 @@ detectTestDockerAgent.echo(Using java version openjdk-11) runIntegTestScript.echo(Possible Java Home: JAVA_HOME=/opt/java/openjdk-11) runIntegTestScript.echo(Build Id: c3ff7a232d25403fa8cc14c97799c323) - BuildManifest.getArtifactRootUrl(distribution-build-opensearch, c3ff7a232d25403fa8cc14c97799c323) - runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar) + BuildManifest.getArtifactRootUrl(dummy_job, c3ff7a232d25403fa8cc14c97799c323) + runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy_job/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar) runIntegTestScript.echo(User provides localPath, use local artifacts: tests/jenkins/artifacts/tar) runIntegTestScript.echo(Paths: opensearch=tests/jenkins/artifacts/tar) runIntegTestScript.echo(Base Path https://dummy_link/dummy_integ_test/1.3.0/c3ff7a232d25403fa8cc14c97799c323/linux/x64/tar) diff --git a/vars/runIntegTestScript.groovy b/vars/runIntegTestScript.groovy index 5e44421dd..9cb366672 100644 --- a/vars/runIntegTestScript.groovy +++ b/vars/runIntegTestScript.groovy @@ -15,15 +15,15 @@ void call(Map args = [:]) { String architecture = buildManifest.getArtifactArchitecture() String distribution = buildManifest.getDistribution() String platform = buildManifest.getArtifactPlatform() + String filename = buildManifest.build.getFilename() echo "Start integTest on: " + distribution + " " + architecture + " " + platform - def javaVersion = (jobName.equals('distribution-build-opensearch')) ? detectTestDockerAgent(testManifest: args.testManifest).javaVersion : '' - String javaHomeCommand = (jobName.equals('distribution-build-opensearch') && ! javaVersion.equals('')) ? "JAVA_HOME=/opt/java/${javaVersion}" : '' - if (platform.equals('windows')) { // Windows use scoop to switch the Java Version + def javaVersion = (filename == 'opensearch') ? detectTestDockerAgent(testManifest: args.testManifest).javaVersion : '' + String javaHomeCommand = (javaVersion != '' && platform != 'windows') ? "JAVA_HOME=/opt/java/${javaVersion}" : '' + if (filename == 'opensearch' && platform == 'windows') { // Windows use scoop to switch the Java Version String javaVersionNumber = javaVersion.replaceAll("[^0-9]", "") // Only get number echo("Switching to Java ${javaVersionNumber} on Windows Docker Container") sh("scoop reset `scoop list jdk | grep ${javaVersionNumber} | head -1 | cut -d ' ' -f1`") - javaHomeCommand = '' } echo "Possible Java Home: ${javaHomeCommand}"