Skip to content

Development workflow

bethesque edited this page Jul 24, 2014 · 7 revisions

Development Workflow

Using consumer driven contracts enables you to reverse the "normal" order of development, allowing you to build your consumer, in its entirety if need be, before you build your provider.

The development process will be different for every organisation, but this is one that has worked for the pact authors.

Initial development

  1. Write consumer tests with pact
  2. Implement consumer
  3. Add pact:publish task to consumer build or publish pact as CI artifact
  4. Create provider project
  5. Configure pact:verify task to point to latest published pact
  6. Implement provider until pact:verify passes

New features

  1. Add new feature, with pact specs, to consumer project on a new feature branch.
  2. In the provider project, use rake pact:verify:at[/path/to/pact/on/branch] to verify the new pact.
  3. Commit/release new provider feature.
  4. Merge consumer branch into main development branch.

This may seem complex, but it is actually sufacing the underlying reality, that you cannot add new functionality to the consumer before it can be supported by the provider, and that the functionality that the provider supports should still be driven by the needs of the consumer.

Clone this wiki locally