mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
add support for scenarios from a http service
This commit is contained in:
@@ -98,7 +98,7 @@ public class NBCLIScenarioParser {
|
|||||||
.prefix(includes)
|
.prefix(includes)
|
||||||
.name(workloadName)
|
.name(workloadName)
|
||||||
.extension(RawStmtsLoader.YAML_EXTENSIONS)
|
.extension(RawStmtsLoader.YAML_EXTENSIONS)
|
||||||
.one();
|
.first().orElseThrow();
|
||||||
|
|
||||||
StmtsDocList stmts = StatementsLoader.loadContent(logger, yamlWithNamedScenarios, userParams);
|
StmtsDocList stmts = StatementsLoader.loadContent(logger, yamlWithNamedScenarios, userParams);
|
||||||
|
|
||||||
|
|||||||
@@ -125,6 +125,16 @@ public class NBCLIScenarioParserTest {
|
|||||||
assertThat(cmds.size()).isGreaterThan(0);
|
assertThat(cmds.size()).isGreaterThan(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testThatScenarioUrlsAreSupported() {
|
||||||
|
//TODO: This might change?
|
||||||
|
String urlScenario = "https://gist.githubusercontent.com/tjake/0106848762e078f0ef886c1a097b3433/raw/4302fd0ab2d34bd088d973cdd52ed7711782f757/scenario-test.yaml?foo=bar";
|
||||||
|
|
||||||
|
NBCLIOptions opts = new NBCLIOptions(new String[]{ urlScenario, "schema-only", "cycles-test=20"});
|
||||||
|
List<Cmd> cmds = opts.getCommands();
|
||||||
|
assertThat(cmds.size()).isGreaterThan(0);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSanitizer() {
|
public void testSanitizer() {
|
||||||
String sanitized = NBCLIScenarioParser.sanitize("A-b,c_d");
|
String sanitized = NBCLIScenarioParser.sanitize("A-b,c_d");
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.nio.ByteBuffer;
|
|||||||
import java.nio.CharBuffer;
|
import java.nio.CharBuffer;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -73,7 +74,7 @@ public class URLContent implements Content<URL> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Path asPath() {
|
public Path asPath() {
|
||||||
return null;
|
return Paths.get(url.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
Reference in New Issue
Block a user