mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-27 03:00:40 -06:00
add support for scenarios from a http service
This commit is contained in:
parent
d31fbd45fe
commit
af83ca6d65
@ -98,7 +98,7 @@ public class NBCLIScenarioParser {
|
||||
.prefix(includes)
|
||||
.name(workloadName)
|
||||
.extension(RawStmtsLoader.YAML_EXTENSIONS)
|
||||
.one();
|
||||
.first().orElseThrow();
|
||||
|
||||
StmtsDocList stmts = StatementsLoader.loadContent(logger, yamlWithNamedScenarios, userParams);
|
||||
|
||||
|
@ -125,6 +125,16 @@ public class NBCLIScenarioParserTest {
|
||||
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
|
||||
public void testSanitizer() {
|
||||
String sanitized = NBCLIScenarioParser.sanitize("A-b,c_d");
|
||||
|
@ -10,6 +10,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@ -73,7 +74,7 @@ public class URLContent implements Content<URL> {
|
||||
|
||||
@Override
|
||||
public Path asPath() {
|
||||
return null;
|
||||
return Paths.get(url.getPath());
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
Loading…
Reference in New Issue
Block a user