Skip to content

Commit

Permalink
Declaration evaluation (#2119)
Browse files Browse the repository at this point in the history
* Coerce decalarations:

* update wdl4s + custom centaur

* fix dependency

* be more patient..

* centaur develop
  • Loading branch information
Horneth committed Apr 3, 2017
1 parent 83f2ded commit caab258
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/test/scala/cromwell/backend/BackendSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import wdl4s.values.WdlValue

trait BackendSpec extends ScalaFutures with Matchers with Mockito {

implicit val defaultPatience = PatienceConfig(timeout = Span(5, Seconds), interval = Span(500, Millis))
implicit val defaultPatience = PatienceConfig(timeout = Span(10, Seconds), interval = Span(500, Millis))

def testWorkflow(workflow: TestWorkflow, backend: BackendJobExecutionActor, inputs: Map[String, WdlValue] = Map.empty) = {
executeJobAndAssertOutputs(backend, workflow.expectedResponse)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import lenthall.exception.ThrowableAggregation
import lenthall.util.TryUtil
import net.ceedubs.ficus.Ficus._
import org.apache.commons.lang3.StringUtils
import wdl4s.WdlExpression.ScopedLookupFunction
import wdl4s.expression.WdlFunctions
import wdl4s.values.{WdlArray, WdlBoolean, WdlOptionalValue, WdlString, WdlValue}
import wdl4s.{Scope, _}

Expand Down Expand Up @@ -463,7 +465,7 @@ case class WorkflowExecutionActor(workflowDescriptor: EngineWorkflowDescriptor,
scatterMap
)

declaration.requiredExpression.evaluate(lookup, data.expressionLanguageFunctions) match {
declaration.evaluate(lookup, data.expressionLanguageFunctions) match {
case Success(result) => self ! DeclarationEvaluationSucceededResponse(declaration, result)
case Failure(ex) => self ! DeclarationEvaluationFailedResponse(declaration, ex)
}
Expand Down Expand Up @@ -764,7 +766,11 @@ object WorkflowExecutionActor {

case class StaticDeclarationKey(scope: Declaration, index: ExecutionIndex, value: WdlValue) extends DeclarationKey

case class DynamicDeclarationKey(scope: Declaration, index: ExecutionIndex, requiredExpression: WdlExpression) extends DeclarationKey
case class DynamicDeclarationKey(scope: Declaration, index: ExecutionIndex, requiredExpression: WdlExpression) extends DeclarationKey {
def evaluate(lookup: ScopedLookupFunction, wdlFunctions: WdlFunctions[WdlValue]) = {
requiredExpression.evaluate(lookup, wdlFunctions) flatMap scope.wdlType.coerceRawValue
}
}

case class WorkflowExecutionException[T <: Throwable](exceptions: NonEmptyList[T]) extends ThrowableAggregation {
override val throwables = exceptions.toList
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sbt._

object Dependencies {
lazy val lenthallV = "0.23-0bebf0c-SNAP"
lazy val wdl4sV = "0.11-777de0c-SNAP"
lazy val wdl4sV = "0.11-f32b35d-SNAP"
lazy val sprayV = "1.3.3"
/*
spray-json is an independent project from the "spray suite"
Expand Down

0 comments on commit caab258

Please sign in to comment.