Example Provider

Source Code

https://github.com/pactflow/example-provider-golang

badge__2_.svg

can--i--deploy-master_to_production-brightgreen.svg: https://test.pactflow.io/overview/provider/pactflow-example-consumer-golang/consumer/pactflow-example-consumer-golang

pactflow--example--consumer--golang_verified-brightgreen.svg: https://test.pactflow.io/pacts/provider/pactflow-example-provider-golang/consumer/pactflow-example-consumer-golang/latest (latest pact)

pactflow--example--consumer--golang__pact-verified-brightgreen.svg: https://test.pactflow.io/pacts/provider/pactflow-example-provider-golang/consumer/pactflow-example-consumer-golang/latest (master/master pact) This is an example of a (Gin-based) Golang provider that uses Pact, API Hub for Contract Testing and GitHub Actions to ensure that it is compatible with the expectations its consumers have of it.

The project uses a Makefile to simulate a very simple build pipeline with two stages - test and deploy.

It is using a public tenant on API Hub for Contract Testing, which you can access here using the credentials dXfltyFMgNOFZAxr8io9wJ37iUpY42M/O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1. The latest version of the Example Consumer/Example Provider pact is published here.

Pre-Requisites

Ruby standalone binaries must be installed, the following script will download them and add them to your system PATH

make install_ruby_standalone

Usage

See the API Hub for Contract Testing CI/CD Workshop for further details.

make fake_ci

Publication date: