Skip to content

Commit

Permalink
Merge pull request #115 from TechnologyBrewery/HAB-runtime-test-errors
Browse files Browse the repository at this point in the history
HAB-runtime-test-errors - Add additional format option to see python behave test runtime errors in the console
  • Loading branch information
colinpalmer-pro authored Apr 17, 2024
2 parents e75e1a6 + 29f3435 commit d9a0e5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void doExecute() throws MojoExecutionException, MojoFailureException {
poetryHelper.installDevelopmentDependency(BEHAVE_CUCUMBER_FORMATTER);
executeBehaveTestArgs.add("--format=behave_cucumber_formatter:PrettyCucumberJSONFormatter");
executeBehaveTestArgs.add("--outfile=target/cucumber-reports/cucumber.json");
executeBehaveTestArgs.add("--format=progress2");
}

if (omitSkippedTests) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ private static class LoggerOutputStream extends LogOutputStream {
private static final String WARNING_LOG = "WARNING";
private static final String ERROR_LOG = "ERROR";
private static final String CRITICAL_LOG = "CRITICAL";
private static final String FAILURE_LOG = "FAILURE";

LoggerOutputStream(Logger logger, int logLevel) {
super(logLevel);
Expand All @@ -190,11 +191,12 @@ public final void flush() {

@Override
protected void processLine(final String line, final int logLevel) {
if (line.toUpperCase().contains(ERROR_LOG) || line.toUpperCase().contains(CRITICAL_LOG)) {
final String upperLine = line.toUpperCase();
if (upperLine.contains(ERROR_LOG) || upperLine.contains(CRITICAL_LOG) || upperLine.contains(FAILURE_LOG)) {
logger.error(line);
} else if (line.toUpperCase().contains(WARNING_LOG)) {
} else if (upperLine.contains(WARNING_LOG)) {
logger.warn(line);
} else if (line.toUpperCase().contains(DEBUG_LOG)) {
} else if (upperLine.contains(DEBUG_LOG)) {
logger.debug(line);
} else {
logger.info(line);
Expand Down

0 comments on commit d9a0e5d

Please sign in to comment.