This commit is contained in:
Jonathan Shook 2020-03-25 09:32:12 -05:00
commit cea0baf489

View File

@ -20,12 +20,15 @@ package io.nosqlbench.engine.core.script;
import io.nosqlbench.cli.testing.ProcessInvoker;
import io.nosqlbench.cli.testing.ProcessResult;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.assertj.core.api.Assertions.assertThat;
public class NBCliIntegrationTests {
private final static String JARNAME = "target/nb.jar";
private Logger logger = LoggerFactory.getLogger(NBCliIntegrationTests.class);
@Test
public void listWorkloadsTest() {
@ -38,4 +41,29 @@ public class NBCliIntegrationTests {
System.out.println(result.getStderrData());
assertThat(result.exitStatus).isEqualTo(0);
}
@Test
public void dockerMetrics() {
ProcessInvoker invoker = new ProcessInvoker();
invoker.setLogDir("logs/test");
// check for docker
ProcessResult result = invoker.run("docker-detection-test", 15,
"docker", "ps"
);
System.out.println(result.getStdoutData());
System.out.println(result.getStderrData());
if(result.exitStatus ==0) {
result = invoker.run("docker-metrics-test", 15,
"java", "-jar", JARNAME, "--logs-dir", "logs/test", "--docker-metrics"
);
System.out.println(result.getStdoutData());
System.out.println(result.getStderrData());
assertThat(result.exitStatus).isEqualTo(0);
return;
}
logger.warn("skipped docker-metrics test because docker is not available");
}
}