Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix existing examples #387

Merged
merged 9 commits into from Sep 27, 2023
Merged

Fix existing examples #387

merged 9 commits into from Sep 27, 2023

Commits on Sep 21, 2023

  1. feat(example): simplify docker-compose

    For the purposes of showcasing an example, the previous `docker-compose`
    was rather excessive running the Pact Broker behind a Nginx proxy with a
    PostgreSQL backend. This simplifies the containers to just use the core
    Pact broker image and uses `sqlite` for the database.
    
    This commit also drops SSL/TLS from the example as it does not
    meaningfully contribute to the example.
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 21, 2023
    Copy the full SHA
    7043dc6 View commit details
    Browse the repository at this point in the history
  2. chore(example): migrate consumer example

    Migrate the consumer example to the new example structure. This should
    help reduce the redundancy between the examples and make it easier for
    users to test them out and see how they work.
    
    Ultimately, the idea will be that the consumer tests run first, and then
    the provider tests run against the generated pact file.
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 21, 2023
    Copy the full SHA
    3a33d63 View commit details
    Browse the repository at this point in the history
  3. chore(example): migrate fastapi provider example

    This migrates the Pact FastAPI provider from the old standalone
    examples, and merges it with the new combined examples.
    
    The consumer tests are executed first which publishes the contracts with
    the broker. The provider test is then executed against the broker to
    verify compliance with the published contracts.
    
    This does, at this stage, create an unusual interdependence between
    tests which typically should be avoided. I plan to fix this at a later
    stage.
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 21, 2023
    Copy the full SHA
    4da4d14 View commit details
    Browse the repository at this point in the history
  4. chore(example): migrate flask provider example

    Following the changes to the FastAPI example, this migrates the Flask
    provider example to the new structure. The example relies on the
    consumer having published contracts, and the flask provider is verified
    against those contracts.
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 21, 2023
    Copy the full SHA
    e2103f7 View commit details
    Browse the repository at this point in the history
  5. chore(example): update readme

    Update the README for the examples to match the new structure of the
    examples.
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 21, 2023
    Copy the full SHA
    81ae787 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2023

  1. chore(example): migrate message pact example

    Migrate the old isolated example and combine the test with the other
    examples so that they can all be run at once.
    
    Massive thanks to @YOU54F for identifying the switch up between the
    `given` and `expected`!
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 22, 2023
    Copy the full SHA
    e2b6389 View commit details
    Browse the repository at this point in the history
  2. chore(ci): split tests examples and lints

    Try splitting the CI workflow to make use of services
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 22, 2023
    Copy the full SHA
    c8e0e7f View commit details
    Browse the repository at this point in the history
  3. chore(example): avoid changing python path

    Initially, when having the tests completely separate, the examples were
    scoped to their own space and required setting `PYTHONPATH` to work.
    This is not needed if we change `import src.{mod}` to `import
    examples.src.{mod}`.
    
    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 22, 2023
    Copy the full SHA
    f9d2024 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2023

  1. chore: address pr comments

    Signed-off-by: JP-Ellis <josh@jpellis.me>
    JP-Ellis committed Sep 27, 2023
    Copy the full SHA
    848fda1 View commit details
    Browse the repository at this point in the history