mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-01-26 23:46:32 -06:00
test that multiple occurrences of template var resolve consistently
This commit is contained in:
parent
2767da34f0
commit
7ff0920a4b
@ -0,0 +1,27 @@
|
||||
package io.nosqlbench.engine.cli;
|
||||
|
||||
import io.nosqlbench.engine.api.activityconfig.StatementsLoader;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class NBCLIScenarioParserTemplateVarTest {
|
||||
|
||||
@Test
|
||||
public void providePathForScenario() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{ "local/example-scenarios-templatevars" });
|
||||
List<Cmd> cmds = opts.getCommands();
|
||||
cmds.forEach(System.out::println);
|
||||
|
||||
StmtsDocList workload1 = StatementsLoader.loadPath(null, cmds.get(0).getArg("workload"),cmds.get(0).getParams());
|
||||
OpTemplate optpl = workload1.getStmts().get(0);
|
||||
assertThat(optpl.getStmt()).contains("cycle {cycle} replaced replaced\n");
|
||||
System.out.println("op:"+optpl);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
# example-scenarios.yaml
|
||||
scenarios:
|
||||
default:
|
||||
- run cycles=3 alias=A driver=stdout tvar1=replaced
|
||||
- run cycles=5 alias=B driver=stdout
|
||||
bindings:
|
||||
cycle: Identity()
|
||||
name: NumberNameToCycle()
|
||||
statements:
|
||||
- cycle: "cycle {cycle} TEMPLATE(tvar1,def1) TEMPLATE(tvar1)\n"
|
Loading…
Reference in New Issue
Block a user