Skip to content

frastel/sflive-workshop-contract-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workshop Contract Testing

Demo project for demonstrating the functionality and power of contract testing.

Contract testing is done with Pact.

Requirements

This demo contains a Vagrant + Docker setup. Docker native (without Vagrant) may work but is not really supported.

Installation

@host:$ vagrant up
@host:$ vagrant ssh

@guest:$ cd /vagrant
@guest:$ ./bin/install

Joining the workshop? Then stop reading and look forward to the upcoming Symfony Live Berlin 2018 :)

Start/stop environment

Start

@guest:$ ./bin/start

Stop

@guest:$ ./bin/stop

Project Overview

Services:

  • frontend: the UI
  • recipe-detail: holds all details of a recipe and according data
  • recipe: service for basic recipe data
  • user: service for basic user data
  • recipe-search: service for searching for recipes

Services

For running the tests the complete environment has to be started.

@guest:$ ./bin/start

Afterwards you have to jump in the according service for executing the tests

@guest:$ ./bin/enter frontend

Frontend

Consumer Tests:

@container:$ ./bin/phpunit-contract-consumer-user
@container:$ ./bin/phpunit-contract-consumer-recipe-detail
@container:$ ./bin/phpunit-contract-consumer-recipe-search

Recipe Service

User Service

Provider Test:

@container:$ ./bin/phpunit

RecipeSearch Service

RecipeDetail Service

PactBroker

From any service within the environment the broker is available under

http://pact-broker:9292

Debugging

export XDEBUG_CONFIG="idekey=PHPSTORM"
export PHP_IDE_CONFIG="serverName=recipe-search.workshop"
bin/phpunit ...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published