mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fix nbcli test
This commit is contained in:
parent
c88d3c1c8f
commit
9c8dfb33a7
@ -81,28 +81,7 @@ public class NBCLI {
|
||||
}
|
||||
|
||||
if (options.wantsWorkloads()) {
|
||||
//ActivityType.FINDER.getAll().stream().map(ActivityType::getName).forEach(System.out::println);
|
||||
List<NosqlBenchFiles.WorkloadDesc> workloads = NosqlBenchFiles.getWorkloadsWithScenarioScripts();
|
||||
for (NosqlBenchFiles.WorkloadDesc workload : workloads) {
|
||||
System.out.println("# from: "+ workload.getYamlPath());
|
||||
List<String> scenarioList = workload.getScenarioNames();
|
||||
String workloadName = workload.getYamlPath().replaceAll("\\.yaml", "") ;
|
||||
Set<String> templates = workload.getTemlpates();
|
||||
|
||||
for (String scenario : scenarioList) {
|
||||
if (scenario.equals("default")) {
|
||||
scenario = scenario + " # same as running ./nb " + workloadName ;
|
||||
}
|
||||
System.out.println(" ./nb " + workloadName + " " + scenario);
|
||||
}
|
||||
if (templates.size()>0){
|
||||
System.out.println("# with the following optional parameters and defaults: ");
|
||||
templates.stream()
|
||||
.map(x -> x.replaceAll(",","="))
|
||||
.map(x -> "# "+x)
|
||||
.forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
printWorkloads();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@ -245,6 +224,31 @@ public class NBCLI {
|
||||
}
|
||||
}
|
||||
|
||||
public void printWorkloads() {
|
||||
List<NosqlBenchFiles.WorkloadDesc> workloads = NosqlBenchFiles.getWorkloadsWithScenarioScripts();
|
||||
for (NosqlBenchFiles.WorkloadDesc workload : workloads) {
|
||||
System.out.println("# from: "+ workload.getYamlPath());
|
||||
List<String> scenarioList = workload.getScenarioNames();
|
||||
String workloadName = workload.getYamlPath().replaceAll("\\.yaml", "") ;
|
||||
Set<String> templates = workload.getTemlpates();
|
||||
|
||||
for (String scenario : scenarioList) {
|
||||
if (scenario.equals("default")) {
|
||||
scenario = scenario + " # same as running ./nb " + workloadName ;
|
||||
}
|
||||
System.out.println(" ./nb " + workloadName + " " + scenario);
|
||||
}
|
||||
if (templates.size()>0){
|
||||
System.out.println("# with the following optional parameters and defaults: ");
|
||||
templates.stream()
|
||||
.map(x -> x.replaceAll(",","="))
|
||||
.map(x -> "# "+x)
|
||||
.forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String loadHelpFile(String filename) {
|
||||
ClassLoader cl = getClass().getClassLoader();
|
||||
InputStream resourceAsStream = cl.getResourceAsStream(filename);
|
||||
|
@ -241,6 +241,8 @@ public class TestNBCLIOptions {
|
||||
|
||||
@Test
|
||||
public void nbcli() {
|
||||
NBCLI.main(new String[]{"--list-workloads"});
|
||||
NBCLI nb = new NBCLI("--list-workloads");
|
||||
nb.printWorkloads();
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user