make all sub-app invocations act like stack calls, fix workflows

This commit is contained in:
Jonathan Shook 2022-06-24 15:40:28 -05:00
parent e062e6f0cd
commit cb4c033a63
9 changed files with 49 additions and 36 deletions

View File

@ -40,7 +40,8 @@ jobs:
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: test-results
path: logs
path: |
**/logs/*

View File

@ -347,9 +347,7 @@ public class NBWebServer implements Runnable {
server.join();
} catch (Exception e) {
logger.error("error while starting doc server", e);
e.printStackTrace(System.out);
System.exit(2);
throw new RuntimeException("error while starting doc server: "+e.toString(),e);
}
}

View File

@ -85,7 +85,7 @@ public class DockerHelper {
logger.error(String.format("Image %s not found, unable to automatically pull image." +
" Check `docker images`",
IMG));
System.exit(1);
throw new RuntimeException("");
}
}

View File

@ -0,0 +1,23 @@
/*
* Copyright (c) 2022 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.nosqlbench.engine.docker;
public class DockerInitError extends RuntimeException {
public DockerInitError(String message) {
super(message);
}
}

View File

@ -211,8 +211,7 @@ public class DockerMetricsManager {
String datasource = NBIO.readCharBuffer("docker/prometheus/prometheus.yml").toString();
if (ip == null) {
logger.error("IP for graphite container not found");
System.exit(1);
throw new DockerInitError("IP for graphite container not found");
}
datasource = datasource.replace("!!!GRAPHITE_IP!!!", ip);
@ -267,15 +266,13 @@ public class DockerMetricsManager {
return;
}
if (!dir.mkdir()) {
if (dir.canWrite()) {
System.out.println("no write access");
if (!dir.canWrite()) {
throw new DockerInitError("no write access to " + dir.getPath());
}
if (dir.canRead()) {
System.out.println("no read access");
if (!dir.canRead()) {
throw new DockerInitError("no read access to " + dir.getPath());
}
System.out.println("Could not create directory " + dir.getPath());
System.out.println("fix directory permissions to run --docker-metrics");
System.exit(1);
throw new DockerInitError("Could not create directory " + dir.getPath() + ". Fix directory permissions to run --docker-metrics");
}
}

View File

@ -39,7 +39,7 @@ public class VirtDataMainApp {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Usage: app (" + APP_TESTMAPPER + "|" + APP_GENDOCS + "|" + APP_DIAGNOSE +")");
System.exit(0);
return;
}
String appSelection = args[0];

View File

@ -18,13 +18,9 @@ package io.nosqlbench.virtdata.userlibs.apps.diagnoseapp;
import io.nosqlbench.virtdata.core.bindings.ResolverDiagnostics;
import io.nosqlbench.virtdata.core.bindings.VirtData;
import io.nosqlbench.virtdata.userlibs.apps.valuesapp.RunData;
import io.nosqlbench.virtdata.userlibs.apps.valuesapp.ValuesCheckerCoordinator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Arrays;
public class VirtDataDiagnoseApp {
private final static Logger logger = LogManager.getLogger(VirtDataDiagnoseApp.class);
@ -33,8 +29,7 @@ public class VirtDataDiagnoseApp {
if (args.length==1) {
diagnose(args[0]);
} else {
System.out.println(" ARGS: 'specifier'");
System.exit(2);
System.out.println("You must provide one argument which is the binding recipe to test.");
}
}

View File

@ -79,7 +79,7 @@ public class VirtDataGenDocsApp implements Runnable {
"[basefile <name>] [basedir <dir>] [categories combined|split] [format json|markdown] " +
"[blurbsdirs <dir>[:...]]\n\n"
);
System.exit(0);
return;
}
while (largs.peekFirst() != null) {
String argtype = largs.removeFirst();
@ -114,12 +114,16 @@ public class VirtDataGenDocsApp implements Runnable {
}
}
FDoc docsinfo = loadAllDocs();
Optional<FDoc> docsinfo = loadAllDocs();
if (!docsinfo.isPresent()) {
return;
}
try {
String extension = (this.format.equals(FORMAT_MARKDOWN)) ? ".md" : ".json";
for (FDocCat docsForCatName : docsinfo) {
for (FDocCat docsForCatName : docsinfo.get()) {
String categoryName = docsForCatName.getCategoryName();
categoryName = categoryName.isEmpty() ? "EMPTY" : categoryName;
@ -180,7 +184,7 @@ public class VirtDataGenDocsApp implements Runnable {
return writers.get(outputname);
}
private FDoc loadAllDocs() {
private Optional<FDoc> loadAllDocs() {
List<String> errors = new ArrayList<>();
FDoc docsinfo = new FDoc();
List<DocFuncData> allDocs = VirtDataDocs.getAllDocs();
@ -215,9 +219,10 @@ public class VirtDataGenDocsApp implements Runnable {
}
if (errors.size()>0) {
errors.forEach(System.out::println);
System.exit(2);
return Optional.empty();
} else {
return Optional.of(docsinfo);
}
return docsinfo;
}
}

View File

@ -18,10 +18,8 @@ package io.nosqlbench.virtdata.userlibs.apps.valuesapp;
import io.nosqlbench.virtdata.core.bindings.ResolverDiagnostics;
import io.nosqlbench.virtdata.core.bindings.VirtData;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import java.util.Arrays;
import org.apache.logging.log4j.Logger;
public class VirtDataCheckPerfApp {
@ -40,9 +38,7 @@ public class VirtDataCheckPerfApp {
System.out.println(" end: The end cycle for the test, exclusive.");
System.out.println(" OR");
System.out.println(" ARGS: diagnose 'specifier'");
System.exit(2);
}
}
private static void checkperf(String[] args) {
@ -60,10 +56,8 @@ public class VirtDataCheckPerfApp {
try {
runData = checker.call();
System.out.println(runData.toString());
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
System.exit(2);
throw new RuntimeException("Error while checking performance: " + e.toString(), e);
}
}