Skip to main content

Pact Ecosystem

Background​

One of the strengths of Pact is its specification, allowing anybody to create a new language binding in an interoperable way.

To provide a single Pact implementation that could be used by all the required languages, the decision was made to create a reference implementation in Ruby. Wrapping the Ruby implementation allowed new languages to implement Pact quickly, however, it had its downsides.

The standalone package worked by bundling the entire Ruby runtime with the codebase using Travelling Ruby, so it was large (~9MB). The native libraries also had to deal with the mock service process management, which could be fiddly on different platforms. It also made it difficult to run consumer tests in parallel, as each mock service process could only handle one thread at a time.

To provide a single Pact implementation that could be used by all the required languages, the decision was made to create a reference implementation in Rust, that could be wrapped by each client language using FFI. The distributable package will be orders of magnitude smaller, and make it easier to run tests in parallel and avoid the process management issues, we have been slowly moving to our Rust core which solves many of the challenges that bundling Ruby presented.

It is worth noting that the "shared core" approach has largely been a successful exercise in this regard. There are many data points, but the implementation of WIP/Pending pacts was released (elapsed, not effort) in just a few weeks for the libraries that wrapped Ruby. In most cases, an update of the Ruby "binaries", mapping flags from the language specific API to dispatch to the underlying Ruby process, a README update and a release was all that was required. In many cases, new functionality is still published with an update to the Ruby binary, which has been automated through a script.

Beth often refers to the Ruby Goldberg machine, in a nod to Rube Goldberg.

image

We want to bring efficiencies to our CI/CD processes used in our open source projects, so in order to help you navigate the Pact estate, we've created some diagrams, and links to relevant sources, so you can contribute to the Pact ecosystem, no matter how small, or how big the change.

Ruby Goldberg Machine​

pact-js <= v9
pact-js >= v10
pact-go <= v1
pact-net <= v3
pact-python >= v0
pact-php >= v0
pact-consumer-swift >= v0
pact
pact-ruby-cli
pact_broker-client
pact-ruby-standalone
pact-support
pact-mock_service
pact-message
pact-provider-verifier
homebrew-pact-ruby-standalone
pact-node
mocha-pact
nestjs-pact
jest-pact
pact-js-core

Ruby Standalone Consumers Goldberg Machine​

pact-js <= v9
pact-js >= v10
pact-go <= v1
pact-net <= v3
pact-python >= v0
pact-php >= v0
pact-consumer-swift >= v0
pact-ruby-standalone
homebrew-pact-ruby-standalone
pact-node
mocha-pact
nestjs-pact
jest-pact
pact-js-core

Rust Goldberg machine​

pact-js >= v10
pact-go >= v2
pact-net >= v4
pact_models
pact_ffi
pact_verifier
pact_matching
pact_mock_server
pact_consumer
pact_mock_server_cli
pact-elixir
pact_verifier_cli
pact_wasm
pact-plugin-driver
pact_cli
pact-js-core
jest-pact
pact-swift
pact-swift-examples
pact-dart
pact-cplusplus

Rust FFI Consumers Goldberg machine​

pact-js >= v10
pact-go >= v2
pact-net >= v4
pact_models
pact_ffi
pact_matching
pact_mock_server
pact_verifier
pact-js-core
jest-pact
pact-swift
pact-swift-examples
pact-dart
pact-cplusplus

Java Goldberg machine​

pact_jvm
pact4s
Is this page useful?