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

    Gustavo Souza

    11/10/2022, 6:55 PM
    would you know what is the reason for that error message below:
    Copy code
    Test failed for the following reasons:
    
          Mock server failed with the following mismatches:
    
            0) The following request was expected but not received:
    t
    • 2
    • 7
  • l

    Leon Luu

    11/16/2022, 4:32 PM
    Hi! I wonder if it is possible for the provider in bi-directional testing to publish the openapi spec without any provider test?
    y
    • 2
    • 3
  • y

    Yousaf Nabi (pactflow.io)

    11/16/2022, 9:52 PM
    Got a treat for you if you are a Ministry of Testing member, the wonderful @Jaswanth M created some material that might be right up your alley. https://www.ministryoftesting.com/dojo/lessons/api-challenge-jaswanth-manigundan-using-pact?s_id=13789307 https://www.ministryoftesting.com/dojo/lessons/building-and-implementing-an-api-test-solu[…]gy-across-a-scaling-organisation-a-journey?s_id=13789309
    🎉 1
    🙏 1
    m
    • 2
    • 1
  • r

    Ryan Thomas

    11/16/2022, 11:33 PM
    Hi. I have a question about the pact broker can-i-deploy behavior. It's a fairly easy use case to work around and I'm not sure if this is specific to the pactflow broker I was using or if the behavior is the same in the open source pact broker. When testing a proof-of-concept bi-directional contract testing setup I found that the
    can-i-deploy --to-environment <environmentname>
    behavior for the api provider is somewhat unexpected when no environment deploys/releases have happened to the environment yet. In this scenario I would expect that the
    can-i-deploy
    behavior would not select any pacts for verification because none are in that environment. Instead I found that the behavior was selecting all of the pacts. i.e. 1. Consumer creates first test and uploads pact contract .json (version abcdef1) [from local machine] 2. Provider uploads open api schema (version xzy1) [from local machine] 3. Looking at the pactflow UI we see there are inconsistencies and fix them. 4. Consumer uploads pact contract .json (version abcdef2) [from local machine] 5. Setup proof-of-concept CICD for consumer 5a. Consumer CICD uploads pact contract version (abcdef3) 5b. Consumer CICD calls
    can-i-deploy --to-environment production
    and gets a 'No' response because no api deployment to production has been recorded. ^ This is the behavior I would expect 6. Setup proof-of-concept CICD for provider 6a. Provider CICD uploads open api schema version (xyz2) 6b. Provider CICD calls
    can-i-deploy --to-environment production
    and gets a 'No' response. The response shows all 3 consumer contracts (abcdef1, abcdef2, abcdef3) despite none of them being in production. And because abcdef1 is not valid is returns a no. ^ I would expect this to select none of the contracts in scenarios where no consumer version has been deployed to production yet.
    m
    • 2
    • 1
  • y

    Yousaf Nabi (pactflow.io)

    11/17/2022, 6:27 PM
    A lot happens in 10 years. We’ve seen it all here at Pact, from the proliferation of micro services, to ever increasing protocols like Protobufs, GraphQL, transports such as gRPC, Websockets and MQTT, EventDrivenArchitectures and data pipelines or emerging standards such as OpenAPI, AsyncAPI and CloudEvents. As we launch our Pact Plugin Framework bringing you new possibilities to the Pact eco-system, I’d like to invite you to try an interactive history lesson of Pact, from past, to present and beyond! http://docs.pact.io/blog/2022/11/17/pact-facts-a-history-lesson
    🙌 2
    👌 4
  • n

    Nicholas Simons

    11/18/2022, 10:29 AM
    Good morning! The pact nirvana doc set (which is great, by the way!) describes how to use the broker in CI/CD pipelines. I'm wondering: are the tests designed to be run locally also (alongside unit tests)? I see value in running the consumer-side tests, as they can fail if they can't generate a pact. But to run the provider-side tests, the machine on which I'm running the tests needs to be connected to a network over which pacts can be pulled from the broker. Is the preference not to run provider-side tests locally, or to fall back to reading pacts out of a folder, or to ensure everyone has access to the broker?
    b
    • 2
    • 3
  • j

    Jordan Nazemi

    11/22/2022, 8:10 PM
    In the situation where we have an API provider and an API consumer, are there any recommendations for which tool to use to generate pact files? Most of the workshops seems to be focused on a web app consumer. While we could theoretically just use Cypress to do the API testing and use the cypress-pact adapter to generate the pact file I'm just curious what others have used in the past with success.
    m
    • 2
    • 7
  • a

    Alan Zhu

    11/25/2022, 2:31 AM
    Hey team I have one question, probably silly, about how to do a contain check in the response array in Pact. below is a sample, if I want to check id 995 in sections seems I have to check the whole exact array or use some thing like regular expressions, is there an easier way to check this?(if sections is a object I can just check id 955 and leave other object I don't want to check)
    Copy code
    {"sections": [
       ...
       {
          "facilities": [
             {
                "id": 433,
                "key": "Swimming Pool (2019 format)",
                "name": "Swimming Pool"
             }
          ],
          "id": 999,
          "key": "Top Facilities",
          "name": "Top facilities"
       },
       {
          "facilities": [],
          "id": 995,
          "key": "Meals",
          "name": "Price for meals"
       },
       {
          "facilities": [],
          "id": 997,
          "key": "Languages Spoken",
          "name": "Languages spoken"
       }
       ...
    ]
    }
    a
    m
    • 3
    • 8
  • h

    Harald Bittermann

    11/25/2022, 10:19 AM
    Hey Team, I read that pact is not the tool for testing proxies. Now we are currently checking out if pact would work nicely to contract test our microservices and I think we have a special case here. Eager to know your opinion. We have 4 services. Let's call them Consumer, Proxy, MasterProvider and DetailProvider. Proxy is, as the name suggests, a proxy and simply forwards all calls to masterprovider. Proxy does not know (much) about the requests it forwards. But it knows a bit. E.g. it knows that there has to be an auth header, if present it will be checked, if not the request will be rejected. But more importantly, it knows about a query parameter "detail". If set to true the response of masterprovider will be parsed. Again we do not care about how this response looks in detail we are only looking for one defined attribute in the json that contains an ID which will then be used to invoke DetailProvider. The results of this call will be embedded in the original response of Master within a metadata section. Our problem here is: • How can our client be sure that the his request will be understood by Masterservice • But without Proxy having any more knowledge about requests that he already has The strange situation here is that proxy is not the owner of the api, but howere he does have logic. Is this an example about "what not to test with pact". How would you make sure (with or without pact) that client test fails when MasterProvider changes its API
  • m

    Mark Wilson

    11/25/2022, 2:42 PM
    Hi All, When I'm running
    pact-broker create-webhook
    in the pipeline I don't seem to get a UUID in response. Do you know how I can obtain it?
  • a

    Anton

    11/26/2022, 12:18 PM
    Hello. Is pact-php still supported? I waiting since March 2022 of a reply to an issue... https://github.com/pact-foundation/pact-php/issues/234
  • t

    Thomas K

    11/27/2022, 2:04 PM
    hello, does anyone please know if it is possible via api or cli etc to get the latest version of a pacticipant within a given environment? (using environments rather than the legacy tagging way)
    👍 1
  • s

    sumit ghorpade

    11/27/2022, 6:39 PM
    Hello , I am starting with Contract test for my project. Is there any documentation on best practices and do's and don'ts that I can follow? If I can get any doc link or in general best practices to follow would be big help. Thanks
    👋 1
    a
    • 2
    • 2
  • a

    Anton

    11/28/2022, 2:03 PM
    ... an answer please 🥺 https://pact-foundation.slack.com/archives/C5F4KFKR8/p1669465115353379
    y
    • 2
    • 3
  • a

    Alan Zhu

    11/29/2022, 6:22 AM
    Hey team I have another question, about the execution orders of different states in Pact during verification. I met this scenario: saving the object by POST first, and then reading back the values from the appropriate GET request. I just ordered them with 'save' first then 'query'.It seems works in Pact But I still want a double check with you guys: are the use cases executed in strict accordance with the order in the pact?
    m
    • 2
    • 4
  • s

    sumit ghorpade

    11/29/2022, 6:44 AM
    Hello Team, I have a doubt regarding Provider state. As a consumer I want certain specific value to be returned from provider. Say I am consuming a field "RuleId" and I want provider to return "Rule-123". As a provider - I am supposed to hit the real running service and match the response with pact response. But to achieve my scenario, should I use Provider state and mock the response to return "Rule-123" ? Similarly for error scenarios - should I create mock response for each error scenario ? I might be wrong here, but I am confused like if I mock any response, then I am not validating real response but mock response. Kindly help to understand how provider side should be setup to achieve these scenarios mentioned above
    t
    • 2
    • 5
  • r

    Ringo

    11/29/2022, 11:58 AM
    Quick question: where can I download the standalone pact mock server (for Intel MacOS) mentioned in the docs?
    y
    t
    • 3
    • 3
  • r

    Ringo

    11/29/2022, 1:34 PM
    I
    start
    the main mock server. After that, I
    create
    a new mock server from a pact file. The debug output of the main server shows this:
    Copy code
    13:29:03 [DEBUG] (18) pact_mock_server_cli::server: Starting mock server with id 49c8834c-661f-4b65-94ce-03d9384bb330
    13:29:03 [DEBUG] (18) pact_mock_server::mock_server: Started mock server on 0.0.0.0:51714
    13:29:03 [DEBUG] (18) pact_mock_server_cli::server: mock server started on port 51714
    13:29:03 [DEBUG] (18) pact_mock_server_cli::server: Result of starting mock server: Ok(true)
    13:29:03 [DEBUG] (4) pact_mock_server_cli::server: Result of thread: Ok(true)
    When I run
    ./pact_mock_server_cli list
    after that, the
    list
    call hangs. This is the only debug info shown on the main server:
    Copy code
    13:29:30 [DEBUG] (11) hyper::proto::h1::io: parsed 3 headers
    13:29:30 [DEBUG] (11) hyper::proto::h1::conn: incoming body is empty
    13:29:30 [DEBUG] (11) pact_mock_server_cli::server: main_resource -> resource_exists
    13:29:30 [DEBUG] (11) pact_mock_server_cli::server: main_resource -> render_response
    Am I doing something wrong? Any known issues with this?
    t
    y
    • 3
    • 45
  • s

    sumit ghorpade

    11/30/2022, 1:21 PM
    Hi Team, I need some advise on writing contract test for negative (error) scenarios Is it necessary to contract test 5XX error responses ? or only 4XX should be done ? Any guidelines on this? 500 error response would be difficult to setup on provider side, is there a way to achieve that ? or should be mocked on provider side?
    y
    • 2
    • 4
  • y

    Yousaf Nabi (pactflow.io)

    11/30/2022, 1:58 PM
    howdy everyone! We are live in a few hours, come and join us, if you haven’t already signed up and check out some of coolest news in almost a decade of Pact 🔌
    🙌 3
    j
    m
    r
    • 4
    • 3
  • s

    Shuying Lin

    12/01/2022, 9:34 PM
    👥 Pact Open Source Community Annual Survey - 2022 👥 blob wave Hello here, Pact Open Source Community Annual Survey is now open! The purpose of this survey is a pulse check on the community. In order to serve you best way, we'd like to understand how you use Pact and engage in our ecosystem. The data collected in this survey is anonymous. We intend to use the data to better serve you and to promote the Pact community. This survey has been compiled by @Yousaf Nabi (pactflow.io) and myself. If you have any questions regarding the survey, feel free to send a direct message to us or leave your comments. We're looking forward to hearing your experience with Pact Open Source projects and the community. Cheers!
    🙏 2
    y
    • 2
    • 1
  • d

    Dmitry Munda

    12/02/2022, 8:03 AM
    hi! we are moving to
    deployedOrReleased
    and i want to clarify some stuff •
    record-deployment
    will do same as getting latest from env tag ? like only latest matters in pact verification •
    record-release
    - all marked matters in verifications until
    record-support-ended
    made for version ?
    b
    • 2
    • 2
  • a

    Arpan Agrawal

    12/02/2022, 8:08 AM
    Hi Team, do you have any plan to integrate AsyncAPI format for pact based testing. The latest I could get was that the plugin framework has been released through which one can write their own plugin and make it open source in case they want to.
    m
    • 2
    • 2
  • t

    Thomas K

    12/04/2022, 2:32 PM
    Hello, does anyone know (or have examples) if its possible to have consumer tests generate pacts without using a
    mockServer
    and instead using something like
    MockK
    ? I have tried but get
    PactMismatchesException
    saying the request was not received
    m
    t
    • 3
    • 69
  • s

    sameena syed

    12/06/2022, 11:23 AM
    Hi, I would need to automate the grpc, events like kafka. Can someone point to me the right docs through which i can get started. Few open questions i have 1. Is it only through plugins ? 2. Is there any language limitation (looking mostly to use it with C#) ?
    m
    • 2
    • 1
  • b

    Basu Silviu

    12/06/2022, 1:24 PM
    hi guys, trying to follow the example from the CLI page I get the following err:
    Copy code
    docker run --rm  -w ${PWD}  -v ${PWD}:${PWD}  -e PACT_BROKER_BASE_URL  -e PACT_BROKER_USERNAME  -e PACT_BROKER_PASSWORD   pactfoundation/pact-cli:latest   publish   ${PWD}/example/pacts   --consumer-app-version fake-git-sha-for-demo-$(date +%s)   --tag-with-git-branch
    fatal: detected dubious ownership in repository at '/home/myuser/workspace/pact-ruby-cli'
    To add an exception for this directory, call:
    
    	git config --global --add safe.directory /home/myuser/workspace/pact-ruby-cli
    PactBroker::Client::Error - Command `git rev-parse --abbrev-ref HEAD` didn't return anything that could be identified as the current branch.
    ---------- running
    Copy code
    git config --global --add safe.directory /home/myuser/workspace/pact-ruby-cli
    doesn't fix the err ---------- running
    Copy code
    git rev-parse --abbrev-ref HEAD
    returns
    master
    b
    • 2
    • 4
  • b

    Basu Silviu

    12/06/2022, 1:24 PM
    any ideeas pretty please?
    y
    s
    m
    • 4
    • 67
  • y

    Youri

    12/07/2022, 8:09 AM
    Hi all, question: we have a monilitihic API (documented in open api) that we use internally and is available to our customers. We don't have a microservices architecture and don't plan to. What advantages does bi-directional testing bring over say testing with Postman only?
    m
    t
    • 3
    • 3
  • d

    Dmitry Munda

    12/07/2022, 12:16 PM
    hi! we are moving to
    deployedOrReleased
    and i want to clarify one more stuff • we deploy FE app( lets say twice a week ) , which has some support time and is marked as released • we deploy BE ( lets say twice a week ) both FE and BE parts could be consumers and providers current BE has
    deployedOrReleased
    selectors, so it verifies all FE in the wiled -thats ok 🙂 at which point / how FE part ( marked as released , lets say 2 months ago ) will be verified against upcoming BE part ?
    m
    • 2
    • 8
  • y

    Youri

    12/08/2022, 11:43 AM
    (newbie alert) When a consumer needs a new endpoint or some new fields, this should be in close collaboration with the provider right? So before the consumer testing is done, or at least before uploading the contracts. When the provider agrees and implements the contract it can document the new fields/endpoints in for example an open api document. It just that the open api document is not the starting point. Still trying to wrap my head around the whole CDC concept :)
    m
    • 2
    • 2
1...111213...18Latest