https://pact.io logo
Join Slack
Powered by
# general
  • t

    Tú Phạm

    04/26/2025, 3:54 AM
    Hi, I think I have a common question but I couldn't find a guide for it so I decide to ask here. What should we do to write a consumer test for a retrieve endpoint that requires resource ID to be generated automatically on the provider side?
    b
    • 2
    • 3
  • j

    Jun Yi

    04/28/2025, 3:33 AM
    Hi, I'm currently using Pact Python v3, and I'm trying to implement consumer version selectors with a version for a specific consumer. However, I couldn't find any documentation or guides specifically for version 3. Is it possible to add a consumer version selector in this version of Pact Python? Below is the code I’m currently working with:
    Copy code
    verifier = Verifier().set_info(name=PROVIDER_NAME, url=PROVIDER_URL)
    verifier.broker_source(url=URL(settings.pact_flow_url), token=settings.pact_broker_token)
    verifier.set_state(url=PROVIDER_URL / "_pact" / "callback", teardown=True)
    verifier.filter_consumers(consumer_name)
    verifier.set_publish_options(version=str(version))
    verifier.verify()
    Thanks for your help!
    y
    • 2
    • 2
  • a

    Alessandro

    05/07/2025, 11:39 AM
    We have been using the pact-stub-server and found some serious performance enhancements. Is this the right place to discuss them? https://github.com/pact-foundation/pact-stub-server/issues/76 🙂
    m
    • 2
    • 2
  • p

    Pavanraj Ramisetty

    05/07/2025, 9:55 PM
    Hi This is pavanraj from atlassian, we have use-case of asynchronous api, 1. The api accepts the order and responds with 202. 2. Consumer polls on get order, based on the type of order placed, there will be fields set in the response. What is the recommendation for writing contract tests ? How do i get the confidence that any modification in order processing flow would ensure fields are populated as expected for the use-case ?
    b
    m
    • 3
    • 6
  • p

    Pascal

    05/08/2025, 2:36 PM
    👋 Hi everyone!
  • p

    Pascal

    05/08/2025, 2:36 PM
    Hi has anyone here ever renamed existing providers ? or has anyone ever provided providers that have no consumers ? So we have a microservice and therefore pacts were moved there. To know which contract belongs to whom we have changed the names. Unfortunately, I can no longer deploy or I can't do a can-i-deploy because there are no consumers or they simply still listen to the old providers. I wanted to ask how you deal with this?
  • p

    Pascal

    05/08/2025, 2:45 PM
    I should mention that the consumers are in other teams so I can't change them so easily
  • p

    Pavanraj Ramisetty

    05/09/2025, 5:32 AM
    https://pact-foundation.slack.com/archives/C5F4KFKR8/p1746768702503109?thread_ts=1746654916.048469&cid=C5F4KFKR8
  • v

    Vignesh

    05/12/2025, 1:22 PM
    Hey everyone I am looking for sample pact elixir project. I already searched in the pact-foundation repo But could not find it. Do we have any sample repo as example of pact API + async message working with Elixir? It would be great if anyone helps over here Thanks in advance.
    y
    • 2
    • 3
  • t

    Tim Vahlbrock

    05/14/2025, 12:54 PM
    Hello everyone, is there a recommended way to deal with Branches in Tag Pipelines? The GitLab Tag Pipelines have no branch name set. From what I have come up with I have two options: 1. Use the default branch name (which the tags are always made on). Then in validation pipelines that are triggered by webhooks I can check that out and reset to the tag. 2. Use no branch name. In webhook pipelines I would then checkout the tag detached. Are there any more consequences in using one or the other?
    m
    • 2
    • 3
  • a

    Antonio Blandón Torres

    05/16/2025, 9:40 PM
    Hope you're doing well. We are currently working on improving how we visualize our contract test results. Specifically, we would like to build a dashboard that can display these results, broken down by the different teams involved. We are exploring options for tools or platforms that could help us achieve this. Do you have any recommendations or experience with tools that are well-suited for creating dashboards of contract test results, particularly those that can show results per team? Any suggestions or insights you could provide would be greatly appreciated. Thank you for your time and assistance.
    m
    • 2
    • 1
  • m

    Martin Konir

    05/21/2025, 10:35 AM
    Hi everyone 👋 Our team is considering using Pact for contract testing of message flows over Kafka and Apache Pulsar, while also leveraging the Schema Registry in both systems for schema validation ( with
    BACKWARD
    compatibility type). Could you help clarify the main business cases for using both Pact and Schema Registry together? Specifically: • If we are already using the Schema Registry to enforce message structure and compatibility, does Pact contract testing become redundant? • Or does Pact provide additional value beyond schema validation? • If we decided to write contract tests for a Apache Pulsar messaging system, does Pact have any sort of integration - is it ready for that? (I wasn't able to find the necessary materials on this topic - everything is kafka centered 😅). Thank you very much for your insights!
    m
    • 2
    • 2
  • m

    Matt (pactflow.io / pact-js / pact-go)

    05/27/2025, 4:48 AM
    📣 Introducing PactFlow’s AI Test Templates + 5 New Languages for Contract Testing AI Generation! 🚀 We’ve recently dropped a few major features to PactFlow’s AI capabilities that I wanted to share with you all: Test Templates and 5 new languages. If you’re using Pact regularly and are looking for ways to accelerate adoption across your teams, PactFlow’s AI features are worth checking out. 🎯*Key Capabilities and Benefits:* 1. Test Templates improves consistency and efficiency, reducing additional manual refactoring work + better “one-shot” test generation: a. Specify Code-Based Test Templates – Provide a local code-based template to use as a basis generated test output. b. Guided Templates – Include additional prompts or instructions to target additional use cases, or further customise output. c. RBAC Integration – Restrict template usage with PactFlow’s role-based access controls. 2. New Language Support - Generate tests in Go, .NET, Kotlin, Swift, and PHP, in addition to Java and JS/TypeScript. 📚 Dive Deeper • Documentation: https://docs.pactflow.io/docs/ai/ • Get hands-on with our workshop: https://docs.pactflow.io/docs/tutorials#use-test-templates-with-ai-augmented-contract-testing-in-pactflow 👉 Show me! Read the blog and watch a short video showcasing the feature: https://pactflow.io/blog/ai-test-templates/. AI features are enabled on all plans - including trials - if you’d like to test it out (start here). 🛣️ What’s next? We’re currently working on Code Review, and will soon turn our attention to MCP support (for better IDE, tool and agentic AI support). Have something you’d like to see there? Reply to this thread, DM me or create/comment on an issue on the roadmap.
  • j

    Jordan Nazemi

    06/03/2025, 3:21 PM
    Not sure which channel this should go in, but I had a small issue with Pact using the Cypress adapter I had a question about. We use bi-directional contracts with Cypress to generate pacts on the frontend consumer. One of our providers uses a
    API Base URL
    in their OAS. When we try to generate Pacts with Cypress for it on the frontend, the entire path (include that base URL) is provided as the consumer contract. The issue is, Pactflow doesn't seem to match it with the base URL and were having to strip it from the JSON before pushing it up to Pactflow. ie • Consumer pact states the path is
    service/v1/endpoint
    • Provider states the base url is
    service/v1
    and the endpoint is
    /endpoint
    • Pactflow marks the two as incompatible UNLESS we strip the
    service/v1
    from the JSON generated by the Cypress Pact adapter before we push it to Pactflow Any ideas of a better solution that stripping?
    m
    • 2
    • 2
  • e

    Erich Zimmerman

    06/17/2025, 5:46 PM
    Hello, this is more about Contract testing overall. We have a pair of services that work together: an Ingress service (proxy), which provides authorization, and then an implementation service that does the actual work. Any client will simply call the Ingress service, which will authorize the caller, then pass the request along to the implementation service. From a contract testing standpoint, the general rule would be to define contracts between the outside consumer and ingress, and then between ingress and implementation. But practically, that doesn't really make sense. My general idea would be to treat the two services as effectively one service, but then I'm not sure how to set that up for proper testing. But one problem at a time. 🙂
    m
    • 2
    • 2
  • d

    Dilip Punna

    06/19/2025, 5:00 PM
    Hi 👋, do we have any examples for pactflow contract tests kafka event driven systems using Python?
    m
    • 2
    • 3
  • z

    Zachary Lysobey

    06/20/2025, 12:23 AM
    can someone help verify if the pact.io website is broken? Or is it just me
    https://pact.io/
    it seems like maybe the JS is broken on the page, and doing stuff like clicking
    view on Github
    doesn't work for me
    m
    • 2
    • 6
  • b

    Bogdan Barliga

    06/23/2025, 1:30 PM
    Hello, Is there a way to express that a response should contain a particular key, but that its value should be an opaque Json object? I appreciate that pact is not really designed for pass-through scenarios, but wondered if this could still be expressed.
    m
    • 2
    • 8
  • d

    Dmitry Munda

    07/01/2025, 11:49 AM
    hello i see
    interactionId
    in HAL browser, not user-friendly names. is it something new-ish ?
    Copy code
    "testResults": [{
          "interactionId": "0eac6b0ba31719c60b6d5d0c1a5a1ceab75943c2",
          "mismatches": [{
              "attribute": "body",
              "description": "Actual map is missing the following keys: reason",
              "identifier": "$"
            }],
          "success": false
        },... {
          "interactionId": "30ac1652bdc5ce4d8109d0ccabb4b99f6adc0013",
          "success": true
        }]
    👋 1
    m
    • 2
    • 12
  • j

    Jun Yi

    07/02/2025, 8:17 AM
    What is the recommended approach to force a deployment of a specific version (regardless of consumer or provider verification status) when
    can-i-deploy
    fails
    ? I'm exploring the following workaround — is this a valid approach? 1.
    create-version
    2.
    publish-pact
    /
    verify-pact
    3.
    can-i-deploy
    (fails) 4. force deploy anyway (with override flag or manual trigger) 5.
    record-deployment
    Are there any risks or better alternatives to this flow?
    y
    • 2
    • 9
  • k

    Kevin

    07/02/2025, 3:31 PM
    Attempting to use Pact with rust & gRPC. Having trouble when it comes to multiple synchronous messages to the same endpoint but with different request data. The mock server receives a request and responds with the response for a different request message. Example implementation here: https://github.com/MeatballSub/pact-help
    r
    • 2
    • 3
  • k

    Kinkini Gamage

    07/03/2025, 2:24 AM
    Hey, A quick question. Does Pact support GitLab CICD integration? I could find anything related to GitLab CI integration in the documentation as it's all about GitHub.
    m
    • 2
    • 5
  • b

    Bas Dijkstra

    07/07/2025, 12:01 PM
    For those of you looking for a practical, hands-on course on contract testing with Pact, my self-paced, online video course is now complete and available at https://ontestautomation.teachable.com/p/practical-contract-testing-with-pact Course features: _ Dozens of short, to the point instructions videos, with subtitles and transcripts _ Quizzes to test your theoretical knowledge about contract testing _ Hands-on programming exercises to put that knowledge to the test and write and run your own contract tests and make them part of a build pipeline The exercises are available in Java for now. I'll start adding exercises in other languages very soon, starting with C#, then JavaScript / TypeScript. To celebrate the (long overdue) go-live of this course, you can use the coupon code 50PERCENTOFF at checkout for, you guessed it, 50% off the regular price of USD 149. This coupon code is valid until Sunday, July 13, 11:59 PM CEST. (Posted with permission from the Pact team)
    🎉 1
    m
    • 2
    • 1
  • l

    Lachlan Newman

    07/08/2025, 5:35 AM
    Hello. I have a question regarding running provider verification of recently published pacts for different deployments. How can you run provider verification of PACT changes against versions of the provider that have been deployed to other environments? At the moment, we are just running provider verification via a webhook against what's on the latest version of the main branch.
    m
    • 2
    • 5
  • a

    Andrew Marshall

    07/08/2025, 8:39 AM
    Hi all - we have some unit tests using Pact via FFI for contract verification and I'm trying to improve their performance. The Application is in C++ and we run the tests via GTest. We use an updated fork of Pact's C++ client which uses FFI under the hood. Each test does the following - 1. Creates a provider instance 2. Instantiates a custom plugin 3. Performs verification Rust is not my area of expertise, so apologies if this isn't correct but it looks to me like each call to pactffi_using_plugin will block the client thread for at least 0.5s, so each of our unit tests is taking at least that long to complete.
    Copy code
    let result = RUNTIME.block_on(async {
              let result = load_plugin(&dependency).await;
    
              // Add a small delay to let asynchronous tasks to complete
              sleep(Duration::from_millis(500)).await;
    
              result
            });
    I've tried using a fixture to make the plugin and provider instance persistent across multiple tests, but haven't had much luck (it looks like there's some state not being cleaned up between unit test runs - or maybe ths issue is with our plugin?) - the first test passes but subsequent ones fail due to contract verification failures. I can probably provide a minimal example but I thought I'd ask first in case you had any ideas. Many thanks!
    y
    • 2
    • 11
  • p

    Priyaranjan Mudliar

    07/08/2025, 9:54 PM
    Hi In my org we had done an alignment to adopt pact as a contract testing framework, which will help us write the pact tests which then eventually help us eliminate any contract breakage between services in production or release branches. Now I have multiple questions regarding consumer and provider side of things: Consumer: 1. In the consumer application, should i publish pacts for each version (version being a commit id when the squashed commit merges in any branch) and branch (develop, release branch 1, release branch 2) OR should I only publish when the pact changes with the version and branch name? 2. When writing pacts in the consume side, what naming convention should we follow for consumer and provider. If I choose to use consumer name as the actual service name, it will be too generic and all set of interactions for that consumer service and the provider service will all go into that pacticipant. Also will I get this visibility of which interaction’s verification has failed in the pact broker OSS version ? Provider: 1. Should a provider write pact test without the consumer actually implementing their pact tests ? If yes, then lets say the provider writes the pact test for their service and in future the consumer also writes the pact test, uploads the pact to pact broker and for some reason the provider pact tests (verification starts failing) starts failing in this case. Should we stop the provider PRs in this case ? 2. In our current provider verification, we have passed consumer version selectors as “matchingBranch:true” since all our services in the org follow the same branch name convention and the release branches are cut at the same time, which then means that the provider will only pull in the pact for that particular branch? Is this the latest pact from that branch (latest version of consumer indirectly) ?
    r
    y
    • 3
    • 7
  • l

    Lachlan Newman

    07/09/2025, 4:14 AM
    Hello. Quick question. For events, is there any guaranteed order of the events that get emitted?
    m
    • 2
    • 1
  • f

    Freddie Jiang

    07/22/2025, 7:26 AM
    Hi, I'm utilizing the capability of pact SDK to build a contract broker in my company for internal rpc services. The broker I'm building aims to support contract publishing, contract retrieval and response verification. A quick question: our company uses a set of self-defined rpc protocols, what's the best practice of applying pact to our company's rpc protocols? Does pact directly support that? Or should I use an adapter layer to first transform the rpc response to the model that rpc can identify, and then use methods like compareSynchronousMessage() to process verification?
    r
    • 2
    • 3
  • f

    Freddie Jiang

    07/24/2025, 2:07 AM
    Hi, is it possible for multiple consumers to share a common contract with the same provider? I mean if they call the same API with the same expectation.
    m
    • 2
    • 5
  • f

    Freddie Jiang

    07/24/2025, 5:42 AM
    Hi, I'm thinking about such a scenario for RPC consumer and provider: if consumer has pulished contract to the broker, and later in the integration test stage the consumer need to mock the dependency of the provider, can we directly generate mocked response based on the interaction rule in the contract so that the consumer don't need to write mock tests? I think it would be a benefit for the consumer, and a good point to persuade them to adopt contract testing. Has anyone tried this approach?