-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ci-group arg for OSD integ tests (#567)
Signed-off-by: Rishabh Singh <sngri@amazon.com>
- Loading branch information
1 parent
e6ec7d1
commit 655ac86
Showing
22 changed files
with
462 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package jenkins.tests | ||
|
||
import org.junit.Test | ||
import static com.lesfurets.jenkins.unit.MethodCall.callArgsToString | ||
import static org.hamcrest.CoreMatchers.hasItems | ||
import static org.hamcrest.MatcherAssert.assertThat | ||
|
||
class TestRunIntegTestScriptForOSD extends BuildPipelineTest { | ||
|
||
@Test | ||
public void TestRunProcessScript() { | ||
this.registerLibTester(new RunIntegTestScriptForOSDLibTester( | ||
'reportsDashboard', | ||
'', | ||
'false', | ||
'dummy/path/opensearch', | ||
'test-bucket', | ||
'dummy/artifact/path', | ||
'x64', | ||
'tests/data/opensearch-1.3.0-build.yml', | ||
'tests/data/opensearch-1.3.0-test.yml' | ||
) | ||
) | ||
super.setUp() | ||
super.testPipeline("tests/jenkins/jobs/RunIntegTestScriptForOSD_Jenkinsfile") | ||
runScript("tests/jenkins/jobs/RunIntegTestScriptForOSD_Jenkinsfile") | ||
assertThat(getShellCommands('sh', 'test.sh'), hasItems('env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component reportsDashboard --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ')) | ||
} | ||
|
||
@Test | ||
public void TestRunProcessScriptWithoutCiGroup() { | ||
this.registerLibTester(new RunIntegTestScriptForOSDLibTester( | ||
'OpenSearch-Dashboards', | ||
'1', | ||
'false', | ||
'dummy/path/opensearch', | ||
'test-bucket', | ||
'dummy/artifact/path', | ||
'x64', | ||
'tests/data/opensearch-1.3.0-build.yml', | ||
'tests/data/opensearch-1.3.0-test.yml' | ||
) | ||
) | ||
super.setUp() | ||
super.testPipeline("tests/jenkins/jobs/RunIntegTestScriptForOSDCiGroup_Jenkinsfile") | ||
runScript("tests/jenkins/jobs/RunIntegTestScriptForOSDCiGroup_Jenkinsfile") | ||
assertThat(getShellCommands('sh','test.sh'), hasItems('env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component OpenSearch-Dashboards --ci-group 1 --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ')) | ||
} | ||
|
||
def getShellCommands(methodName, searchString) { | ||
def shCommands = helper.callStack.findAll { call -> | ||
call.methodName == methodName | ||
}.collect { call -> | ||
callArgsToString(call) | ||
}.findAll { command -> | ||
command.contains(searchString) | ||
} | ||
return shCommands | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
tests/jenkins/jobs/ProcessAndRunOsdIntegTestCiGroup_Jenkinsfile.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ProcessAndRunOsdIntegTestCiGroup_Jenkinsfile.run() | ||
ProcessAndRunOsdIntegTestCiGroup_Jenkinsfile.pipeline(groovy.lang.Closure) | ||
ProcessAndRunOsdIntegTestCiGroup_Jenkinsfile.echo(Executing on agent [label:none]) | ||
ProcessAndRunOsdIntegTestCiGroup_Jenkinsfile.stage(integ-test, groovy.lang.Closure) | ||
ProcessAndRunOsdIntegTestCiGroup_Jenkinsfile.script(groovy.lang.Closure) | ||
ProcessAndRunOsdIntegTestCiGroup_Jenkinsfile.processAndRunOsdIntegTest({localComponent=OpenSearch-Dashboards, ciGroup=1, switchUserNonRoot=false}) | ||
processAndRunOsdIntegTest.legacySCM(groovy.lang.Closure) | ||
processAndRunOsdIntegTest.library({identifier=jenkins@main, retriever=null}) | ||
processAndRunOsdIntegTest.unstash(integtest-opensearch-dashboards-307) | ||
processAndRunOsdIntegTest.echo(Not on Windows, unstash repository+artifacts) | ||
processAndRunOsdIntegTest.sh(rm -rf test-results) | ||
processAndRunOsdIntegTest.runIntegTestScript({jobName=dummy-integ-test, componentName=OpenSearch-Dashboards, buildManifest=tests/data/opensearch-1.3.0-build.yml, testManifest=tests/data/opensearch-1.3.0-test.yml, localPath=/home/user/x64, switchUserNonRoot=false, ciGroup=1}) | ||
runIntegTestScript.legacySCM(groovy.lang.Closure) | ||
runIntegTestScript.library({identifier=jenkins@main, retriever=null}) | ||
runIntegTestScript.readYaml({file=tests/data/opensearch-1.3.0-build.yml}) | ||
BuildManifest.asBoolean() | ||
BuildManifest.getArtifactArchitecture() | ||
BuildManifest.getDistribution() | ||
BuildManifest.getArtifactPlatform() | ||
runIntegTestScript.echo(Start integTest on: tar x64 linux) | ||
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: 29) | ||
BuildManifest.getArtifactRootUrl(dummy-integ-test, 29) | ||
runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy-integ-test/1.3.0/29/linux/x64/tar) | ||
runIntegTestScript.echo(User provides localPath, use local artifacts: /home/user/x64) | ||
runIntegTestScript.echo(Paths: opensearch=/home/user/x64) | ||
runIntegTestScript.echo(Base Path null/null/1.3.0/29/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 JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component OpenSearch-Dashboards --ci-group 1 --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ) | ||
runIntegTestScript.sh(env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component OpenSearch-Dashboards --ci-group 1 --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ) |
38 changes: 38 additions & 0 deletions
38
tests/jenkins/jobs/ProcessAndRunOsdIntegTest_Jenkinsfile.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ProcessAndRunOsdIntegTest_Jenkinsfile.run() | ||
ProcessAndRunOsdIntegTest_Jenkinsfile.pipeline(groovy.lang.Closure) | ||
ProcessAndRunOsdIntegTest_Jenkinsfile.echo(Executing on agent [label:none]) | ||
ProcessAndRunOsdIntegTest_Jenkinsfile.stage(integ-test, groovy.lang.Closure) | ||
ProcessAndRunOsdIntegTest_Jenkinsfile.script(groovy.lang.Closure) | ||
ProcessAndRunOsdIntegTest_Jenkinsfile.processAndRunOsdIntegTest({localComponent=OpenSearch, ciGroup=, switchUserNonRoot=false}) | ||
processAndRunOsdIntegTest.legacySCM(groovy.lang.Closure) | ||
processAndRunOsdIntegTest.library({identifier=jenkins@main, retriever=null}) | ||
processAndRunOsdIntegTest.unstash(integtest-opensearch-dashboards-307) | ||
processAndRunOsdIntegTest.echo(Not on Windows, unstash repository+artifacts) | ||
processAndRunOsdIntegTest.sh(rm -rf test-results) | ||
processAndRunOsdIntegTest.runIntegTestScript({jobName=dummy-integ-test, componentName=OpenSearch, buildManifest=tests/data/opensearch-1.3.0-build.yml, testManifest=tests/data/opensearch-1.3.0-test.yml, localPath=/home/user/x64, switchUserNonRoot=false, ciGroup=}) | ||
runIntegTestScript.legacySCM(groovy.lang.Closure) | ||
runIntegTestScript.library({identifier=jenkins@main, retriever=null}) | ||
runIntegTestScript.readYaml({file=tests/data/opensearch-1.3.0-build.yml}) | ||
BuildManifest.asBoolean() | ||
BuildManifest.getArtifactArchitecture() | ||
BuildManifest.getDistribution() | ||
BuildManifest.getArtifactPlatform() | ||
runIntegTestScript.echo(Start integTest on: tar x64 linux) | ||
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: 29) | ||
BuildManifest.getArtifactRootUrl(dummy-integ-test, 29) | ||
runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy-integ-test/1.3.0/29/linux/x64/tar) | ||
runIntegTestScript.echo(User provides localPath, use local artifacts: /home/user/x64) | ||
runIntegTestScript.echo(Paths: opensearch=/home/user/x64) | ||
runIntegTestScript.echo(Base Path null/null/1.3.0/29/linux/x64/tar) | ||
runIntegTestScript.echo(Component: OpenSearch) | ||
runIntegTestScript.echo(Switch User to Non-Root (uid=1000): false) | ||
runIntegTestScript.echo(Run command: env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ) | ||
runIntegTestScript.sh(env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component OpenSearch --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ) |
31 changes: 31 additions & 0 deletions
31
tests/jenkins/jobs/RunIntegTestScriptForOSDCiGroup_Jenkinsfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
pipeline { | ||
agent none | ||
stages { | ||
stage('integ-test') { | ||
steps { | ||
script { | ||
runIntegTestScriptForOSD( | ||
localComponent: 'OpenSearch-Dashboards', | ||
ciGroup: "1", | ||
switchUserNonRoot: 'false', | ||
artifactPathOpenSearch:'dummy/path/opensearch', | ||
artifactBucketName:'test-bucket', | ||
artifactPath:'dummy/artifact/path', | ||
distribution:'x64', | ||
buildManifest:'tests/data/opensearch-1.3.0-build.yml', | ||
testManifest:'tests/data/opensearch-1.3.0-test.yml' | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
tests/jenkins/jobs/RunIntegTestScriptForOSDCiGroup_Jenkinsfile.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
RunIntegTestScriptForOSDCiGroup_Jenkinsfile.run() | ||
RunIntegTestScriptForOSDCiGroup_Jenkinsfile.pipeline(groovy.lang.Closure) | ||
RunIntegTestScriptForOSDCiGroup_Jenkinsfile.echo(Executing on agent [label:none]) | ||
RunIntegTestScriptForOSDCiGroup_Jenkinsfile.stage(integ-test, groovy.lang.Closure) | ||
RunIntegTestScriptForOSDCiGroup_Jenkinsfile.script(groovy.lang.Closure) | ||
RunIntegTestScriptForOSDCiGroup_Jenkinsfile.runIntegTestScriptForOSD({localComponent=OpenSearch-Dashboards, ciGroup=1, switchUserNonRoot=false, artifactPathOpenSearch=dummy/path/opensearch, artifactBucketName=test-bucket, artifactPath=dummy/artifact/path, distribution=x64, buildManifest=tests/data/opensearch-1.3.0-build.yml, testManifest=tests/data/opensearch-1.3.0-test.yml}) | ||
runIntegTestScriptForOSD.legacySCM(groovy.lang.Closure) | ||
runIntegTestScriptForOSD.library({identifier=jenkins@main, retriever=null}) | ||
runIntegTestScriptForOSD.unstash(integtest-opensearch-dashboards-307) | ||
runIntegTestScriptForOSD.echo(Not on Windows, unstash repository+artifacts) | ||
runIntegTestScriptForOSD.sh(rm -rf test-results) | ||
runIntegTestScriptForOSD.runIntegTestScript({jobName=dummy-integ-test, componentName=OpenSearch-Dashboards, buildManifest=tests/data/opensearch-1.3.0-build.yml, testManifest=tests/data/opensearch-1.3.0-test.yml, localPath=/home/user/x64, switchUserNonRoot=false, ciGroup=1}) | ||
runIntegTestScript.legacySCM(groovy.lang.Closure) | ||
runIntegTestScript.library({identifier=jenkins@main, retriever=null}) | ||
runIntegTestScript.readYaml({file=tests/data/opensearch-1.3.0-build.yml}) | ||
BuildManifest.asBoolean() | ||
BuildManifest.getArtifactArchitecture() | ||
BuildManifest.getDistribution() | ||
BuildManifest.getArtifactPlatform() | ||
runIntegTestScript.echo(Start integTest on: tar x64 linux) | ||
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: 29) | ||
BuildManifest.getArtifactRootUrl(dummy-integ-test, 29) | ||
runIntegTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy-integ-test/1.3.0/29/linux/x64/tar) | ||
runIntegTestScript.echo(User provides localPath, use local artifacts: /home/user/x64) | ||
runIntegTestScript.echo(Paths: opensearch=/home/user/x64) | ||
runIntegTestScript.echo(Base Path null/null/1.3.0/29/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 JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component OpenSearch-Dashboards --ci-group 1 --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ) | ||
runIntegTestScript.sh(env PATH=$PATH JAVA_HOME=/opt/java/openjdk-11 ./test.sh integ-test manifests/tests/data/opensearch-1.3.0-test.yml --component OpenSearch-Dashboards --ci-group 1 --test-run-id null --paths opensearch=/home/user/x64 --base-path null/null/1.3.0/29/linux/x64/tar ) |
Oops, something went wrong.