-
Notifications
You must be signed in to change notification settings - Fork 216
Development workflow
Elastic Path edited this page Jul 3, 2019
·
7 revisions
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.
- Consumer - Write consumer tests with pact
- Consumer - Implement consumer
- Consumer - Make pact available to provider project.
- Provider - Create provider project
- Provider - Configure
pact:verify
task to point to latest published pact - Provider - Implement provider until
pact:verify
passes
- Consumer - Add new consumer feature, with pact specs, on a feature branch.
- Consumer - Talk to the provider team about the new functionality that is required, and give them access to the pact with the new features.
- Provider - In the provider project, use
rake pact:verify:at[/path/to/pact/on/branch]
to verify the new pact. - Provider - Develop and release new provider feature.
- Consumer - Merge feature branch into main development branch, and publish new pact.
This may seem complex, but it is actually surfacing the underlying reality, that 1. you should not be committing functionality to the master branch of the consumer before it can be supported by the provider and 2. that the functionality of the provider should still be driven by the needs of the consumer.