https://pact.io logo
Join Slack
Powered by
# pact-net
  • l

    Lewis Prescott

    04/19/2022, 2:16 PM
    Anyone using PactNet with .Net 6 yet? Interested in understanding how you are dealing with the absence of Startup Class
    f
    b
    +4
    • 7
    • 27
  • m

    Madhulika Mitra

    05/09/2022, 10:28 PM
    Hi Team - Could anyone working on this combination suggest? My consumer is JVM pact version 4.1.7 and my provider is DotNet pact version 3.0.2. The matchers and generators made from consumer is being ignored at provider layer. Does the provider need to upgrade to 4.0.0-beta.3 to get this supported?
    m
    • 2
    • 4
  • m

    Madhulika Mitra

    05/10/2022, 1:39 PM
    hello dear friends - i saw the IPactVerifierSource WithCustomHeader(string name, string value); in here , i am unable to use it IPactVerifierSource in .4.0.0-beta.3 does not have this . Could anyone who has used it throw light on how this is done with 4.0.0-beta.3 version? @Adam Rodger (pact-net) 🦸 some guidance here
    a
    • 2
    • 1
  • s

    Sophie Bossé

    05/12/2022, 12:46 PM
    I'm trying to write contract tests for an object that contains a dictionary of objects. I want to verify the entries respect my contract. The keys are changing between the consumer and provider. Right now, the matching rules of my contract are trying to find specific keys in the body of my message such as
    "$.properties.desired.deploymentsRemovals['4JgEA5GCeqwVsu6Qada9XS'].appId"
    Is it possible to write contract tests in my situation? I'm using the PactNet nuget version 4.0.0-beta.3. Using a matcher on the key such as
    Copy code
    deployments = new Dictionary<object, object> {
                                {Match.Type("6XKISmGMWynbwM52mxov6S"),  
                                    new {...
    produces a contract searching for "pactNet.Matchers.TypeMatcher" as the key
    Copy code
    "deployments": {
              "pactNet.Matchers.TypeMatcher": {
    👋 1
    y
    c
    a
    • 4
    • 16
  • m

    Matt Lund

    05/20/2022, 9:08 PM
    With apologies for asking something that I see has been asked before... I'm evaluating pact.io and I'm a microservices / .net software engineer. I ran into the issue where TestServer doesn't appear to work with the provider test side because it doesn't expose a real TCP socket. I saw a lot of talk about it but I'm still not clear on whether it's a no-go or whether it can be done. If I could get some clarification that'd be helpful!
    l
    m
    +4
    • 7
    • 12
  • d

    David Hvilava

    05/25/2022, 9:05 AM
    Hi guys! I'm adopting Pact on my project. Maybe I misunderstood it. Considering Pact.Net v4, shouldn't
    IPactUriOptions
    provide an ability to publish verification results similar to
    IPactBrokerOptions
    ? Example: a contract is changed and published to PactFlow, then a webhook triggers a provider CI to check the contract, then we need to publish verification results back to PactFlow
    a
    m
    +2
    • 5
    • 21
  • a

    Adam Rodger (pact-net)

    05/26/2022, 1:25 PM
    #C9UTHV2AD Release Announcement 🎉 Now that we've been in beta for a good while I think we're ready for a proper release of PactNet 4.0.0. I think we've ironed out any teething issues now, so thank you to all those that have participated in the beta and raised issues for me to fix 🎉 I've got the current latest beta running in production at my employer and everything appears to be working OK. Of course there will be more features and things to add in the future, but I think the core functionality is all there and the API can be considered stable. So, assuming there are no more big issues before then, I'm planning to release PactNet 4.0.0 on 6th June 2022. I'd do it sooner but I'm on holiday next week 😄
    🙌 6
    y
    • 2
    • 1
  • j

    Jarek Rzdbk

    05/26/2022, 5:31 PM
    Hello, is there something for .net like wiremock-pact-generator? https://docs.pactflow.io/docs/bi-directional-contract-testing/tools/wiremock I tried contract tests, now want to try bi directional approach with wiremock, since I already have it thank you.
    y
    • 2
    • 2
  • y

    Yousaf Nabi (pactflow.io)

    05/26/2022, 6:18 PM
    Not to detract from Adam’s epic announcement about a Planned release of PactNet 4.0.0 on 6th June 2022 🚀 but this one almost slipped me by, so want to make sure it doesn’t slip you by.❣️ 🚨 Using Wiremock & .NET. 🔥 Now you can generate Pact 🔗 contracts from your Wiremock Server 👉 Check it out here https://lnkd.in/eKagaDHn 📖 Background https://lnkd.in/egczVAex 😍 Thanks Stef Heyenrath for the work, Bas Dijkstra for the connection and Tom Akehurst for creating wiremock in the first place
    🎉 1
    a
    • 2
    • 2
  • g

    GitHub

    05/27/2022, 3:44 PM
    #396 Add SourceLink and Deterministic Builds Support New issue created by adamrodger We should add SourceLink support to the NuGet package to aid people debugging pact tests. This allows people to step into PactNet during debugging sessions with full source code support. After adding SourceLink it's possible to enable Determinsitic Builds which allows the consumer of a NuGet to verify that the binaries within were built from the publicly available source code, and therefore have not been tampered with. This helps us to be a team player in preventing supply chain attacks. pact-foundation/pact-net
    👀 1
    m
    • 2
    • 1
  • a

    Adam Rodger (pact-net)

    06/06/2022, 11:36 AM
    🎉 🎉 🎉 PactNet 4.0.0 is now released and pushed here: https://www.nuget.org/packages/PactNet/ See the upgrade guide for details of the rewrite and how to upgrade from 3.x to 4.x: https://github.com/pact-foundation/pact-net/blob/4.0.0/docs/upgrading-to-4.md
    party parrot 3
    🎉 4
    m
    • 2
    • 1
  • p

    pooja sharma

    06/12/2022, 3:00 PM
    hello, I am trying to publish pact file created locally to my pactflow account. But looks like I need "pactfoundation/pact-cli:latest" docker image running to talk to broker for Pact Net 4.x.x onwards, is there any documentation or code example on how to do that? Any help will be greatly appreciated, thanks
    y
    m
    s
    • 4
    • 33
  • e

    Eugene Baranovsky

    06/14/2022, 2:11 AM
    Hey team, is there a way to make verifier (broker source) to fail the verification when results publishing bit failed? I am getting ✅ tests with error message in logs
    Copy code
    [ERROR][pact_verifier] Publishing of verification results failed with an error
    m
    • 2
    • 6
  • p

    Prasad

    06/16/2022, 3:36 PM
    Hello All, I am new to Pact and about to start implementing contract testing using PactNet.
  • p

    Prasad

    06/16/2022, 3:56 PM
    Got my answer here - https://github.com/pact-foundation/pact-net/blob/master/docs/upgrading-to-4.md
  • e

    Eugene Baranovsky

    06/17/2022, 3:08 AM
    Hey team, while working with Provider Verifier from pact-net 4 I noticed that there is a built in way to publish verification results back to the broker if you use
    WithPactBrokerSource
    . My question is are there any plans to have similar verification result publishing capability when using
    WithUriSource
    ?
    m
    • 2
    • 13
  • p

    Prasad

    06/25/2022, 3:09 PM
    I am writing a contract test for a post method where I need to pass a file in request Body as 'form-data'. How do I write this in pact interaction. I have tried this but it doesn't work.
    m
    • 2
    • 13
  • s

    Slackbot

    06/27/2022, 3:55 PM
    This message was deleted.
  • p

    pooja sharma

    06/27/2022, 4:14 PM
    Hello, what does the ".WithProviderStateUrl" method do on the provider-verify tests?
    m
    • 2
    • 2
  • p

    Prasad

    06/29/2022, 11:02 AM
    Hello, In pactNet V4, I don't see an option to set log file path within PactConfig. What's the default location for log file path then? Also Is it possible to change the path for log files? This is my PactConfig but I dont see any log file generated
    m
    • 2
    • 3
  • m

    Myles Johnson

    06/29/2022, 4:31 PM
    Hi team, Does anyone have a good example of a Azure ADO yml build pipeline that meets the requirements of the gold nirvana stage (https://docs.pact.io/pact_nirvana/step_5)? Regards MJJ
    m
    • 2
    • 12
  • t

    Thomas

    07/01/2022, 10:27 AM
    Hi, I see there is an ability to create an auto matcher for Go (link to doc), can we do the same in .NET? I can't find it in the documentation. Any guide/example would be really appreciated. 🙏
  • m

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

    07/01/2022, 10:30 AM
    Personally, I’ve found that feature not very helpful - it really is only useful in happy path scenarios, and is not at all helpful in situations where you have some fields you expect to come back and others not. I’ve just found it leaks test data into the domain model definitions, which I’m not sure is a good thing
  • m

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

    07/01/2022, 10:30 AM
    that being said, I don’t believe it exists
  • t

    Thomas

    07/01/2022, 10:37 AM
    We have a use case that we trust everything from master/main branch (as we tested and deployed before we merged into master/main), so we want to use the master/main branch to generate the matcher, and match the mock data that we have created.
  • m

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

    07/01/2022, 10:52 AM
    I don’t believe one exists, although I suppose you could spike it?
  • m

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

    07/01/2022, 10:54 AM
    The reason why I think it’s fraught, is that it’s unusual that any domain model is always an all-or-nothing version of itself. e.g. with a Product, you might have some fields that are populated for certain classes of products and different ones for others. There may be other fields that have enum types and the type of that field can change which required/optional fields come back. This can’t be easily done in the way the Golang struct tags work, because they are either there or not - so it means you can only every use those matchers for the “happy path” or default scenarios.
  • m

    Myles Johnson

    07/11/2022, 5:27 PM
    Hi. I'm trying to integrate the pact-cli into my ADO pipeline via a docker image. I can't get the pubish command to work. The problem seems to be that the volume mapped pact file cannot be seen by the publish command. I know the file is mapped correctly as I have used the following to prove this: docker run --rm -v $(Build.SourcesDirectory):/var/lib/pacts xyz.azurecr.io/pact-cli:v1 ls /var/lib/pacts/createdcontracts However, whenever I use the same path in my publish command I see a message about the files been missing e.g. "Specified pact file '/var/lib/pacts/createdcontacts' does not exist. This sometimes indicates one of the arguments has been specified with the wrong name and has been incorrectly identified as a file path." My publish command in the pipeline looks like this: *docker run --rm -v $(Build.SourcesDirectory):/var/lib/pacts xyz.azurecr.io/pact-cli:v1 publish /var/lib/pacts/createdcontacts/ConsumerService-ProviderService.json -b="*" -k="**" -a="1.0.0 -v"*
  • m

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

    07/12/2022, 4:04 AM
    Are you sure that
    ls
    command works? The default entry point is not bash it's a pact executable so I'd expect that to fail as it's not a valid subcommand
  • m

    Myles Johnson

    07/12/2022, 8:37 AM
    Yes, 100% certain. I can see the ls output in the ADO build pipeline output
12345...9Latest