-
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 support to run ad-hoc benchmark using distribution url (#326)
Signed-off-by: Rishabh Singh <[email protected]>
- Loading branch information
1 parent
5575d70
commit 9704cbe
Showing
12 changed files
with
272 additions
and
25 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,83 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import jenkins.tests.BuildPipelineTest | ||
import org.junit.Before | ||
import org.junit.Test | ||
|
||
import static com.lesfurets.jenkins.unit.MethodCall.callArgsToString | ||
import static org.hamcrest.CoreMatchers.equalTo | ||
import static org.hamcrest.CoreMatchers.hasItem | ||
import static org.hamcrest.MatcherAssert.assertThat | ||
|
||
class TestRunBenchmarkTestScriptNoManifest extends BuildPipelineTest { | ||
|
||
@Before | ||
void setUp() { | ||
this.registerLibTester(new RunBenchmarkTestScriptLibTester( | ||
'', | ||
'https://www.exmaple.com/example.tar.gz', | ||
'3.0.0', | ||
'true', | ||
'nyc_taxis', | ||
'true', | ||
'false', | ||
'true', | ||
'false', | ||
'', | ||
'', | ||
'r5.8xlarge', | ||
'', | ||
'', | ||
'cluster.indices.replication.strategy:SEGMENT', | ||
'false', | ||
'true', | ||
'' | ||
)) | ||
super.setUp() | ||
} | ||
|
||
@Test | ||
public void testRunBenchmarkTestScript_PipelineSingleNode() { | ||
super.testPipeline("tests/jenkins/jobs/BenchmarkTestNoManifest_Jenkinsfile") | ||
} | ||
|
||
@Test | ||
void testRunBenchmarkTestScript_verifyScriptExecutionsNoManifest() { | ||
runScript("tests/jenkins/jobs/BenchmarkTestNoManifest_Jenkinsfile") | ||
|
||
def testScriptCommands = getCommandExecutions('sh', './test.sh').findAll { | ||
shCommand -> shCommand.contains('./test.sh') | ||
} | ||
|
||
assertThat(testScriptCommands.size(), equalTo(2)) | ||
assertThat(testScriptCommands, hasItem( | ||
"./test.sh benchmark-test --distribution-url https://www.exmaple.com/example.tar.gz --distribution-version 3.0.0 --config /tmp/workspace/config.yml --workload nyc_taxis --benchmark-config /tmp/workspace/benchmark.ini --user-tag security-enabled:true --single-node --use-50-percent-heap --capture-segment-replication-stat --suffix 307-secure --data-instance-type r5.8xlarge --additional-config cluster.indices.replication.strategy:SEGMENT --data-node-storage 200 --ml-node-storage 200 ".toString() | ||
)) | ||
assertThat(testScriptCommands, hasItem( | ||
"./test.sh benchmark-test --distribution-url https://www.exmaple.com/example.tar.gz --distribution-version 3.0.0 --config /tmp/workspace/config.yml --workload nyc_taxis --benchmark-config /tmp/workspace/benchmark.ini --user-tag security-enabled:false --without-security --single-node --use-50-percent-heap --capture-segment-replication-stat --suffix 307 --data-instance-type r5.8xlarge --additional-config cluster.indices.replication.strategy:SEGMENT --data-node-storage 200 --ml-node-storage 200 ".toString() | ||
)) | ||
} | ||
|
||
def getCommandExecutions(methodName, command) { | ||
def shCommands = helper.callStack.findAll { | ||
call -> | ||
call.methodName == methodName | ||
}. | ||
collect { | ||
call -> | ||
callArgsToString(call) | ||
}.findAll { | ||
shCommand -> | ||
shCommand.contains(command) | ||
} | ||
|
||
return shCommands | ||
} | ||
} |
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
Oops, something went wrong.