Giter Site home page Giter Site logo

centaur's Introduction

The Centaur repository is now under the Cromwell repository. Click here for Centaur within Cromwell.

For information about how to use Centaur, see the Cromwell documentation.



Introduction

Centaur is an integration testing suite for the Cromwell execution server. It's purpose is to exercise the functionality of a specific deployment of Cromwell, to ensure that it is functioning properly 'in the wild'.

Prerequisites

Centaur expects to find a Cromwell server properly configured and running in server mode, listening on port 8000. This can be configured by modifying the cromwellUrl parameter in application.conf.

Running

There are two ways to invoke the intergration tests:

  • sbt test - compiles and run via sbt directly, simple but also has the problem of running 2*cores tests in parallel which can overwhelm your Cromwell server if running in a development environment
  • run_tests_parallel.sh [THREADS] - runs the same tests with an enforced parallelism limit. Defaults to 3 if not specified

Tags

All tests are tagged with their name and their TESTFORMAT, and also any custom tags specified in the .test file.

Tag names are all lower case, so a test named "tagFoo" has a tag "tagfoo".

To run only those tests which have been tagged with a specified tag tagFoo:

sbt "testOnly * -- -n tagfoo"

Or to instead exclude all tests which have been tagged with a specified tag tagFoo:

sbt "testOnly * -- -l tagfoo"

Adding custom tests

You can add your own tests to the test suite by adding -Dcentaur.optionalTestPath=DIR on your sbt invocation, e.g. sbt -Dcentaur.optionalTestPath=/some/path/to/tests test. The value of DIR is expected to be a directory which contains one or more test case files.

The same result can be achieved more permanently by adding the custom directory into the application.conf file directly:

centaur {
  optionalTestPath = "/some/path/to/tests"
}

Defining test cases

Each test case file is a HOCON file with the following structure:

name: NAME  // Required: Name of the test
testFormat: TESTFORMAT // Required: One of WorkflowSuccessTest, WorkflowFailureTest
backends: [BACKENDNAME1, BACKENDNAME2, ...] // Optional list of backends. If supplied, this test will be ignored if these backends are not supported by the Cromwell server
basePath: /an/optional/field  // Optional, location for the files {} entries to be found relative to
tags: [ "any", "custom", "tags" ]  // Optional, a set of custom tags to apply to this test
ignore: false  // Optional, whether centaur will ignore this test when running

files {
  wdl: path/to/wdl  // Required: path to the WDL file to submit
  inputs: optional/path/to/inputs  // Optional, a path to an inputs JSON to include in the submission
  options: optional/path/to/options  // Optional, a path to an options JSON to include in the submission
}

// Optional, some metadata to verify on workflow completion:
metadata {
  fully.qualified.key.name1: VALUE1
  fully.qualified.key.name2: VALUE2
}

The tags are optional. If supplied they will allow people to turn on or off this test case by including or excluding tags when running (see above).

The basePath field is optional, but if supplied all paths will be resolved from that directory. If it is not supplied, all paths will be resolved from the directory the test case file is in.

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

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. For any metadata values which require workflow ID (i.e, file paths), use <<UUID>> as a placeholder instead. For example:

  • "calls.hello.hello.stdout": "gs://google-project/jes/root/wdl/<<UUID>>/call-task/task-stdout.log"

centaur's People

Contributors

adamstruck avatar cjllanwarne avatar coreone avatar danbills avatar geoffjentry avatar horneth avatar jsotobroad avatar katevoss avatar kcibul avatar kshakir avatar mcovarr avatar ruchim avatar scottfrazer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

centaur's Issues

Running single test cases

Be able to run a single specific test case that already exists within the StandardTestCaseSpec. Useful for testing purposes.

Verification of Output file content

Currently, Centaur is able to verify the outputs file that Cromwell , but not the file paths and files mentioned in outputs. The next iteration of output verification should involve comparing the files referenced in the Cromwell outputs.

super_massive_array_output_test fails

It looks like most of the shards are successful, but one fails and might not be retried:

2016-08-03 15:20:01,502 cromwell-system-akka.dispatchers.backend-dispatcher-107 INFO  - $a [UUID(eaeaa32d)DeliciousFileSpam.StringSpam:215:1]: JesAsyncBackendJobExecutionActor [UUID(eaeaa32d):DeliciousFileSpam.StringSpam:215:1] Status change from Running to Success
2016-08-03 15:20:01,923 cromwell-system-akka.dispatchers.engine-dispatcher-86 INFO  - WorkflowExecutionActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: Job DeliciousFileSpam.StringSpam:215:1 succeeded!
2016-08-03 15:20:03,592 cromwell-system-akka.dispatchers.engine-dispatcher-86 INFO  - WorkflowExecutionActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: WorkflowExecutionActor [UUID(eaeaa32d)] transitioning from WorkflowExecutionInProgressState to WorkflowExecutionFailedState. Shutting down.
2016-08-03 15:20:03,592 cromwell-system-akka.dispatchers.engine-dispatcher-86 INFO  - WorkflowExecutionActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: WorkflowExecutionActor [UUID(eaeaa32d)] done. Shutting down.
2016-08-03 15:20:03,593 cromwell-system-akka.dispatchers.engine-dispatcher-85 INFO  - WorkflowActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: transitioning from ExecutingWorkflowState to FinalizingWorkflowState
2016-08-03 15:20:03,594 cromwell-system-akka.dispatchers.engine-dispatcher-84 INFO  - WorkflowFinalizationActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: State is transitioning from FinalizationPendingState to FinalizationInProgressState.
2016-08-03 15:20:03,594 cromwell-system-akka.dispatchers.engine-dispatcher-84 INFO  - WorkflowFinalizationActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: State is transitioning from FinalizationInProgressState to FinalizationSucceededState.
2016-08-03 15:20:03,594 cromwell-system-akka.dispatchers.engine-dispatcher-138 INFO  - WorkflowActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: transitioning from FinalizingWorkflowState to WorkflowFailedState
2016-08-03 15:20:03,594 cromwell-system-akka.dispatchers.engine-dispatcher-138 INFO  - WorkflowActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 [UUID(eaeaa32d)]: transition from FinalizingWorkflowState to WorkflowFailedState. Shutting down.
2016-08-03 15:20:03,595 cromwell-system-akka.dispatchers.engine-dispatcher-68 ERROR - WorkflowManagerActor Workflow eaeaa32d-057d-4f2e-b986-6e8b738dd512 failed (during ExecutingWorkflowState): wdl4s.util.AggregatedException: Error reading gs://miguel-cromwell-dev/DeliciousFileSpam/eaeaa32d-057d-4f2e-b986-6e8b738dd512/call-StringSpam/shard-237/file.txt at position 0
2016-08-03 15:20:03,595 cromwell-system-akka.dispatchers.engine-dispatcher-133 INFO  - WorkflowManagerActor WorkflowActor-eaeaa32d-057d-4f2e-b986-6e8b738dd512 is in a terminal state: WorkflowFailedState

Allow for Multiple Cromwells'

Modify the configuration of Centaur to allow for multiple cromwell URLs to be supplied. For the standard battery/batteries (i.e. anything which is running Everything), have the test(s) run all of the workflows against all of the Cromwells

Allow for arbitrary test WDLs

Provide a capability to run things beyond the WDLs directly in the jar, which will allow people to have private or domain specific WDLs to a test battery.

For now let's assume that any such WDLs passed in are of that main success test case.

One solution (but others are certainly feasible) would be to allow for a directory to be passed in which contains the test subdirs

Log workflow id, start, and end

For each test name, it would be helpful to log the workflowId, as the name of the WDL workflow doesn't always match the name of the test.

Additionally, a brief message of when the test was detected as starting & stopped would help debug stuck workflows.

If this is deemed too verbose, the above could be logged at level debug.

Centaur should be more robust to missing files

Initially Centaur loaded in its files for each test (wdl, inputs, etc) using a function which would throw an exception if it wasn't there. As the framework has evolved it has moved to a model that is more robust and would more accurately report what was going on there. Modify these file slurps to play nicer with the rest of the system

Check more attributes are sent to Google correctly

Brain-dumping this for the time being in favor of higher-priority work.

Building on #140, confirm other JES parameters are making it to the VM as expected.

I have some WIP here. In developing this it became apparent that both GCE VM and JES metadata can be introspected, and in most cases this is boilerplate that would be common to all the check_a_thing tasks. This should be refactored out into a common script so it's not copy/pasted into each task. Probably the best way to do this is to have the inputs to each task include a common String script which would dump GCE VM and JES metadata to files. The check_a_thing tasks would then do something like:

task check_a_thing {
  String script
  String specified_value_of_attr

  command <<<
    $(script) # writes jes_metadata.yaml and gce_metadata.yaml
    grep -Po attr_pattern jes_metadata.yaml
  >>>

  output {
    File jes_metadata = "jes_metadata.yaml"
    File gce_metadata = "gce_metadata.yaml"
    String attr_value = read_string(stdout())
  }
  
  runtime {
    docker: "google/cloud-sdk"
    attr: "${specified_value_of_attr}"
  }

This should confirm that Cromwell's intended attribute values are communicated into JES metadata correctly. It can also be useful to make sure that intent makes it to the GCE metadata correctly (this was particularly key for preemptible). And for attributes like memory or cpu it may also be useful to check that the machine is actually provisioned as expected (e.g. checking /proc/cpu or /proc/memory).

Add UserServiceAccount tests

Analogous to refresh token tests. Add a PAPI backend using user service account. Launch workflows using an account from a different project than cromwell's SA.

Enable verification of metadata in new framework

Write functionality which allows for verification of metadata on a completed workflow in the new framework.

Have this functionality active for the standard spec (i.e. the original WDLs which were being checked for workflow success) and optional for any other specs if the writer chooses

Test output/log copying in new testing framework

Enable the following functionality and write test(s) to exercise it in the new framework:
When workflow options specifies final output copying that the outputs are in the correct place
When workflow options specifies log copying that the logs are in the correct place
When both are specified both are correctly working

unit tests for centaur code

Now that the centaur code base is starting to accumulate code that's not just tests, we should start having actual centaur unit tests as well. That'll be a little odd simply because sbt test will run both those and the integration tests but i'm sure we'll manage

Test different Cromwell non backend specific confs

This is not necessarily a centaur ticket, more of a "testing" ticket. There is no easy way to test different non-backend specific config values of Cromwell in travis.
It would be nice to have some way to do that.

Add Call Caching testing to new framework

Enable the following functionality in the new testing framework:

Verifying that cache hits happen as/when expected
Verifying that cache misses happen as/when expected
Verifying the correct value is used when a cache hit happens
Pretty open ended as to how this is done. Modify framework as necessary including input structures, specs, WDLs, etc
AC: Demonstrate that you are successfully testing all of the above conditions in the new framework

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.