https://pact.io logo
Join Slack
Powered by
# pactflow
  • o

    Omar Sadd

    10/05/2022, 2:55 PM
    Hi All, quick question Does anyone of you have an explanation for this? I'm supposed to have the UI swagger. but I have No API definition provided.
    y
    m
    • 3
    • 9
  • k

    Kenneth Krause

    10/06/2022, 4:58 PM
    Hi. We have SSO using AzureAD and I am trying to figure out where our problem is. I have removed users in AzureAD from the pactflow group, but the users are not getting removed from pactflow user list. So we are showing more users have access than our external IdP. Can you advise where the problem may lie? Adding new users is not a problem--they have access within minutes, so the ADD integration is working.
    m
    • 2
    • 1
  • r

    Rachel Butler

    10/06/2022, 6:30 PM
    Hi! I'm hoping this is the right channel to ask this question ... we are using the "Hosted Stubs" feature of PactFlow and are having some trouble coming up with regular expressions for dynamic paths that have path parameters followed by other information. For example, we have two endpoints "/accounts/{accountId}" and "/accounts/{accountId}/transactions" that we would expect two different responses. Currently we are using the regex expressions "\/accounts\/[A-Za-z0-9]+" and "\/accounts\/[A-Za-z0-9]+\/transactions" to try and accomplish this, which works fine for "/accounts/123", but "/accounts/123/transactions" is returning the same response. Anyone have any guidance on how to get around this? It looks like somehow the stub is returning the first path that contains that regex, and does not match it exactly. I have already tried "^\/accounts\/[A-Za-z0-9]+$" but it seems like the ^ and $ are being taken as the characters themselves, not the beginning and end. Any help would be appreciated :)
    👋 2
    y
    • 2
    • 7
  • n

    Noor Hashem

    10/11/2022, 3:52 PM
    Hello, Does anyone know how I can set the branch name of a consumer driven contract testing provider? On the consumer I just set the branch name in the github workflows when it publishes the pact but on the provider i am not sure where I can pass in the branch name.
    y
    • 2
    • 5
  • n

    Noor Hashem

    10/11/2022, 5:35 PM
    Hi! Are there some kinds of before and after for states on the provider side? How can we clean up the database in between different states?
    m
    • 2
    • 10
  • a

    Alicia (pactflow.io)

    10/13/2022, 1:19 AM
    Need some help bringing others along with you on your contract testing journey? My new blog makes the case for why contract testing should be a vital part of your API testing strategy - not a nice to have - and shows where it fit in. Have a read and let me know what you think 🙂
    👀 1
    👌 1
    🙌 3
  • c

    Cyrus Devnomad

    10/13/2022, 11:53 AM
    Hello I have a provider with an API method which accepts a POST query with the following request body:
    Copy code
    {
      "recipients": [
        {
          "firstName": "string",
          "lastName": "string",
          "emailAddress": "string"
        }
      ],
      "subject": "string",
      "content": "string"
    }
    And I have a consumer which sends a request to the provider with following request body:
    Copy code
    {
      "Content": "<h1>test</h1>",
      "Recipients": [
        {
          "EmailAddress": "<mailto:test@test.com|test@test.com>",
          "FirstName": "Test",
          "LastName": "User"
        }
      ],
      "Subject": "Test subject"
    }
    I'm trying to have Pact based bi directional contract testing working between these two apps. When I publish both the provider OpenAPI definition and the consumer pact, Pactflow complains about the consumer pact being incompatible with the provider. The message is like this:
    Copy code
    Incompatibility With Provider Contract
    
    Request Body Is Incompatible
    
    Request body is incompatible with the request body schema in the spec file: should NOT have additional properties
    Mismatched at:
    [root].interactions[0].request.body
    I manually changed the pact file to have properties starting with lower letters and then published the manually modified pact file and then Pactflow was happy and there were no more errors about incompatibility. My question is, can this case sensitive behavior be disabled by some configuration option? Thanks
    m
    y
    • 3
    • 4
  • n

    Nigel Finley

    10/14/2022, 9:18 PM
    Hello, I am using Pactflow and specifically Bi-directional testing and I am running into an interesting error during contract comparison. The error I am running into is:
    Copy code
    Validator Error
    can't resolve reference #components/schemas/class from id #
    Here is the api spec:
    Copy code
    openapi: 3.0.0
    info:
      title: "API"
      version: "1.0.0"
    components:
      schemas:
        class: 
          type: object
          properties:
            attempted:
              type: boolean
    paths:
      /api/v1/instructor/me:
        get:
          tags:
            - Instructor
          description: This will fetch a users classes.
          responses:
            200:
              description: You have successfully found all classes and their status for the current user
              content:
                application/json:
                  schema:
                    type: object
                    properties:
                      Classes:
                        type: array
                        items:
                          $ref: '#components/schemas/class'  
                      Elem:
                        type: array
                        items:
                          $ref: '#components/schemas/class'
                      Trainings:
                        type: array
                        items:
                          $ref: '#components/schemas/class'
                      Sela:
                        type: array
                        items:
                          $ref: '#components/schemas/class'
                      SelaFT:
                        type: array
                        items:
                          $ref: '#components/schemas/class'
            401:
              description: Unauthorized
    And here is the consumer contract:
    Copy code
    {
      "consumer": {
        "name": "Consumer"
      },
      "provider": {
        "name": "Provider"
      },
      "interactions": [
        {
          "description": "A request for a single user classes",
          "providerState": "User exists with no classes",
          "request": {
            "method": "GET",
            "path": "/api/v1/instructor/me",
            "headers": {
              "Authorization": "Bearer undefined",
              "Accept": "application/json, text/plain, */*",
              "Cache-Control": "no-cache"
            }
          },
          "response": {
            "status": 200,
            "headers": {
              "Content-Type": "application/json; charset=utf-8 "
            },
            "body": {
              "Classes": [],
              "Elementary": [],
              "Sela": [],
              "SelaFT": [],
              "Trainings": []
            }
          }
        }
      ],
      "metadata": {
        "pactSpecification": {
          "version": "2.0.0"
        }
      }
    }
    Hoping to get some guidance as to why I might be receiving this error. I have validated the Spec. One thing I was curious about is I am using the the pact specification of
    2.0.0
    on the consumer side. Should I be using
    3.0.0
    ? Thank you!!!
    y
    • 2
    • 5
  • n

    Noor Hashem

    10/18/2022, 9:40 PM
    Hi all, QQ, if a consumer uses several providers and then changes their expectations for each one of those providers, in the consumer driven contract testing would that mean that now in the consumer PR we need to checkout each one of those providers and run the verification? I have a flow where when the consumer makes a changes the provider is checkout out in github workflows and the tests are run, then if they pass they can merge to master.
    m
    t
    • 3
    • 9
  • t

    Thomas

    10/21/2022, 11:01 AM
    Hello, Pactflow shows
    head
    as branch and not
    master
    (as I expected). Is this the expected behaviour or is something wrong in my pushing script?
    m
    u
    b
    • 4
    • 5
  • f

    Francisco Quijada

    10/21/2022, 2:13 PM
    Hello, Could you please show me an example in js to make my first connection with pactflow, to be able to generate the pac and send it to the pacbroker and make the complete flow between the consumer and the provider?
    y
    • 2
    • 1
  • f

    Francisco Quijada

    10/21/2022, 2:40 PM
    Copy code
    hello, where can I find the broker username and broker password in pactflow?
    y
    • 2
    • 2
  • b

    Brendan Donegan

    10/21/2022, 3:38 PM
    I encountered a number of errors today when trying to use the API in particular, just a heads up
    m
    • 2
    • 2
  • f

    Francisco Quijada

    10/23/2022, 1:06 AM
    Hello, how to use in windows pac cli? I download this package but I don't find instructions about how to use it on windows, I want to publish a contract from the consumer to pacflow, thanks for your help
    m
    • 2
    • 4
  • n

    Noor Hashem

    10/24/2022, 1:44 PM
    Hello, I got the attached error message when I was merging my webhookless consumer into master, i've already merged the provider side with no errors. The step it failed on was publishing the pact step where I run this command:
    npx pact-broker publish ./pacts  --branch=$GITHUB_HEAD_REF --broker-base-url=$pact_broker --broker-token=$pact_broker_token --consumer-app-version=${version} --tag testing_tag
    . The github workflows always passes on the PR, but for some reason it failed when I tried merging it. I have never see this error before on my PR. The only place I see
    consumer_version_number
    is here, link but i'm working with the webhookless approach. I took a look at the example webhookless consumer on github that you guys have but I also don't see a consumer_version_number in the workflows anywhere. Please let me know if you'd like me to provide any more information.
    m
    y
    • 3
    • 7
  • n

    Noor Hashem

    10/24/2022, 7:05 PM
    Hi pactflow team, i'm currently having trouble implementing the webhookless approach to pactflow. In this query i'll try and provide as much information and files as possible. I've attached both the github workflow files as well as the consumer and provider tests. Right now I am facing a few problems. The first is the one I mentioned right in the above post ^. The second is that if the test fails on the consumer PR then it blocks the provider, now I know that this is covered in the docs via pending pacts. I tried using the pending as well as WIP features to solve this but clearly I think something is wrong with my flow. I feel that i'm close but might just be missing a few small pieces here and there. Please let me know if you would like me to provide any more information.
    consumerTest-guest-user-contract.pact.test.jsprovider_pactflow.ymlproviderTest-guest-users.pact.test.tsconsumer_pactflow.yml
    m
    y
    • 3
    • 6
  • r

    Rachel Butler

    10/25/2022, 3:32 PM
    Hi, I also put this in pact-jvm channel but I'm unsure if that's correct or if this would be the right channel ... we are trying to get Pact JVM's matchQuery() to work with PactFlow's Hosted Stubs. Because matching rules are a requirement for us, we are using Pact v2 contracts. In our efforts to try and get dynamic query parameters working, we are facing the below error:
    Copy code
    Error from Pactflow stub: Pact::Error - Value to generate \"[\"string\"]\" does not match regular expression /[A-Za-z0-9]{1,}/
    For reference, we have tried both of the two ways (one including a custom example, and the other not):
    Copy code
    // Example not included (Pactflow generates randomly)
    pactDslRequestWithPath = pactDslRequestWithPath.matchQuery(parameter.getName(), "[A-Za-z0-9]{1,}");
    // Example included
    pactDslRequestWithPath = pactDslRequestWithPath.matchQuery(parameter.getName(), "[A-Za-z0-9]{1,}", "string");
    Here is the relevant part of the contract that was generated:
    Copy code
    "request": {
       "method": "GET",
       "path": "<path>",
       "query": "response_type=string&client_id=string&redirect_uri=string&state=string&scope=string",
       "matchingRules": {
          <path>,
          "$.query.response_type": {
             "match": "regex",
             "regex": "[A-Za-z0-9]{1,}"
          },
          "$.query.client_id": {
             "match": "regex",
             "regex": "[A-Za-z0-9]{1,}"
          },
          ...
    }
    We were facing similar issues with machPath() when we were not including the example, but including the custom example worked in that case. Has anyone got this feature working with v2 contracts? Am I missing something?
  • a

    Anton Yakutovich

    10/28/2022, 7:48 AM
    Hi there! What happened with official twitter page? https://twitter.com/pactflow
    🔐 2
    a
    y
    • 3
    • 4
  • b

    Bas Dijkstra

    10/28/2022, 12:23 PM
    Hey all, I love how easy it is to unsubscribe for the Pactflow POST newsletter, but how do I sign up? Seems I didn't receive the latest one sent yesterday on my regular email address, but I saw it appear on another one I used before, and now I want to sign up with my regular email address again. You've hidden that feature pretty well, though!
    a
    • 2
    • 3
  • k

    kedar ghate

    10/31/2022, 2:10 PM
    Hi Pactflow team, firewall team in my project looking for IP of https://vfuk-digital.pactflow.io/ (port 443) to establish connectivity from our source systems in private network to pactflow, could you please help to get that?
    b
    • 2
    • 2
  • s

    Sashi Kandru

    10/31/2022, 4:10 PM
    https://pact-foundation.slack.com/archives/C5F4KFKR8/p1667230997084829
    y
    m
    • 3
    • 3
  • s

    Shuying Lin

    11/02/2022, 3:43 AM
    questionmario Help wanted: Pactflow contract test onboarding survey questionmario Hello @here, This is Shuying from Pactflow team. First of all, I would like to thank you for being with Pactflow pactflow platypus slack. My team and I are looking to learn more about how you started your first contract test on Pactflow and what types of onboarding and learning experience you want to see on Pactflow. This will help us make improvements to existing onboarding experience. The survey should only take 5 minutes. 🔗 Survey is here You can only take the survey once, but you can edit your responses until the survey is closed on November 11, 2022. If you have any questions about the survey, please email us: shuying.lin@smartbear.com or DM me on Slack. We appreciate your input! 🙇
    👀 1
    🙌 1
  • k

    kedar ghate

    11/02/2022, 10:51 AM
    Hi Pactflow team, we are doing POC for contact based testing where Jenkins pipeline publishes contracts to pact flow (free tier). Once POC is successful, we are keen to go for enterprise version. In this POC, pre requisite is to establish connectivity from Our Jenkins server (in private network) to pact flow https://vfuk-digital.pactflow.io/ (port 443). When referred to pact flow documentation (https://docs.pactflow.io/docs/webhooks-help/) , it says "The Pact flow application runs behind an AWS Load Balancer, with a dynamic IP range. We don't currently provide static IPs for ingress whitelisting." The security team is looking for IP address or dynamic IP range of pact flow so they can allow the flow from source to destination. As we don't have the IP or IP range, we are blocked. Looking for your support assistance to overcome the blocker.
    👋 2
    m
    • 2
    • 3
  • e

    Eddie Stanley

    11/03/2022, 8:55 PM
    If I want to be sure which version of a given provider is currently deployed to each environment, what's the easiest way to achieve that with PactFlow?
  • n

    Noor Hashem

    11/07/2022, 6:37 PM
    Hi all, quick question, I see that in the provider repo here on line 40 it uses
    - run: docker pull pactfoundation/pact-cli:latest
    but I have been using a command that looks like this:
    npx jest --testMatch '**/*.pact.test.ts'"
    does it matter which one I use? So far npx has been fine for me
    m
    • 2
    • 1
  • s

    Stefan Tertan

    11/08/2022, 12:22 PM
    Hi, I'm having some issues with bi-directional contract testing. I initially posted that here -> https://pact-foundation.slack.com/archives/C9VBGLUM9/p1667571726865759. The 2 issues I encountered were: • issues with Authorization header not being present on negative tests (testing for 401 response codes) - the resolution for that is that Pactflow does not support negative tests so I removed them • the other issue is with the response body.. it seems that the consumer pact wraps the response body and adds some additional fields, which cause the diffing to fail
    m
    • 2
    • 13
  • n

    Noor Hashem

    11/08/2022, 4:10 PM
    Hi, i'm trying to find a way to send the results of the
    Contract published that requires verification
    webhook to the consumer PR that triggered it. I see on this page here there is a link to the
    publishing-pact-verification-results-to-github
    but the link does not work. Is there any other resource teaching how to do this?
    m
    • 2
    • 4
  • n

    Noor Hashem

    11/08/2022, 9:19 PM
    Hi, when a consumer publishes a new expectation on a PR and a webhook triggers the provider verification to run a github workflow I am getting this error message
    Must provide both provider and pactBrokerUrl if pactUrls not provided.
    on that github workflow. But I configured the webhook exactly as shown here. I have attached the provider verification file that is giving the error.
    verification.pact.test.ts
    t
    • 2
    • 2
  • n

    Nathan Deamer

    11/10/2022, 11:34 AM
    Hi All, Looking into webhooks (again). When I publish a consumer in a branch, my webhook triggers to run the provider. But I seem to be getting 2 webhooks firing.
    Copy code
    [2022-11-09T18:47:44Z] DEBUG: Webhook context {"base_url":"<https://gocity.pactflow.io>","consumer_version_branch":null,"build_url":null,"consumer_version_tags":[],"event_name":"contract_requiring_verification_published","provider_version_number":"0609085aced24bfeaac13a660b9878230d44d197","provider_version_branch":"main","provider_version_descriptions":["latest from main branch"]}
    Copy code
    [2022-11-09T18:47:47Z] DEBUG: Webhook context {"base_url":"<https://gocity.pactflow.io>","consumer_version_branch":null,"build_url":null,"consumer_version_tags":[],"event_name":"contract_requiring_verification_published","provider_version_number":"562fd7aaa5c45882a8121c9968a32de10c02f983","provider_version_branch":"main","provider_version_descriptions":["deployed in dev","deployed in ext","deployed in production"]}
    The different seems to be the
    provider_version_descriptions
    -is there any documentation on this?
    n
    b
    • 3
    • 9
  • n

    Noor Hashem

    11/14/2022, 4:59 AM
    Hi all does anyone have any experience on how to set this webhook up? https://docs.pact.io/pact_broker/webhooks/template_library#github---publish-commit-status I tried setting it up in pactflow but am not entirely sure how. What I want is that when the provider verification github workflow that is triggered by the consumer PR either fails or passes, it sends some response to the consumer PR saying that the verification step either passed or failed but having a hard time setting it up.
    b
    • 2
    • 58
1...567...13Latest