Merge branch 'main' of github.com:nosqlbench/nosqlbench

This commit is contained in:
Jonathan Shook 2021-11-18 16:35:37 -06:00
commit e4252bdfde
3 changed files with 13 additions and 2 deletions

View File

@ -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);

View File

@ -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://raw.githubusercontent.com/nosqlbench/nosqlbench/main/engine-cli/src/test/resources/activities/scenario-test.yaml";
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");

View File

@ -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() {