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

    Zeus

    09/23/2022, 8:32 AM
    Hello! I need some advise. Let’s say there are two services A and B connected using http and protobuf A -> monolithic legacy service which is written in
    Ruby
    (Consumer) B -> microservice which is written in
    GoLang
    (Producer) Do I need to use
    pact-ruby
    and
    pact-go
    on consumer and producer side respectively? Is there anything in addition I should before introducing the pact contract tests?
    t
    • 2
    • 9
  • t

    tmegha

    09/23/2022, 9:13 AM
    Hi All, What are the best practices for provider versioning? Is it possible to make the versioning dynamic? I went through the docs that recommend appending the commit sha to the version but how do you decide whether it should be v1 or v2 dynamically or does the developer need to update the Provider version on each change to the provider? ref-https://docs.pact.io/getting_started/versioning_in_the_pact_broker Any help will be appreciated!
    👋 1
    m
    t
    • 3
    • 6
  • t

    Thomas K

    09/25/2022, 6:43 PM
    Hello, quick question regarding
    recording deployments and releases
    on the provider side. When we deploy the provider to an environment (e.g.
    staging
    ), it is deployed to multiple
    staging
    k8s clusters. Should something like
    application instances
    be considered for deployment of the provider app into each cluster when recording deployment in the pact broker? We were looking at doing the
    record-deployment/release
    command on provider side as a helm post-install job, but then the command I guess would be run for deployment to every cluster, but I imagine we maybe only need the command called once for the deployment to
    staging
    environment, rather than for each
    staging
    cluster ? Would really appreciate any tips on correct approach here. We were looking at this helm post-install hook approach as this better ensures that deployment (to a cluster etc) was actually successful before we run the
    record-deployment
    command
    t
    m
    • 3
    • 14
  • m

    Maksym Liannoi

    09/27/2022, 10:12 AM
    Hello! Can anyone please tell me if anybody has experience sending requests with Content-Type
    "application/octet-stream"
    (pact-js library) and verification on the provider side with C# language (pact-net library)? Because of many of my attempts, the response is 200 on the provider side, but when I try to test HTTP 400 Bad Request, I cannot find a suitable
    withRequest
    body for that test.
    Copy code
    test("...", async () => {
                    const badRequestData = {
                        error: {
                            code: "validationError",
                            message: "Validation error(s) has occurred",
                            details: [],
                        },
                    };
                    const badRequestResponse = somethingLike({
                        error: {
                            code: like(badRequestData.error.code),
                            message: like(badRequestData.error.message),
                            details: like(badRequestData.error.details),
                        },
                    });
                    const status = 400;
    
                    await provider.addInteraction({
                        state: "...",
                        uponReceiving: "...",
                        withRequest: { method, headers, path, body: "\u0000" },
                        willRespondWith: { status, body: badRequestResponse },
                    });
                    expect.assertions(3);
                    try {
                        await testService.sendContent(mailboxId, content);
                    } catch (e) {
                        checkIfHttpError(e, status);
                        expect((e as AxiosError).response?.data).toStrictEqual(badRequestData);
                    }
                });
    Copy code
    [ApiController]
    [Route("test")]
    public class TestController : ControllerBase
    {
        private readonly ITestService _testService;
    
        public TestController(ITestService testService)
        {
            _testService = testService;
        }
    
        [HttpPost("...")]
        [Authorize(...)]
        [Produces("application/json")]
        [Consumes("application/octet-stream")]
        [ProducesResponseType(type: typeof(TestResponse), StatusCodes.Status200OK)]
        [ProducesResponseType(StatusCodes.Status400BadRequest)]
        [ProducesResponseType(StatusCodes.Status401Unauthorized)]
        [ProducesResponseType(StatusCodes.Status500InternalServerError)]
        public async Task<TestResponse> HandleAsync(string id, [FromQuery(Name = "fileName")] string? fileName)
        {
            if (Request.ContentLength == 0)
            {
                throw new InvalidArgumentException("Request body should not be empty");
            }
    
            var messageId = await _testService.HandleAsync(id: id.ToLower().Trim(), fileName, Request.Body);
    
            return new TestResponse(messageId);
        }
    }
    m
    • 2
    • 13
  • m

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

    09/27/2022, 11:00 AM
    🎤 Last week I spoke at API Days in Melbourne, about how Schemas are not contracts and how contract testing is still relevant in the age of gRPC, Kafka and GraphQL! The talk is live here 👉

    https://www.youtube.com/watch?v=ICwB_H1nyW4&amp;list=PLmEaqnTJ40OodNzyBYYedoKLZsR9I-nXA&amp;index=27▾

    Part theory, part rant, part signalling what’s to come with Pact - I hope you enjoy and let me know what you think 👀
    🎉 2
  • s

    Slackbot

    09/27/2022, 11:00 AM
    https://pactflow.io/blog/schemas-are-not-contracts/
  • z

    Zeus

    09/27/2022, 11:12 AM
    Hello, I’ve recently joined a new project and currently we don’t have anything to test the integration between two services. We are planning to introduce the contract testing, however, I’m curious to know if we add contract tests, do we still need to create another layer in the test pyramid to carry out the functional integration testing? Or is it possible to tweak our contract tests in such a way that just one layer of contract tests can help with functional testing as well? (I understand that it will make the tests unnecessary complicated, but just checking about the feasibility of covering functional testing as part of pact testing layer). I would like to know your opinion on this 🙂
    👋 1
    👍 1
    m
    t
    • 3
    • 3
  • h

    Hazem Borham

    09/27/2022, 8:46 PM
    question about matching arrays. i have a pact that i'd also like to reuse as a stub for testing the consumer ui. my goal is to generate a realistic response that i can reuse as a stub for a ui integration test and also a minimalistic pact definition for the provider to verify, eg atLeastOneLike. is there a matching option that would generate something to support this? pseudo specification
    Copy code
    {
        picklists: atLeastOneLike([
          {id: 1, name: 'She/Her'},
          {id: 2, name: 'He/Him'},
          {id: 3, name: 'They/Them'},
          {id: 4, name: 'Other'},
        ])
      }
    so that the generated stub response for the consumer definition is:
    Copy code
    {
        picklists: [
          {id: 1, name: 'She/Her'},
          {id: 2, name: 'He/Him'},
          {id: 3, name: 'They/Them'},
          {id: 4, name: 'Other'},
        ]
      }
    and the generated matcher for the provider is:
    Copy code
    "matchingRules": {
        "body": {
          "$": {
            "combine": "AND",
            "matchers": [
              {
                "match": "type"
              }
            ]
          },
          "$.picklists": {
            "combine": "AND",
            "matchers": [
              {
                "match": "type",
                "min": 1
              }
            ]
          }
        },
    t
    m
    • 3
    • 13
  • d

    Dmitry Munda

    09/28/2022, 11:35 AM
    hi! compatibility is verified against latest versions with tag is there a mechanism, to verify against • latest n versions with tag ◦ or • versions having tag within last n months
    m
    • 2
    • 14
  • n

    Noor Hashem

    09/28/2022, 1:07 PM
    Hi! I was wondering if it was possible with pact to have the consumer tests run against a live provider instead of just the static contract?
    y
    • 2
    • 1
  • s

    Shuo Yang

    09/28/2022, 7:53 PM
    Hi Pacters, We are moving from monolithic app to the micro-service, and I felt end-2-end testing is not sustainable. I just got to know this open source project. However, though I understand what pact wanted to enable us (doing away with the dependence toward e2e testing yet maintaining the peace of mind of releasing), I did not fully understand how can a provider team’s code commit and trigger consumers’ contract testing
    👋 3
    y
    m
    • 3
    • 3
  • s

    Shuo Yang

    09/28/2022, 8:00 PM
    Imagine a provider service lives in a repo GitHub.com/sean/provider.git (hypothetical), it provides an api of 1+1=2; and now, as the owner of this api, I wanted to change it to 1*1=1 (which breaks the contracts, but I did not know) I’d like to get help to understand how pact can help me to know I am checking in something that is impacting my consumers.
    y
    s
    m
    • 4
    • 10
  • a

    Alan Zhu

    09/30/2022, 9:31 AM
    Hey team I try to find some GraphQL solutions on Pact but find it's TBC in the docs, any reference on it ?
    m
    • 2
    • 1
  • t

    Thai Le

    09/30/2022, 4:46 PM
    Hello, Let say I have 3 applications A, B and C calling each other like this A->B->C within the same API. I understand that the provider test is to check if the provider B implementation complies with the pact generated by the consumer A and since we ae testing implementation, we need the B running with its implementation. However the provider B is also a consumer of provider C. Does it mean the provider test of B also need C running with its implementation?
    m
    • 2
    • 1
  • a

    Ashok

    10/03/2022, 10:25 AM
    Hi Guys, a simple question If consumer contract contains properties not defined in provider contract for this pactflow doesn't throw any error. I want to understand if validation should be there in pactflow for such scenario or not ?
    m
    • 2
    • 6
  • t

    Thomas K

    10/03/2022, 1:38 PM
    Hello, I just made a sample webhook in my local CLI like this example
    Copy code
    pact-broker create-webhook <https://api.github.com/repos/ORG/REPO/dispatches> \
    > --header=Authorization Bearer $PAT \
    > --request=POST \
    > --consumer=ConsumerApp \
    > --provider=ProviderService \
    > --contract-requiring-verification-published
    In my output I got
    Webhook "POST <http://api.github.com|api.github.com>" created
    but no UUID, this is using the ruby
    pact-cli
    ... When I try via docker run, I get the same output without any UUID, can anyone help please or know why?
  • t

    Thomas K

    10/03/2022, 1:51 PM
    ah it looks like i see it in the json response when i go to
    /webhooks
  • t

    Thomas K

    10/03/2022, 9:24 PM
    Hello, one more question regarding creating webhook with pact broker please, docs say that —data flag accepts file or string, but when I give a json file path (absolute) it doesn’t work, but passing the json contents as a string does work, is there something I’m missing when trying to use file instead of string? It’s like it reads the file path as a string
  • y

    Yousaf Nabi (pactflow.io)

    10/05/2022, 1:09 PM
    Hey everyone and happy Wednesday. I have a double treat lined up for you. For the past few years, SmartBear has fielded responses from thousands of API practitioners to map out the current state of the industry. From this data, we are able to identify major industry trends and share them back to you and the community in one comprehensive report, you can take a look at the 2021 report here. We would love your help to make this year's survey our best yet, and because your time is so valuable, by completing the survey (~15 minutes), you will be given an opportunity to direct a donation, given by SmartBear, to your choice of one of the following charities: Make a Wish, AnitaB.org, or Clearloop. Helping us with this report will hugely benefit Pact and Pactflow, in shaping our Roadmap for the future (Multi-Protocol Support need in the market === More time spent working on the Pact Plugin ecosystem) , whilst listening to the very heart of what keeps us doing what we are doing - You! Whilst the state of software quality will look forward to the future, we want to show you what we've been up to from product enhancements and future roadmap, news, events, and industry insights in September. You can find it in our Pactflow POST, the attached PDF for perusal at your leisure. That's all for now, but tune in later in the month when the Pactflow Open Source POST will be going out, telling you about all the awesome contributions that have been occurring across the Pact foundation!
    🙌 1
    👀 2
    👍 2
  • n

    Noor Hashem

    10/05/2022, 6:13 PM
    RESOLVED: Hey! How can I input my credit card to pactflow so that I can upgrade to payed version?
  • z

    Zeus

    10/06/2022, 7:09 AM
    Hey, Do we have any example on how to define the tests on consumer side if REST API consumes protobuf instead of json?
    m
    • 2
    • 3
  • m

    Matteo

    10/11/2022, 12:12 PM
    Hello guys, i'm working to a PoC with Pact for a company. Any of you with some experience in Event Driven Testing with Pact? Thank you 🙂
    m
    • 2
    • 3
  • p

    Phillip Lo

    10/11/2022, 4:21 PM
    Hey, I have question about recommendations on handling secret key rotations. We have webhooks set up to call CI jobs as recommended to do verifications when contracts change. However, this is currently making the call using an API key that gets rotated every once in a while. What do people do in these situations? Its not feasible to go and update each webhook every time the key changes so I'm curious what the recommendation is from Pact.
    m
    • 2
    • 11
  • s

    Stefan Tertan

    10/13/2022, 9:50 AM
    accidentally made a request to install a Slack app in this workspace instead of the one it was meant for...ignore that (incident.io)
    m
    • 2
    • 1
  • a

    Alan Zhu

    10/17/2022, 12:40 PM
    Hey team.In consumer driven contract test. I was curious to understand what is the benefit of me a consumer testing the producer, instead of the producer making sure they keep their API contract and have test in place to validate that each new release does not brake their API as they agreed to provide it to their consumers?
    m
    • 2
    • 1
  • p

    Phillip Lo

    10/18/2022, 8:09 PM
    Got a question about pacticipant names. I know that there is a built in check to make sure that you dont have similar/duplicate pacticipant names. However, we are running into a situation where we've deleted the "integration" between two services from the broker ui however the broker is still giving us the error of a pacticipant name being too similar. I wanted to know if this is expected behavior and if we have to go in an manually delete the pacticipant in addition to deleting the pact integration itself? I'm curious what the reasoning behind checking against pacticipant names that dont have any current integrations are.
    m
    • 2
    • 7
  • s

    Shirley

    10/19/2022, 8:11 AM
    Hello,
  • s

    Shirley

    10/19/2022, 8:13 AM
    I'd like to pass in dynamic path to PathFolder. Does anyone have any workaround?
    m
    • 2
    • 2
  • n

    Nerea

    10/19/2022, 1:01 PM
    Hey team! Do you know if there is any channel for applying pact for Tibco/SAP ?? The case is an integration between a java application with SAP system through Tibco (xml stream). The idea is applying Pact on both sides between SAP - Tibco and Tibco - java system. Do you know if tehre is any channel for this type of technologies?
    t
    • 2
    • 2
  • n

    Noor Hashem

    10/19/2022, 4:11 PM
    Hi all, if I remember correctly a few weeks back I saw messages about a pact course coming out soon? Has this course come out yet?
    m
    s
    +2
    • 5
    • 5
1...91011...18Latest