Nautilus Contract Tests

Get Started. It's Free
or sign up with your email address
Nautilus Contract Tests by Mind Map: Nautilus Contract Tests

1. Service (provider/consumer) Release

1.1. Run Powershell script that registers PROD version with broker

1.1.1. /service/setprodversion?name={serviceName}&version={0.0.0.0}'

2. Provider CI Build

2.1. Use broker to get pacts for provider /provider/pacts?name={providerName}

2.1.1. Run Pact tests (./gradlew PactVerify) against REQUIRED pacts

2.1.1.1. Pact tests fail? Fail the build.

2.1.1.2. Pact tests pass?

2.1.1.2.1. Call broker to register "sign off" for provider/version /provider/signoffs?name={providerName}&version={0.0.0.0}

2.1.2. Run pact tests for "Future Consumer Pact Requirements"

2.1.2.1. Pact tests fail? Just log it. No fail necessary.

2.1.2.2. Pact tests pass?

2.1.2.2.1. Call broker to register "sign off" for provider/version /provider/signoffs?name={providerName}&version={0.0.0.0}

3. Consumer CI Build

3.1. Runs internal Pact tests (Junit/Pact) to generate pact files

3.1.1. Pact tests pass?

3.1.1.1. Add new pact to broker as a FUTURE requirement /pact/register?pactId={id}&consumer={consumerName}&provider={providerName}&consumerVersion={0.0.0.0}

3.1.1.2. Register with broker that this pact has a consumer requirement /consumer/pacts/add?consumer={consumerName}&consumerVersion={0.0.0.0}&provider={providerName}&pactId={id}

3.1.2. Pact tests fail? FAIL THE BUILD

4. Consumer Release Build

4.1. Use broker release validation endpoint /service/validate_for_release?name={serviceName}&version={0.0.0.0}

4.1.1. Find all pacts for this consumer version.

4.1.2. Look up PROD providers for these pacts.

4.1.3. Ensure those provider versions have signed off on the pact.

4.1.3.1. If service returns FALSE, fail the build.

4.1.3.1.1. This scenario will typically happen every time a new pact requirement is introduced via the consumer. In these scenarios, the provider will need to be updated, built, and released to sign off on the future requirement.

4.1.3.2. If service returns TRUE, release continues.

5. Provider Release Build

5.1. Use broker release validation endpoint /service/validate_for_release?name={serviceName}&version={0.0.0.0}

5.1.1. Find all pacts linked to the provider, where the consumer version is a known PROD version.

5.1.2. Check that the Provider Pact Sign Offs is set for those pacts.

5.1.2.1. If service returns FALSE, fail the build.

5.1.2.2. If service returns TRUE, release continues.