Skip to content

Commit

Permalink
docs: update learning
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Oct 22, 2024
1 parent 3aa2d8c commit a3b495d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
25 changes: 14 additions & 11 deletions LEARNING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@

| Step | Title | Concept Covered | Learning objectives | Further Reading |
|----------------------------------------------------------------------|---------------------------------------------------------|------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| [step 1](https://github.com/pact-foundation/pact-workshop-js/tree/step1) | Create our consumer before the Provider API even exists | Consumer-driven design | <ul><li>Understand use case</li></ul> | <ul><li>https://martinfowler.com/articles/consumerDrivenContracts.html</li></ul>| |
| [step 2](https://github.com/pact-foundation/pact-workshop-js/tree/step2) | Write a unit test for our consumer | - | <ul><li>How to write a basic unit test for an HTTP Client</li><li>Understand how a unit test is unable to catch certain integration issues</li></ul> | <ul><li>https://docs.pact.io/faq/convinceme</li></ul> |
| [step 3](https://github.com/pact-foundation/pact-workshop-js/tree/step3) | Write a Pact test for our consumer | Consumer side pact test | <ul><li>Understand basic Consumer-side Pact concepts</li><li>Understand "Matchers" to avoid test data brittleness</li><li>Demonstrate that Pact tests are able to catch a class of integration problems</li></ul> | <ul><li>https://docs.pact.io/5-minute-getting-started-guide#scope-of-a-consumer-pact-test</li><li>https://docs.pact.io/best_practices/consumer</li></ul>| |
| [step 4](https://github.com/pact-foundation/pact-workshop-js/tree/step4) | Verify the consumer pact with the Provider API | Provider side pact test | <ul><li>Understand basic Provider-side Pact concepts</li><li>Place provider side testing in a broader testing context (e.g. where it fits on the pyramid)</li></ul> | <ul><li>https://docs.pact.io/5-minute-getting-started-guide#scope-of-a-provider-pact-test</li></ul> |
| [step 5](https://github.com/pact-foundation/pact-workshop-js/tree/step5) | Fix the consumer's bad assumptions about the Provider | Humans talking to humans (collaboration) | <ul><li>Understand that a tool facilitates collaboration, it doesn't replace it</li></ul> | |
| [step 6](https://github.com/pact-foundation/pact-workshop-js/tree/step6) | Write a pact test for `404` (missing User) in consumer | Testing API invariants | <ul><li>Understand how we can test "stateful" APIs without having to create complex, sequential API calls</li></ul> | |
| [step 7](https://github.com/pact-foundation/pact-workshop-js/tree/step7) | Update API to handle `404` case | Provider States | <ul><li>How Pact deals with "stateful" interactions, via the concept of "Provider States"</li></ul> | <ul><li>https://docs.pact.io/getting_started/provider_states</li></ul> |
| [step 8](https://github.com/pact-foundation/pact-workshop-js/tree/step8) | Write a pact test for the `401` case | Testing authenticated APIs | <ul><li>Service evolution - adding a new feature</li></ul> | |
| [step 9](https://github.com/pact-foundation/pact-workshop-js/tree/step9) | Update API to handle `401` case | Service evolution | <ul><li>Understand the challenge of dealing with complex/dynamic data, such as time-bound authentication tokens</li></ul> | |
| [step 10](https://github.com/pact-foundation/pact-workshop-js/tree/step10) | Fix the provider to support the `401` case | Request filters | <ul><li>Understand Pact's approach to dealing with complex/dynamic data, such as time-bound authentication tokens</li></ul> | |
| [step 11](https://github.com/pact-foundation/pact-workshop-js/tree/step11) | Implement a broker workflow for integration with CI/CD | Automation | <ul><li>Understand how to use Pact in a CI and CD workflow</li></ul> | <ul><li>https://docs.pact.io/pact_broker</li><li>https://docs.pact.io/best_practices/pact_nirvana</li></ul> |
| [step 1](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-1---create-consumer-subscriber) | Create our consumer before the Provider API even exists | Consumer-driven design with Hexagonal Architecture | <ul><li>Understand use case</li></ul> | <ul><li>https://martinfowler.com/articles/consumerDrivenContracts.html</li></ul>| |
| [step 2](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-2---create-consumer-pact-test) | Write a Pact test for our consumer | Consumer side pact test | <ul><li>Understand basic Consumer-side Pact concepts</li><li>Understand "Matchers" to avoid test data brittleness</li><li>Demonstrate that Pact tests are able to catch a class of integration problems</li></ul> | <ul><li>https://docs.pact.io/5-minute-getting-started-guide#scope-of-a-consumer-pact-test</li><li>https://docs.pact.io/best_practices/consumer</li></ul>| |
| [step 3](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-3---create-provider-publisher) | Create our Provider with Ports & Adapters in mind | Hexagonal Architecture | <ul><li>Understand how to scaffold an provider application, with ports and adapters in mind</li><li>Highlight our area of interest for our Pact message verifications</li></ul> | <ul><li>TODO LINK</li></ul> |
| [step 4](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-4---create-provider-pact-test) | Verify the consumer pact with the Provider API | Provider side pact test | <ul><li>Understand basic Provider-side Pact concepts</li><li>Place provider side testing in a broader testing context (e.g. where it fits on the pyramid)</li></ul> | <ul><li>TODO LINK</li></ul> |


Further reading

- https://docs.pact.io/getting_started/how_pact_works#non-http-testing-message-pact
- https://dius.com.au/2017/09/22/contract-testing-serverless-and-asynchronous-applications/
- https://dius.com.au/2018/10/01/contract-testing-serverless-and-asynchronous-applications-part-2/
- https://alistair.cockburn.us/hexagonal-architecture/
- https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749
- https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/hexagonal-architecture.html
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ This workshop should take from 1 to 2 hours, depending on how deep you want to g

**Workshop outline**:

- [step 1: **create consumer(subscriber)**](https://github.com/pact-foundation/pact-workshop-js/tree/step1#step-1---simple-consumer-calling-provider): Create our consumer before the Provider API even exists
- [step 2: **create consumer pact test**](https://github.com/pact-foundation/pact-workshop-js/tree/step3#step-3---pact-to-the-rescue): Write a Pact test for our consumer
- [step 3: **create provider(publisher)**](https://github.com/pact-foundation/pact-workshop-js/tree/step3#step-3---pact-to-the-rescue): Create our provider
- [step 4: **create provider pact test**](https://github.com/pact-foundation/pact-workshop-js/tree/step3#step-3---pact-to-the-rescue): Write a Pact test to verify our provider codebase
- [step 1: **create consumer(subscriber)**](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-1---create-consumer-subscriber): Create our consumer before the Provider API even exists
- [step 2: **create consumer pact test**](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-2---create-consumer-pact-test): Write a Pact test for our consumer
- [step 3: **create provider(publisher)**](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-3---create-provider-publisher): Create our provider
- [step 4: **create provider pact test**](https://github.com/YOU54F/pact-workshop-message?tab=readme-ov-file#step-4---create-provider-pact-test): Write a Pact test to verify our provider codebase
<!-- - [step 5: **extend consumer**](https://github.com/pact-foundation/pact-workshop-js/tree/step5#step-5---back-to-the-client-we-go): Extend our consumer -->

<!-- _NOTE: Each step is tied to, and must be run within, a git branch, allowing you to progress through each stage incrementally._
Expand Down

0 comments on commit a3b495d

Please sign in to comment.