-
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
Signed-off-by: Rishabh Singh <[email protected]>
- Loading branch information
1 parent
42c8c5d
commit 3e2eb6a
Showing
21 changed files
with
424 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* 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( | ||
'OpenSearch', | ||
'', | ||
'false' | ||
) | ||
) | ||
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 OpenSearch --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' | ||
) | ||
) | ||
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 ) |
25 changes: 25 additions & 0 deletions
25
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,25 @@ | ||
/* | ||
* 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' | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
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}) | ||
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 ) |
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,25 @@ | ||
/* | ||
* 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', | ||
ciGroup: "", | ||
switchUserNonRoot: 'false' | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.