Skip to content

Commit

Permalink
less config logging logging and report production reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
iantmoore committed Jan 29, 2017
1 parent 24b5c9e commit 1b87b5a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public long getExecutionNodeId() {

public Long getRunningDuration() {

return startedAt != null && completedAt != null ? completedAt - startedAt : null;
return startedAt != null && completedAt != null ? completedAt - startedAt : -1L;
}

private void recordComplete() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import com.typesafe.config.ConfigRenderOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -66,7 +67,12 @@ public void addDefaultProperties(final URL url, final String name) {


public String getConfigurationInfo() {
return config.root().render();

ConfigRenderOptions options =
ConfigRenderOptions.defaults().setComments(false).setFormatted(true).setJson(false).setOriginComments(false);

return config.withoutPath("java")
.withoutPath("sun").withoutPath("awt").withoutPath("idea").withoutPath("line.separator").withoutPath("os").withoutPath("path.separator").root().render(options);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ExecutionResultsCollector extends IExecutionResultsCollector {

node match {
case scenarioNode : BasicScenarioNode => {
log.debug("basic scenario failed")
log.debug(s"basic scenario id ${scenarioNode.getId} failed")

val feature = getFeatureFromNode(scenarioNode)

Expand Down Expand Up @@ -136,7 +136,7 @@ ExecutionResultsCollector extends IExecutionResultsCollector {

node match {
case scenarioNode : BasicScenarioNode => {
log.debug("basic scenario finished")
log.debug(s"basic scenario id ${scenarioNode.getId} finished")
val feature = getFeatureFromNode(scenarioNode)

featureToResultsDirMap.get(feature.getId) match {
Expand Down Expand Up @@ -239,9 +239,19 @@ ExecutionResultsCollector extends IExecutionResultsCollector {

childNode match {
case basicScenarioNode : BasicScenarioNode => {
val (sNode, resultsFile) = scenarioSummaryMap.get(basicScenarioNode.getId).get

List(ScenarioSummary(sNode.getId, resultsFile.getName, sNode.getResult.getResult.toString, basicScenarioNode.getTags.toList))
scenarioSummaryMap.get(basicScenarioNode.getId) match {
case Some((sNode, resultsFile)) => {

List(ScenarioSummary(sNode.getId, resultsFile.getName, sNode.getResult.getResult.toString, basicScenarioNode.getTags.toList))

}
case None => {
log.error("failed to find scenario summary for id: " + basicScenarioNode.getId)
List()
}
}


}
case outline : OutlineScenarioNode => {
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/scala/org/substeps/report/NodeDetail.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import com.technophobia.substeps.execution.node.{BasicScenarioNode, StepImplemen

import scala.collection.JavaConverters._



case class NodeDetail(nodeType: String, filename: String, lineNumber : Int, result : String, id : Long,
executionDurationMillis : Option[Long], description : String, method : Option[String],
children : List[NodeDetail] = List(),
Expand Down

0 comments on commit 1b87b5a

Please sign in to comment.