Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AN-142] Adding cost centaur test #7685

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
task getAverage {
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved
Int base1 = 9
Int base2 = 13
command {
echo ${(base1*base2)/2}
}
output {
Float average = read_float(stdout())
}
runtime {
docker: "docker.io/ubuntu@sha256:71cd81252a3563a03ad8daee81047b62ab5d892ebbfbf71cf53415f29c130950"
}
}

task heightProduct{
Float baseAverage
Int height = 7

command {
echo ${baseAverage*height}
}
output {
Float trapezoidalArea = read_float(stdout())
}
runtime {
docker: "ubuntu@sha256:71cd81252a3563a03ad8daee81047b62ab5d892ebbfbf71cf53415f29c130950"
}
}

workflow cacheBetweenWFNoCost {
call getAverage {
}
call heightProduct {
input: baseAverage = getAverage.average
}
output {
heightProduct.trapezoidalArea
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: cacheBetweenWFNoCost
testFormat: runtwiceexpectingcallcachingnocost

files {
workflow: cacheBetweenWF/cacheBetweenWFNoCost.wdl
options: common_options/cache_read_off_write_on.options
second-options: common_options/cache_read_on_write_on.options
}

metadata {
workflowName: cacheBetweenWFNoCost
status: Succeeded
"calls.cacheBetweenWFNoCost.getAverage.callCaching.result": "Cache Hit: <<CACHE_HIT_UUID>>:cacheBetweenWFNoCost.getAverage:-1"
"calls.cacheBetweenWFNoCost.heightProduct.callCaching.result": "Cache Hit: <<CACHE_HIT_UUID>>:cacheBetweenWFNoCost.heightProduct:-1"
"outputs.cacheBetweenWFNoCost.heightProduct.trapezoidalArea": 406.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"read_from_cache":false
}
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: recursive_imports_cost
testFormat: workflowsuccessandverifycost

files {
workflow: recursive_imports/recursive_imports.wdl
imports: [
forkjoin/forkjoin.wdl,
sub_workflow_hello_world/sub_workflow_hello_world.wdl,
sub_workflow_hello_world/sub_workflow_hello_world_import.wdl,
sub_workflow_interactions/sub_workflow_interactions_import.wdl,
sub_workflow_interactions/sub_workflow_interactions.wdl
]
# Adds option to disable call-caching
options: recursive_imports/recursive_imports_cost.options
}

metadata {
workflowName: recursive_imports_cost
status: Succeeded
}

cost: 0.0016
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ metadata {
status: Succeeded
"outputs.main_workflow.main_output": "Hello sub world!"
}

Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
): IO[WorkflowMetadata] =
sendReceiveFutureCompletion(() => cromwellClient.metadata(id, args))

def cost(workflow: SubmittedWorkflow): IO[WorkflowCost] =
sendReceiveFutureCompletion(() => cromwellClient.cost(workflow.id))

Check warning on line 126 in centaur/src/main/scala/centaur/api/CentaurCromwellClient.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/api/CentaurCromwellClient.scala#L126

Added line #L126 was not covered by tests

def archiveStatus(id: WorkflowId): IO[String] =
sendReceiveFutureCompletion(() => cromwellClient.query(id)).map(_.results.head.metadataArchiveStatus)

Expand Down
47 changes: 47 additions & 0 deletions centaur/src/main/scala/centaur/test/Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1060,4 +1060,51 @@
IO.raiseError(CentaurTestException(message, workflow))
}
}

def getExpectedCost(workflowCost: Option[BigDecimal]): IO[BigDecimal] =
workflowCost match {
case Some(cost) if cost == 0 => IO.raiseError(new Exception("Expected cost cannot be 0"))
case Some(cost) => IO.pure(cost)

Check warning on line 1067 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1066-L1067

Added lines #L1066 - L1067 were not covered by tests
case None =>
IO.raiseError(new Exception("Expected 'cost' is required in the test config to validate the workflow cost"))

Check warning on line 1069 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1069

Added line #L1069 was not covered by tests
}

/**
* Validate that the actual cost is within 10% of the expected cost
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved
*/
def validateCost(actualCost: BigDecimal, expectedCost: BigDecimal): IO[Unit] = {
val costDiff = (actualCost - expectedCost).abs / expectedCost
if (costDiff > 0.1) {
IO.raiseError(
new Exception(s"Expected cost $expectedCost but got $actualCost, which is outside the 10% threshold")

Check warning on line 1079 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1076-L1079

Added lines #L1076 - L1079 were not covered by tests
)
} else {
IO.unit

Check warning on line 1082 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1082

Added line #L1082 was not covered by tests
}
}

def fetchAndValidateCost(workflowSpec: Workflow, submittedWorkflow: SubmittedWorkflow): Test[Unit] =
new Test[Unit] {

Check warning on line 1087 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1087

Added line #L1087 was not covered by tests

override def run: IO[Unit] =
for {
actualCost <- CentaurCromwellClient.cost(submittedWorkflow)
expectedCost <- getExpectedCost(workflowSpec.cost)
_ <- validateCost(actualCost.cost, expectedCost)
} yield ()

Check warning on line 1094 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1091-L1094

Added lines #L1091 - L1094 were not covered by tests
}

def validateNoCost(submittedWorkflow: SubmittedWorkflow): Test[Unit] =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe overkill, but I also added a test to verify that the cost is 0 when a workflow is call-cached

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

new Test[Unit] {

Check warning on line 1098 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1098

Added line #L1098 was not covered by tests

override def run: IO[Unit] =
for {
actualCost <- CentaurCromwellClient.cost(submittedWorkflow)

Check warning on line 1102 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1102

Added line #L1102 was not covered by tests
_ =
if (actualCost.cost != 0)
IO.raiseError(new Exception(s"When using call caching, the cost must be 0, not ${actualCost.cost}"))
else IO.unit
} yield ()

Check warning on line 1107 in centaur/src/main/scala/centaur/test/Test.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/Test.scala#L1104-L1107

Added lines #L1104 - L1107 were not covered by tests
}

}
29 changes: 29 additions & 0 deletions centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,26 @@
_ <- validateDirectoryContentsCounts(workflowDefinition, secondWf, metadata)
} yield SubmitResponse(secondWf)

def runWorkflowTwiceExpectingCachingNoCost(
workflowDefinition: Workflow
)(implicit cromwellTracker: Option[CromwellTracker]): Test[SubmitResponse] =
for {
_ <- checkDescription(workflowDefinition, validityExpectation = Option(true))
_ <- timingVerificationNotSupported(workflowDefinition.maximumAllowedTime)
firstWF <- runSuccessfulWorkflow(workflowDefinition)
secondWf <- runSuccessfulWorkflow(workflowDefinition.secondRun)
_ <- printHashDifferential(firstWF, secondWf)
metadata <- fetchAndValidateNonSubworkflowMetadata(secondWf, workflowDefinition, Option(firstWF.id.id))
_ <- fetchAndValidateJobManagerStyleMetadata(secondWf,

Check warning on line 143 in centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala#L137-L143

Added lines #L137 - L143 were not covered by tests
workflowDefinition,
prefetchedOriginalNonSubWorkflowMetadata = None

Check warning on line 145 in centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala#L145

Added line #L145 was not covered by tests
)
_ = cromwellTracker.track(metadata)
_ <- validateNoCacheMisses(secondWf, metadata, workflowDefinition)
_ <- validateDirectoryContentsCounts(workflowDefinition, secondWf, metadata)
_ <- validateNoCost(secondWf)
} yield SubmitResponse(secondWf)

Check warning on line 151 in centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala#L147-L151

Added lines #L147 - L151 were not covered by tests

def runWorkflowThriceExpectingCaching(
workflowDefinition: Workflow
)(implicit cromwellTracker: Option[CromwellTracker]): Test[SubmitResponse] =
Expand Down Expand Up @@ -337,6 +357,15 @@
case _ => Test.invalidTestDefinition("Configuration not supported by PapiUpgradeTest", workflowDefinition)
}

def runSuccessfulWorkflowAndVerifyCost(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider updating the existing test format to optionally check cost (if it's provided in the test config)?

workflowSpec: Workflow
): Test[SubmitResponse] = for {
_ <- checkDescription(workflowSpec, validityExpectation = Option(true))
_ <- timingVerificationNotSupported(workflowSpec.maximumAllowedTime)
submittedWorkflow <- runSuccessfulWorkflow(workflowSpec)
_ <- fetchAndValidateCost(workflowSpec, submittedWorkflow)
} yield SubmitResponse(submittedWorkflow)

Check warning on line 367 in centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/formulas/TestFormulas.scala#L363-L367

Added lines #L363 - L367 were not covered by tests

implicit class EnhancedCromwellTracker(val tracker: Option[CromwellTracker]) extends AnyVal {
def track(metadata: WorkflowMetadata): Unit = tracker foreach { _.track(metadata) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
def testFunction: Test[SubmitResponse] = this.testFormat match {
case WorkflowSuccessTest => TestFormulas.runSuccessfulWorkflowAndVerifyMetadata(workflow)
case WorkflowSuccessAndTimedOutputsTest => TestFormulas.runSuccessfulWorkflowAndVerifyTimeAndOutputs(workflow)
case WorkflowSuccessAndVerifyCostTest => TestFormulas.runSuccessfulWorkflowAndVerifyCost(workflow)

Check warning on line 28 in centaur/src/main/scala/centaur/test/standard/CentaurTestCase.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/standard/CentaurTestCase.scala#L28

Added line #L28 was not covered by tests
case WorkflowFailureTest => TestFormulas.runFailingWorkflowAndVerifyMetadata(workflow)
case RunTwiceExpectingCallCachingTest => TestFormulas.runWorkflowTwiceExpectingCaching(workflow)
case RunTwiceExpectingCallCachingNoCostTest => TestFormulas.runWorkflowTwiceExpectingCachingNoCost(workflow)

Check warning on line 31 in centaur/src/main/scala/centaur/test/standard/CentaurTestCase.scala

View check run for this annotation

Codecov / codecov/patch

centaur/src/main/scala/centaur/test/standard/CentaurTestCase.scala#L31

Added line #L31 was not covered by tests
case RunThriceExpectingCallCachingTest => TestFormulas.runWorkflowThriceExpectingCaching(workflow)
case RunTwiceExpectingNoCallCachingTest => TestFormulas.runWorkflowTwiceExpectingNoCaching(workflow)
case RunFailingTwiceExpectingNoCallCachingTest => TestFormulas.runFailingWorkflowTwiceExpectingNoCaching(workflow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ sealed abstract class CentaurTestFormat(val name: String) {
def testSpecString: String = this match {
case WorkflowSuccessTest => "successfully run"
case WorkflowSuccessAndTimedOutputsTest => "successfully run"
case WorkflowSuccessAndVerifyCostTest => "successfully run and verify cost"
case WorkflowFailureTest => "fail during execution"
case RunTwiceExpectingCallCachingTest => "call cache the second run of"
case RunTwiceExpectingCallCachingNoCostTest => "call cache the second run and verify no cost of"
case RunThriceExpectingCallCachingTest => "call cache the third run of"
case RunTwiceExpectingNoCallCachingTest => "NOT call cache the second run of"
case RunFailingTwiceExpectingNoCallCachingTest => "Fail the first run and NOT call cache the second run of"
Expand Down Expand Up @@ -49,8 +51,10 @@ object CentaurTestFormat {

case object WorkflowSuccessTest extends CentaurTestFormat("WorkflowSuccess")
case object WorkflowSuccessAndTimedOutputsTest extends CentaurTestFormat("WorkflowSuccessAndTimedOutputs")
case object WorkflowSuccessAndVerifyCostTest extends CentaurTestFormat("WorkflowSuccessAndVerifyCost")
case object WorkflowFailureTest extends CentaurTestFormat("WorkflowFailure")
case object RunTwiceExpectingCallCachingTest extends CentaurTestFormat("RunTwiceExpectingCallCaching")
case object RunTwiceExpectingCallCachingNoCostTest extends CentaurTestFormat("RunTwiceExpectingCallCachingNoCost")
case object RunThriceExpectingCallCachingTest extends CentaurTestFormat(name = "RunThriceExpectingCallCaching")
case object RunTwiceExpectingNoCallCachingTest extends CentaurTestFormat("RunTwiceExpectingNoCallCaching")
case object RunFailingTwiceExpectingNoCallCachingTest
Expand Down Expand Up @@ -127,8 +131,10 @@ object CentaurTestFormat {
List(
WorkflowSuccessTest,
WorkflowSuccessAndTimedOutputsTest,
WorkflowSuccessAndVerifyCostTest,
WorkflowFailureTest,
RunTwiceExpectingCallCachingTest,
RunTwiceExpectingCallCachingNoCostTest,
RunThriceExpectingCallCachingTest,
RunTwiceExpectingNoCallCachingTest,
RunFailingTwiceExpectingNoCallCachingTest,
Expand Down
7 changes: 5 additions & 2 deletions centaur/src/main/scala/centaur/test/workflow/Workflow.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ final case class Workflow private (testName: String,
allowOtherOutputs: Boolean,
skipDescribeEndpointValidation: Boolean,
submittedWorkflowTracker: SubmittedWorkflowTracker,
maximumAllowedTime: Option[FiniteDuration]
maximumAllowedTime: Option[FiniteDuration],
cost: Option[BigDecimal] = None
) {

def toWorkflowSubmission: WorkflowSingleSubmission = WorkflowSingleSubmission(
Expand Down Expand Up @@ -94,6 +95,7 @@ object Workflow {
val validateDescription: Boolean = conf.get[Boolean]("skipDescribeEndpointValidation").valueOrElse(false)

val maximumTime: Option[FiniteDuration] = conf.get[Option[FiniteDuration]]("maximumTime").value
val cost: Option[BigDecimal] = conf.get[Option[BigDecimal]]("cost").value

(files, directoryContentCheckValidation, metadata, retryTestFailuresErrorOr) mapN {
(f, d, m, retryTestFailures) =>
Expand All @@ -107,7 +109,8 @@ object Workflow {
allowOtherOutputs,
validateDescription,
submittedWorkflowTracker,
maximumTime
maximumTime,
cost
)
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ services {
GcpCostCatalogService {
class = "cromwell.services.cost.GcpCostCatalogService"
config {
enabled = false
enabled = true
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved
catalogExpirySeconds = 86400
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@

import scala.concurrent.ExecutionContext

import model.CallCacheDiffJsonSupport._
import model.CromwellBackendsJsonSupport._
import model.CromwellStatusJsonSupport._
import model.CromwellVersionJsonSupport._
import model.WorkflowLabelsJsonSupport._
import model.WorkflowOutputsJsonSupport._
import model.WorkflowDescriptionJsonSupport._
import model.CromwellQueryResultJsonSupport._
import model.WorkflowCostJsonSupport._

class CromwellClient(val cromwellUrl: URL,
val apiVersion: String,
val defaultCredentials: Option[HttpCredentials] = None
Expand Down Expand Up @@ -49,6 +59,7 @@

def abortEndpoint(workflowId: WorkflowId): Uri = workflowSpecificGetEndpoint(workflowsEndpoint, workflowId, "abort")
def statusEndpoint(workflowId: WorkflowId): Uri = workflowSpecificGetEndpoint(workflowsEndpoint, workflowId, "status")
def costEndpoint(workflowId: WorkflowId): Uri = workflowSpecificGetEndpoint(workflowsEndpoint, workflowId, "cost")

Check warning on line 62 in cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala

View check run for this annotation

Codecov / codecov/patch

cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala#L62

Added line #L62 was not covered by tests
def metadataEndpoint(workflowId: WorkflowId, args: Option[Map[String, List[String]]] = None): Uri =
workflowSpecificGetEndpoint(workflowsEndpoint, workflowId, "metadata", args)
def outputsEndpoint(workflowId: WorkflowId, args: Option[Map[String, List[String]]] = None): Uri =
Expand All @@ -69,15 +80,6 @@
lazy val backendsEndpoint = s"$workflowsEndpoint/backends"
lazy val versionEndpoint = s"$engineEndpoint/version"

import model.CallCacheDiffJsonSupport._
import model.CromwellBackendsJsonSupport._
import model.CromwellStatusJsonSupport._
import model.CromwellVersionJsonSupport._
import model.WorkflowLabelsJsonSupport._
import model.WorkflowOutputsJsonSupport._
import model.WorkflowDescriptionJsonSupport._
import model.CromwellQueryResultJsonSupport._

def submit(workflow: WorkflowSubmission)(implicit ec: ExecutionContext): FailureResponseOrT[SubmittedWorkflow] = {
val requestEntity = requestEntityForSubmit(workflow)

Expand Down Expand Up @@ -133,6 +135,9 @@
def status(workflowId: WorkflowId)(implicit ec: ExecutionContext): FailureResponseOrT[WorkflowStatus] =
simpleRequest[CromwellStatus](statusEndpoint(workflowId)) map WorkflowStatus.apply

def cost(workflowId: WorkflowId)(implicit ec: ExecutionContext): FailureResponseOrT[WorkflowCost] =
simpleRequest[WorkflowCost](costEndpoint(workflowId))

Check warning on line 139 in cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala

View check run for this annotation

Codecov / codecov/patch

cromwellApiClient/src/main/scala/cromwell/api/CromwellClient.scala#L139

Added line #L139 was not covered by tests

def metadata(workflowId: WorkflowId,
args: Option[Map[String, List[String]]] = None,
headers: List[HttpHeader] = defaultHeaders
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package cromwell.api.model

import spray.json.DefaultJsonProtocol

object WorkflowCostJsonSupport extends DefaultJsonProtocol {
implicit val WorkflowCostJsonFormat = jsonFormat5(WorkflowCost)

Check warning on line 6 in cromwellApiClient/src/main/scala/cromwell/api/model/WorkflowCost.scala

View check run for this annotation

Codecov / codecov/patch

cromwellApiClient/src/main/scala/cromwell/api/model/WorkflowCost.scala#L6

Added line #L6 was not covered by tests
}

final case class WorkflowCost(errors: List[String], id: String, cost: BigDecimal, status: String, currency: String)
13 changes: 11 additions & 2 deletions docs/developers/Centaur.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ You can now run the tests from another terminal.

There are two ways to invoke the integration tests:

* `sbt "centaur / IntegrationTest / test"` - compiles Centaur and runs all tests via sbt directly. Tests are expected to be in the `centaur/src/main/standardTestCases` directory. This can be changed by modifying `reference.conf`.
* `sbt "centaur / IntegrationTest / test"` - compiles Centaur and runs all tests via sbt directly.
* Can also just run `centaur/ IntegrationTest / test` from the sbt terminal.
Tests are expected to be in the `centaur/src/main/standardTestCases` directory. In order to run a set of specific tests, create a new subdirectory that contains the tests to run, then modify the path in the centaur `reference.conf`.
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved

* `src/ci/bin/testCentaurLocal.sh` - runs the same tests using the continuous integration pipeline configuration.

Expand Down Expand Up @@ -77,6 +79,9 @@ metadata {
"failures.0.causedBy": "BetweenKeyboardAndChairException"
}

// Optional, the expected cost of running the workflow
cost: 0.0000

filesystemcheck: "local" // possible values: "local", "gcs". Used in conjunction with outputExpectations to define files we expect to exist after running this workflow.
outputExpectations: {
"/path/to/my/output/file1": 1
Expand All @@ -91,6 +96,7 @@ The `basePath` field is optional, but if supplied all paths will be resolved fro
The `testFormat` field can be one of the following, case insensitive:
* `workflowsuccess`: The workflow being supplied is expected to successfully complete
* `workflowfailure`: The workflow being supplied is expected to fail
* `workflowsuccessandverifycost`: The workflow being supplied is expected to complete and the expected cost will be verified

The `metadata` is optional. If supplied, Centaur will retrieve the metadata from the successfully completed workflow and compare the values retrieved to those supplied. At the moment the only fields supported are strings, numbers and booleans.

Expand All @@ -105,7 +111,10 @@ In case the absolute path the cromwell root is used (for example: `/home/my_user
* `"calls.hello.hello.exit_code": "<<WORKFLOW_ROOT>>/call-hello/execution/exit_code"`

In case testing of the caching is required `<<CACHE_HIT_UUID>>` can be used.
The testFormat should be `runtwiceexpectingcallcaching`.
The testFormat should be `runtwiceexpectingcallcaching`. To verify that the cost is 0 when using call-caching the testFormat should be `runtwiceexpectingcallcachingnocost`

The cost is optional. If supplied, Centaur will retrieve the cost of the successfully completed workflow and compare it to the cost supplied.
The expected range is within 10% of the estimated cost. If evaluating the cost, the test format must be `WorkflowSuccessAndVerifyCost` and the call-caching option must be disabled for that test (example can be found in the `recursive_imports_cost.test`)


## Centaur Test Types
Expand Down
17 changes: 17 additions & 0 deletions docs/developers/Running.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
In order to run a Cromwell instance locally, there are the some prerequisites:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a start from what I can remember, feel free to add/edit!

- Have docker and IntelliJ installed
- Start a local mysql instance by running the `start_publish_mysql_docker.sh` script

To run the backend locally, set up your preferred run configuration.
More information on backends can be found [here](Backend.md)
![](select-run-config.png)

If you've created a new config, you may need to edit your run configuration to point to the correct config file or edit the environment variables.
Example for batch:
![](edit-run-config.png)


Upon startup, the Cromwell swagger will be available at `http://localhost:8000`.
(You can change the port and other configurations by following [these instructions](../Configuring.md)

**Note**: To verify that workflows are being submitted to the correct backend, look for logs with `Call-to-Backend assignments` and check that the tasks are being directed to `-> GCPBATCH` or `-> PAPI` etc.
Binary file added docs/developers/edit-run-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/developers/select-run-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading