bethskurrie
2018-03-24 03:39
has joined #pact-net

neil
2018-03-28 22:17
has joined #pact-net

bethskurrie
2018-05-02 04:59
/github subscribe pact-foundation/pact-net issues releases pulls

bethskurrie
2018-05-02 04:59
/github subscribe pact-foundation/pact-net issues releases pulls

bethskurrie
2018-05-02 04:59
/github unsubscribe pact-foundation/pact-net deployments public commits

heymega
2018-06-02 13:58
has joined #pact-net

richard.peckett
2018-06-07 08:22
has joined #pact-net

gxsham
2018-06-15 12:09
has joined #pact-net

gxsham
2018-06-15 12:14
Hi, I have a problem with PactNet.Windows 2.3.0. Tests run perfectly on local machine but fail with this error on VSTS: ...pact-win32/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler.rb:418:in `[]=': Invalid argument - ruby_setenv(GEM_PATH) (Errno::EINVAL)

adamgreen
2018-06-15 13:57
has joined #pact-net

bethskurrie
2018-06-15 20:41
Hm. That's going to be tricky to fix. Is there such a think as a free open source VSTS account? Also, can you raise an issue in pact-foundation/pact-ruby-standalone if you haven't already. @gxsham

dsbenghe
2018-06-17 16:28
has joined #pact-net

gxsham
2018-06-18 08:11
Yes, you can create a free vsts account and use their agents for free, the only limit is the team size - up to 5 people

bethskurrie
2018-06-18 08:27
I can fix the underlying ruby code (it's packaged as a standalone executable) but I have no experience in dot net or VSTS - would you be able to create a VSTS build that recreates the issue @gxsham?

gxsham
2018-06-18 08:48
Yes, I will try today to do it today

richard.peckett
2018-06-18 14:32
is there a simple example of using a regex verify a provider response in http://pact.net?

bethskurrie
2018-06-18 23:20
@richard.peckett it should be the same as for a request.

bethskurrie
2018-06-18 23:21
Or are you asking in general about matchers?


neil
2018-06-19 00:19
Is that what you are after?

vk.regs
2018-06-19 06:51
has joined #pact-net


bethskurrie
2018-06-19 07:09
Nulls should just do an exact match. What error are you getting?

vk.regs
2018-06-19 07:34
@beth I got next error in pact logs: ERROR -- : No matching interaction found for PATCH /api/facets/export/data ERROR -- : Interaction diffs for that route: ERROR -- : Diff with interaction: "A request to get export data" Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown "body": { + "AnswerId": null, + "FileName": null

bethskurrie
2018-06-19 07:36
You have some extra fields in your request

bethskurrie
2018-06-19 07:37
You need to define them in your expectations

richard.peckett
2018-06-19 09:25
@neil thanks, I'm guessing that works exactly the same for the provider?

vk.regs
2018-06-19 09:27
I see in fiddler that request contains key "FileName" with null and I expect null value

vk.regs
2018-06-19 09:27
but pact return error when compare

bethskurrie
2018-06-19 09:29
Can you put the test code that you're executing, and the full logs into a gist please? There's not enough information to diagnose the issue from your explanation.


neil
2018-06-19 10:34
I?m not 100% sure what you mean? Do you mean when the provider verification runs against that pact file?

vk.regs
2018-06-19 12:53
@bethskurrie Do you mean project or only pact test?

bethskurrie
2018-06-20 05:05
Just the pact test and the full mock service logs for now. I should be able to see what's going on.

bethskurrie
2018-06-20 08:08
@vk.regs your fixture representing your expected request does not have a FileName in it ``` { "NonIncludedMetaFields": [ "ISESDOORGCIV", "ISESDOORGGR", "ISEORGCIV", "ISEORGGR", "ISEORGMIL" ], "ExportFormat": "XlsX", "DateTimeFormat": { "ShortDatePattern": "M/d/yyyy", "MonthYearPattern": "MMMM, yyyy", "ShortTimePattern": "h:mm tt", "TimeZoneOffset": -180 }, "BaseUri": "https://tewb.ihs.com/", "DisplayQuery": "laser" } ```

bethskurrie
2018-06-20 08:08
But your actual request does.

bethskurrie
2018-06-20 08:09
The error message you are getting is saying "you have FileName : null and AnswerId : null in your actual request, but you didn't declare them in your expected request"

vk.regs
2018-06-20 08:25
I specified FileName equal null in expected request directly

bethskurrie
2018-06-20 08:26
Well, it's not coming through ``` I, [2018-06-20T10:45:50.325316 #5672] INFO -- : Cleared interactions for example "" I, [2018-06-20T10:45:50.573464 #5672] INFO -- : Registered expected interaction PATCH /api/facets/export/data D, [2018-06-20T10:45:50.584464 #5672] DEBUG -- : { "description": "A request to get export facet data", "request": { "method": "patch", "path": "/api/facets/export/data", "headers": { "Content-Type": "application/json; charset=utf-8" }, "body": { "ExportFormat": 3, "DateTimeFormat": { "ShortDatePattern": "M/d/yyyy", "MonthYearPattern": "MMMM, yyyy", "ShortTimePattern": "h:mm tt", "TimeZoneOffset": -180 }, "DisplayQuery": "laser", "BaseUri": "https://testapp.com/", "TestMode": false } }, "response": { "status": 200, "headers": { "Content-Type": "application/json; charset=utf-8" }, "body": { "Format": 3 } } } ```

vk.regs
2018-06-20 08:27
looks like pact ignore null variables

bethskurrie
2018-06-20 08:27
No, it doesn't.

bethskurrie
2018-06-20 08:27
Unless something in .net is doing that.

bethskurrie
2018-06-20 08:27
@neil is it possible that keys with null values are not being written in the request?

neil
2018-06-20 08:29
Yeah that is quite possible

vk.regs
2018-06-20 08:29
As I understand one way to verify such request use Match.Type for each field

bethskurrie
2018-06-20 08:29
The log also says that it's getting an unexpected getting "+ "AnswerId": null," which I don't see anywhere in the code @vk.regs

vk.regs
2018-06-20 08:34
@bethskurrie I modified initial request to make it more simple

vk.regs
2018-06-20 08:45
As I understand one way to verify such request use Match.Type for each field?

bethskurrie
2018-06-20 09:47
@vk.regs can you create a git repository with an executable example that demonstrates your problem, and raise an issue in pact-net please? Or, fork pact-net and create a test case that demonstrates the problem. That way @neil can easily identify if there is a problem with the pact-net code.

vk.regs
2018-06-20 09:54
Thanks. But it hard because we use internal libraries and I never created GIT repository before. I will try later

bethskurrie
2018-06-20 10:02
Ok, how about forking pact-net, and creating a test case in this test to demonstrate your issue? https://github.com/pact-foundation/pact-net/blob/master/PactNet.Tests/Mocks/MockHttpService/MockProviderServiceTests.cs

neil
2018-06-21 08:32
@vk.regs This looks to be an issue with the way pact-net handle null values. I am publishing a fix now. Nuget package version 2.3.1 should fix this issue.

vk.regs
2018-06-21 08:32
@neil thanks

neil
2018-06-21 08:33
Should be released in the next 30mins or so

bethskurrie
2018-06-21 08:53
:+1:

borkke
2018-06-23 13:15
has joined #pact-net

borkke
2018-06-23 17:19
Hi everyone :wave: I have a question about provider side... If I understand correctly, I must have *up and running provider service* in order to run pact verification test. If that is correct, should I be running provider service on `Microsoft.AspNetCore.TestHost` or on full blown `kestrel` web server?

neil
2018-06-24 10:06
Hi @borkke. From memory there were issues talking out of proc (the ruby core, makes the HTTP call in v2) to the server running using TestHost. Worth testing to see if it works. But yeah I?d recommend using the full web server. You can see https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Provider.Api.Web.Tests/EventAPITests.cs for an example. It doesn?t use Kestrel though.

borkke
2018-06-24 15:24
Thanks @neil.. in that case, do you know is it possible to run pact verification tests in CI server, against provider service which is running inside a build context?

borkke
2018-06-24 15:25
From all documentation I found, it seems like I need to make sure to have up and running provider service, and that makes me think I have to have some "testing" environment where I first have to deploy my service provider and run pact verification (this kind of goes against my understanding of the purpose of contract testing :thinking_face:)

neil
2018-06-24 15:33
Nah no need for a seperate test environment, you just need to start the webserver via the test suite on the CI/build agent that runs the tests

neil
2018-06-24 15:34
In the example project inside the pact-net repo we do this. We use AppVeyor to run the CI process for pact-net itself, and the sample project tests are run as part of this.

borkke
2018-06-24 15:35
That's really good news.. I was hoping to hear that

borkke
2018-06-24 15:37
Thanks again!

vk.regs
2018-07-03 15:45
Could somebody help me to understand what such warning mean in provider test that failed on array verification WARN: Ignoring unsupported matching rules {"min"=>1} for path $['body']['Items']

matt.fellows
2018-07-08 09:40
has joined #pact-net

iain.olliver
2018-07-24 10:48
has joined #pact-net

antonios.klimis
2018-08-08 09:43
has joined #pact-net

tmok01
2018-08-22 21:52
has joined #pact-net

tmok01
2018-08-22 21:53
hey all - does there exist an equivalent .net version of the can-i-deploy feature (which checks the matrix to determine whether things can be deployed)?

neil
2018-08-23 00:24
@tmok01 Nah there is nothing in the .NET version that does that at this stage

komalahluwalia06
2018-08-23 07:23
has joined #pact-net

richarddalziel
2018-08-25 18:28
has joined #pact-net

raido.letterbox
2018-08-30 09:58
has joined #pact-net

raido.letterbox
2018-08-30 10:29
Hi all, I am trying to write consumer tests with pact for dotnet core. After enabling SSL for MockProviderService the test fails with "System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure". I've seen in the documentation that it is recommended to ignore certificate validation errors globally due to a self signed certificate, but HTTP client for MockProviderService initializes inside the pact lib, so the only way I have currently found to make it work is to add handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true; directly into the pact-net AdminHttpClient constructor. It also required changing type of handler parameter from HttpMessageHandler to HttpClientHandler and switching target framework to .net standard only, as .net framework doesn't have ServerCertificateCustomValidationCallback method for HttpClientHandler. Can anyone please tell, is there any simpler way to get SSL connection working in dotnet core project?

neil
2018-08-31 12:33
Hi @raido.letterbox. I?m not too sure what?s involved in getting it working on .NET core TBH, I haven?t been doing much .NET lately. In standard .NET there is a global config via ServicePointManager which should work, however I?m not sure the same exists in core.

neil
2018-08-31 12:38
Probably the correct way to sort this is to allow a custom cert and key to be specified, so there are no SSL validation issues. The pact ruby core already supports this, I just haven?t passed those options through as it will need some testing and doco.

raido.letterbox
2018-08-31 15:18
Hi Neil. Thanks for the reply. I have tried ServicePointManager, but it doesn't seem to work in core :disappointed: As for the custom cert - not sure that I understood correctly - is this feature planned to be added to pact-net after the testing?

ngbrown
2018-09-02 16:19
has joined #pact-net

neil
2018-09-02 23:42
Damn, that?s a pain. The idea was that Pact-Net would support the custom cert, however I just haven?t gotten around to it yet.

mattgilbert90
2018-09-10 12:48
has joined #pact-net

antonios.klimis
2018-09-11 13:53
Hello! I have a silly question (probably my noobness) but I don't understand why I need a Platform Specific core engine. ex. PactNet.Windows

neil
2018-09-11 23:40
@antonios.klimis Hey! Good question. PactNet wraps the ruby standalone core, and that has platform specific packages (and each package is quite big). If it was just .NET, we wouldn?t need seperate packages.

antonios.klimis
2018-09-12 09:23
Thank you @neil! When I want to test it in a Linux environment how do I handle that? I use http://asp.net core within Linux containers. Out of curiosity, will that ruby core sometime with be port to .net ?

neil
2018-09-12 09:25
You can install more than one platform specific package. PactNet will load the correct package depending on the runtime environment.

antonios.klimis
2018-09-12 09:25
Nice!

neil
2018-09-12 09:26
We originally had a native .NET implementation, however moved to using the shared ruby core as it makes supporting new features more consistent across all the Pact language implementations.

neil
2018-09-12 09:27
Ideally we want to move to using the rust core, as it should be a lot lighter weight

antonios.klimis
2018-09-12 09:30
Alright! I'm very keen to contribute. Where do you think is the right place to start? (Maybe that's not the right channel to ask (?))

neil
2018-09-12 09:34
Awesome!

neil
2018-09-12 09:35
Probably the best place is to checkout the issues on GH and see if any of those interest you

neil
2018-09-12 09:36
I?m just about to add another issue to add support for custom SSL certs (based on a conversation above in this thread)

antonios.klimis
2018-09-12 09:38
Ok, I'll have a look when you add the issue. In the mid-time I will clone the repo. :slightly_smiling_face:

neil
2018-09-12 09:38
Yep good idea :smile:

neil
2018-09-12 09:49
I?ll probably add it later tonight (Perth time), as I need a bit more headspace to write it out in a coherent manner :smile:

antonios.klimis
2018-09-12 09:58
No worries! I need my time having a look around. You are 5 hours ahead Greek time.


raido.letterbox
2018-09-13 08:42
Hi. I have been browsing through pact-net workshop and found there a mention of _mockProviderService.VerifyInteractions() method which is not present in .net Core workshop. According to the comment, it verifies that interactions registered on the mock provider are called only once. I have tried to intentionally make the same request twice in the test with this method, but the test didn't fail. (My test project targets .net Core) Can somebody please tell, what exactly does this method check, maybe I have misunderstood the concept?

neil
2018-09-13 09:00
@raido.letterbox Sorry for the confusion. Before we moved to using the ruby shared core, it would validate exactly once. Now with the ruby core it validate on an at least once basis.

neil
2018-09-13 09:01
But your understanding is correct, it validates that the interactions you have registered on the mock provider service have been called from your test.

neil
2018-09-13 09:04
I have just updated the Readme

raido.letterbox
2018-09-13 09:30
Thank you!

schalkt
2018-09-18 13:24
has joined #pact-net

wilson.mahann
2018-09-20 14:25
has joined #pact-net

vikassd2012
2018-09-29 05:29
has joined #pact-net

vikassd2012
2018-09-29 05:30
@neil Beth suggested to seek your help on this question https://github.com/seek-oss/seek.automation.stub/issues/11

vikassd2012
2018-09-29 05:30
If you can provide an example it will be great

neil
2018-09-30 23:41
Hi @vikassd2012. Will have to look into that library and get back to you

vikassd2012
2018-10-01 04:58
Thanks @neil :+1:

richard.peckett
2018-10-01 12:49
peeps I can't seem to get more than one interaction on my pact file, it's always taking the last test that ran and uses that as the sole interaction on the file what am I doing wrong?

neil
2018-10-02 09:31
Are you creating a new instances of the mock provider service for each test?

neil
2018-10-02 09:31
It should be shared between tests

richard.peckett
2018-10-02 13:04
Yeah, sorted this now it was the way I was using XUnit, switched to NUnit as it works better for the way I'm structuring my code, cheers Neil.

neil
2018-10-02 13:19
:thumbsup: Awesome. Sorry for the late reply

fraser.crichton.devel
2018-10-04 23:22
has joined #pact-net

heymega
2018-10-06 13:24
Hi I'm currently looking at v3 of the Pact Specification as part of a re-architecture at my place of work as this is heavily based on Event-Driven Architecture and messaging. I noticed that v3 hasn't been implemented yet for .Net and wondered what the current state of this is (You've probably had this asked a number of times so I apologise in advance)? The reason I ask is that myself and a couple of colleagues have been discussing the possibility of implementing v3 ourselves and was wondering... 1. Is the v3 specification complete? 2. Has the development of v3 .net implementation started yet? 3. How can I and my colleagues get involved in developing/starting this? New repository? 4. Would the community be interested in a .Net version of the Pact broker?

neil
2018-10-09 09:21
Hi @heymega. 1. I?m not sure it is complete, however it is a state where it could be used 2. No work has been done to get v3 into .NET yet 3. Your best bet is to take a look at https://github.com/pact-foundation/pact-net/issues/162 and get a feel for what is required. From there you can fork the repo and go from there. 4. I personally don?t think there would be a huge amount of value here. It would be a lot of work to get feature parity with the ruby one.

neil
2018-10-09 23:05
@raido.letterbox Support for custom SSL certs has been added in `2.4.3`

heymega
2018-10-15 08:37
@neil - I'm looking at the version 2 implementation of the `IPactProvider.ServiceProvider` and notices that you can no longer pass in your own `HttpClient` and I believe you could in version 1. What was the reasoning behind this? I thought it was quite useful being able to pass in a `HttpClient` as part of the `TestServer`.

antonios.klimis
2018-10-15 09:22
Is any example publishing to pact-broker for .net?

heymega
2018-10-15 09:24
@antonios.klimis Check out the Github Repository... https://github.com/pact-foundation/pact-net#publishing-pacts-to-a-broker

antonios.klimis
2018-10-15 09:24
Thx @heymega

neil
2018-10-15 12:37
@heymega Yeah that was a nice feature, however unfortunately when we moved to using the ruby standalone core we had to get rid of it as the ruby process takes care of sending the http requests.

neil
2018-10-15 12:39
Unfortunately that was one of the tradeoffs for getting version 2 support

heymega
2018-10-15 13:23
Ahh that's a shame. We've can't run them on cloud agents in Azure Devops (vsts) as part of our build pipeline and have seen port clashes :disappointed:

antonios.klimis
2018-10-22 11:39
Any strategy on how to output the whole error stack on state setup stage? At the moment I get `Failure/Error: set_up_provider_state interaction.provider_state, options[:consumer]` which is not very helpful.

thirumal.net
2018-10-24 17:50
has joined #pact-net

neil
2018-10-25 23:17
Hey @antonios.klimis. Did this error occur when running a verification? What were the provider state details of the pact file?

aaronmckaynz
2018-11-07 03:46
has joined #pact-net

thirumal.net
2018-11-27 21:50
can any one help me how to run can-i-deploy script ? i have downloaded the zip file and running the below command in my bash but i am getting error, what i am doing wrong *https://github.com/pact-foundation/pact_broker-client#can-i-deploy* my plan was to run can-i-deploy from C# code but before that i am running through curl but facing issue, any help is appreciated curl pact-broker.bat can-i-deploy --pacticipant clientpact --version 1.0.1.6 --broker-base-url http://devas.company.com

neil
2018-11-27 23:42
@thirumal.net I don?t think you want to run `curl pact-broker.bat`, it should probably just be `pact-broker.bat`

thirumal.net
2018-11-27 23:47
@neil - Thank you very much for your reply. i am able to run. just want to say thanks again for your valuable time for adding code in .net for pactNet which i am using for my proof of concepts

neil
2018-11-27 23:57
No problems. Thanks for your comment!

thirumal.net
2018-12-05 00:31
*How to Add Provider Side Tag to Pact Broker* ? i am able to run the provider verification successfully and publish the result to pact broker but not sure how to attach tag to pact broker from provider side ?

neil
2018-12-05 08:51
I don?t think you can. AFAIK you push a tag from a consumer PoV which is attached to the version. This question might be better in #pact-broker though

thirumal.net
2018-12-05 21:09
Thank you @neil

ittennull
2018-12-09 07:12
has joined #pact-net

ittennull
2018-12-09 07:14
Hi what's your thoughts, plans and timeline on creating new .net core implementation of pact free of ruby stuff? I'm currently working on such a thing and wondering if I should continue

bethskurrie
2018-12-09 08:33
We encourage people to get involved in using the FFI bindings from the rust implementation, rather than rolling your own.

bethskurrie
2018-12-09 08:33
Trying to keep multiple impls in line and rolling out features is very difficult otherwise.

ittennull
2018-12-09 09:58
but is rust implementation fully ready?

ittennull
2018-12-09 10:02
Do you have plans to make new .net implementation yourself? Maybe you are already 1 step from finishing it and it doesn't make sense for me to do anything

neil
2018-12-10 00:24
As Beth said, we would like to move to the rust impl using FFI bindings. The .NET repo previously had a native implementation, but it was a pain keep feature parity with the other Pact libraries, so we moved to the shared ruby core.

neil
2018-12-10 00:26
We haven?t done any work moving to rust, so if you?d like to take charge of moving from the ruby core to rust, that would be awesome! As far as I know the rust core is ready to go.

s.umair.riaz
2018-12-10 05:01
has joined #pact-net

ittennull
2018-12-10 07:18
Thanks Neil, good to know. I'll take a look what I can do with it.

s.umair.riaz
2018-12-11 23:34
hi guys, has anyone tried storing the pact file in the azure blob so that provider can read from there?

neil
2018-12-12 02:14
I personally haven?t tried it however, it?s definitely possible. You?d probably need to write some code to download the file locally and then just pass the verifier that path to the local file.

tghcastro
2018-12-12 12:44
has joined #pact-net

mcon
2018-12-13 08:29
has joined #pact-net

serikch
2019-01-07 08:58
has joined #pact-net

bart.schotten
2019-02-07 14:20
has joined #pact-net

martin.hock
2019-02-07 14:38
has joined #pact-net

thirumal.net
2019-02-11 22:01
please refer this link, it might help since we can't generate pact files for multiple providers at same time


neil
2019-02-11 22:05
You can?t generate multiple pact files using the same provider mock, however you can run multiple provider mocks at the same time to generate multiple pact files. The only caveat is that they need to run on the different ports.

vikassd2012
2019-02-18 04:53
Hi there I had a question on the actual writing of the consumer side tests

vikassd2012
2019-02-18 04:55
Following the examples I implemented few tests in the format as described in the samples here


vikassd2012
2019-02-18 04:56
where we describe our expectation from the Producer service in the form like this

vikassd2012
2019-02-18 04:57
this api here doesn't have lot of properties, but in case if we have do

vikassd2012
2019-02-18 04:58
I found myself looking at the producer service's sdk

vikassd2012
2019-02-18 04:58
and actually got tempted to use the sdk models instead of defining them by hand here

vikassd2012
2019-02-18 04:58
is there a recommendation or catch to use this approach?

bethskurrie
2019-02-18 04:59
You can try it - what might bite you is that sometimes a domain model doesn't map exactly to the JSON.

bethskurrie
2019-02-18 05:00
Also, you'd be adding in attributes you don't necessarily care about. For contract testing to work at it's best, the consumer only defines what they care about.

bethskurrie
2019-02-18 05:00
This means that unused fields are free to change, and the provider knows who is using them.

vikassd2012
2019-02-18 05:00
yes that is one key difference

vikassd2012
2019-02-18 05:01
thanks Beth as always for your prompt help and response on my queries

bethskurrie
2019-02-18 05:01
:thumbsup::skin-tone-3:

vikassd2012
2019-02-18 05:02
Can I ask you one more question? :slightly_smiling_face: I was looking for pactnet examples, is this still the best resource https://github.com/pact-foundation/pact-net

vikassd2012
2019-02-18 05:02
or are there any other resources that we can refer?

vikassd2012
2019-02-18 05:02
I actually remember reading about using some format in order to deal with date fields which are auto generated, but I couldn't find it in above examples

bethskurrie
2019-02-18 05:03
I'm not the the pact-net maintainer, so I'm not sure.

bethskurrie
2019-02-18 05:03
@neil may be able to help you.

bethskurrie
2019-02-18 05:03
Are you talking about matchers?

vikassd2012
2019-02-18 05:03
Thanks Beth I will ping him.

bethskurrie
2019-02-18 05:03
Please don't PM him! He'll see this here.

vikassd2012
2019-02-18 05:04
oh I see.

vikassd2012
2019-02-18 05:04
Yes I happened to run into a consumer side test that involves dates and I was looking for example how producer side tests will match the dates where they are autogenerated on the producer side

vikassd2012
2019-02-18 05:06
Actually thanks for pointing to the right term I should have been searching for "matcher" I can now look it up better

bethskurrie
2019-02-18 05:06
:thumbsup::skin-tone-3:

vikassd2012
2019-02-18 05:06
I will try that but in the mean time @neil if you have a good resource please let me know

vikassd2012
2019-02-18 05:07
Thanks Beth as always!

neil
2019-02-18 05:32
@vikassd2012 The readme just contains a simple example. Probably best to have a look at the samples in the repo for a more complete example. Is this what you are after? https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Consumer.Tests/EventsApiConsumerTests.cs#L290

vikassd2012
2019-02-18 05:51
Hey @neil thanks for the example, this is exactly what I was looking for. Sorry I missed it earlier.

sthan
2019-02-26 23:53
has joined #pact-net

sthan
2019-02-26 23:55
Hi. I am new to contract testing and trying to create a POC for our http://ASP.NET WebApi application. I've been following the code example in your PactNet repo. I've been able to create working Consumer tests, but I'm having a bit of trouble creating the Provider test. We have a Global.asax.cs which starts the Provider application like this: public class WebApiApplication : System.Web.HttpApplication { protected void Application_Start() { Common.NetworkingHelper.ConfigHttpTlsLevel(); DependencyConfig.Configure(GlobalConfiguration.Configuration); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalConfiguration.Configuration.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); GlobalConfiguration.Configuration.Formatters.Add(new System.Net.Http.Formatting.XmlMediaTypeFormatter()); } } But the example code in PactNet uses OWIN Hosting to start the application. I'm not sure how to reconcide the difference. Can you provide some helpful documentation that will help. An example code would also be very useful.

neil
2019-02-27 00:35
Hi @sthan. Unfortunately I don?t have any examples. The trick is that you need a way to start/run your web api programatically, once you have that hook, you should be able to get the Pact provider tests working. I?m assuming you run your app in IIS. Maybe there is a way to programatically trigger your api to run in IISExpress or something like that?

bockus
2019-02-27 03:00
has joined #pact-net

bockus
2019-02-27 03:05
I'm trying to hunt down some info on how to test a provider that is implemented as a webhook, but my google-fu is struggling and I haven't been able to find any info that isn't related to configuring webhooks in the pact-broker. The provider that I'm trying to test is a webhook. I would like to define a pact that expects an initial response for a given request from the consumer, but then also expects a callback from the provider that we're testing. Is testing webhooks possible with Pact, or is there some way to accomplish the test with multiple tools?

neil
2019-02-27 03:37
@bockus Yep it?s possible, basically your provider becomes a consumer for the webhook callback part. So effectively both parties in the interaction are consumers and providers. Does that make sense?

neil
2019-02-27 03:38
You then end up with two seperate pacts

bockus
2019-02-28 17:11
ah, thanks @neil. Is there a way to tie those two pacts together as a type of sequence or something. I'm just wondering how I would verify that the consumer turned provider is receiving a callback as part of the initial test for the webhook.

sthan
2019-02-28 21:23
I solved this problem by copying the Dependency registration inside the OWIN's TestStartup. Something like this: public void Configuration(IAppBuilder app) { HttpConfiguration config = new HttpConfiguration(); DependencyConfig.Configure(config); WebApiConfig.Register(config); FilterConfig.RegisterGlobalFilters(config); RouteConfig.RegisterRoutes(RouteTable.Routes); GlobalConfiguration.Configuration.Formatters.Add(new System.Net.Http.Formatting.XmlMediaTypeFormatter()); app.UseWebApi(config); }

neil
2019-02-28 23:51
Nah there isn?t any way to tie them together. Without full context about your use case, it?s tricky to give advice, however I don?t really think that kind of sequencing should be part of the contract test.

sthan
2019-03-06 00:15
All the examples I've seen so far is where the Consumer creates a test that specifies the validity of the RESPONSE contract. The Provider runs the test to validate that assumption made by the Consumer. But when the Consumer makes a POST call where it sends some body in the REQUEST. How do I verify that body also conforms to to the contract? If you can point me to the right document, or example code, I would appreciate it.

neil
2019-03-06 04:45
Here?s an example for the POST scenario https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Consumer.Tests/EventsApiConsumerTests.cs#L125 Basically the provider test will send the exact POST request (with the body) at your provider and presumably if your provider did not understand the request body or it was incorrect, then it would return a response (maybe a 400 status) to indicate this to the consumer (and fail the Pact provider verification).

sthan
2019-03-06 17:25
@neil Thanks for the reply. But perhaps, I should have been more specific with my question. What I'm trying to verify is the details of the contract sent to the provider. In the example, you sent me, POST call is made with request body with fields: eventid, timestampe, and eventType. Let's say that the only valid value for the eventType was "DetailsView" and "ListView". If this was a GET RESPONSE, we could do something like this in Consumer Test: eventType = Match.Regex("DetailsView", "(DetailsView|ListView)") But this is a POST REQUEST. I'm not sure how we can do this. My best guess is: In Provider test, we ask for the request body from IPactVerifier and examine the eventType to make sure it conforms to the regex. But looking at IPactVerifier, I don't see a way to get the request body. So, I was wondering if there was another way to get that data or if there is some other mechanism in place to verify this.

bockus
2019-03-06 21:07
I'm trying to write a test for a provider that takes an image file in the body of a POST request, but I'm struggling to get that pact generated with the mock service. @neil, are you aware of any examples that build a ProviderServiceRequest with multipart/form-data content? This curl request is an example of the type of request I'm trying to test: `curl -X POST "https://example.com/save/file" -H "accept: application/octet-stream" -H "Content-Type: multipart/form-data" -F "fileToSave=@image.TIF;type=image/tiff"`

neil
2019-03-07 02:37
Nah I don?t have an example for this. Traditionally we only support JSON, however if the ruby standalone support it we could support it as well.

neil
2019-03-07 03:32
@bethskurrie Is this supported in the ruby standalone?

bethskurrie
2019-03-07 03:32
I can't remember!

bethskurrie
2019-03-07 03:33
I remember doing something for it. Let me have a look.


bethskurrie
2019-03-07 03:36
So, yes. It's a bit inelegant, but it works.

bethskurrie
2019-03-07 03:36
You need to use matchers on the headers because the boundaries will be dynamically generated.

bethskurrie
2019-03-07 03:39
if you follow the same pattern using the .net dsl, it should Just Work TM.

bethskurrie
2019-03-07 03:40
There's some in built logic to detect the dynamic form boundaries in the body, and do the matching so that your expected data will match your actual data even though the boundaries are different.

neil
2019-03-07 03:46
Thanks @bethskurrie!

neil
2019-03-07 03:55
You can use the matchers in the request bodies as well, so in the case of `eventType` like the example, you could do `eventType = Match.Regex("DetailsView", "(DetailsView|ListView)")`. What this would do is ensure that the consumer code only sends a request with eventType set to `DetailsView` or `ListView`. If it sent a request with eventType set to `Blah`, the request would not match any registered interactions in the mock provider, and the consumer test would fail.

neil
2019-03-07 03:57
Is this what you are after?

bockus
2019-03-07 22:40
Thanks for your help @bethskurrie and @neil! I was able to make some progress by building the body of the expected request like you did in the linked example. Since the data being sent is an image, I'm hitting the same encoding error mentioned here: https://github.com/pact-foundation/pact-python/issues/97. Any ideas on how to work around that if I still want the provider to verify a pact where the request payload includes the bytes of an image?

sthan
2019-03-07 23:18
@neil. Thanks again for the response. However, the solution you mentioned was a bit unexpected. My original question was based on an assumption I had in my head: Whoever receives the data (contract) is the one who is coming up with the validation logic (eg: Match.Regex(?DetailsView?, ?(DetailsView|ListView)?)). In a standard GET request, the Consumer receives data from the Provider. So it makes sense that the Consumer comes up with the validation logic and Provider provides the data to be validated. But in a POST request, the Consumer provides the data and Provider receives the data. Which means that Provider has to come up with the validation logic. Bottom line is this: As a Provider I want to make sure that the Consumer is sending me the right type of data (in the correct format) in a POST request. In your last example, Consumer is the one coming up with both the data and the validation logic. This was the reason why I asked if it was possible to get the Request body from the PactVerifier so that I can verify the data and format on the Provider side.

neil
2019-03-08 02:17
This is hard to answer as I don?t know your exact scenario. It?s probably better to think of it as: on the consumer side setting up a mock of the provider. You want to emulate what the consumer actually can send, and how the provider responds in those circumstances. If you?re testing a scenario that is generally not possible for the consumer to send, then my example above is the right approach. This makes sense if you?re just trying to check regression, for example if someone renames one of the `eventType` values. Suddenly your mock provider (which emulates your real provider) won?t be able to respond.

neil
2019-03-08 02:20
However if it?s completely valid for your consumer to send any `eventType` value, and it?s up to the provider to tell the consumer when the request is valid, then it should be a different approach. Your provider should return a response which indicates why the request is invalid, which can be verified in the response part of the consumer side of the contract.

neil
2019-03-08 02:22
In this case the provider is coming up with the validation logic, however the validation logic lives in your actual prod deployed provider code.

neil
2019-03-08 02:27
To directly answer > Bottom line is this: As a Provider I want to make sure that the Consumer is sending me the right type of data (in the correct format) in a POST request This logic should actually live in your provider, irrespective of Pact or not. If a consumer is calling you with the wrong type of data (in the incorrect format), you should tell them that by sending a response that is not 2xx, for example a 400 Bad Request.

bart.schotten
2019-03-14 12:29
If I wanted to contribute to pact-net, especially when it comes to support for the pact spec 3.0, how would I go about that?

neil
2019-03-14 12:53
Which part of the v3 spec are you interested in?

neil
2019-03-14 12:53
The first part of v3 spec we are trying to get in is Pact Message support. You can have a look at the PR comments https://github.com/pact-foundation/pact-net/pull/175 and https://github.com/pact-foundation/pact-net/issues/162. The PR is a placeholder and we are actually working on the `message-pact` branch. There is a TODO.txt file in the root of that branch, which has roughly what?s remaining. Help with any of those items would be great.

neil
2019-03-14 12:54
Alternatively it would be good to work out what is additionally required to get full v3 support after pact message is merged in.

bart.schotten
2019-03-14 13:13
Some background: I'm currently working on a big project where we want to test the interactions between multiple .net and java services with contracts (both http and message based). For this project it would be great I we could get pact-net fully compatible with pact-jvm as soon as possible. I'll start by looking at the TODO.

sthan
2019-03-15 16:00
@neil Sorry for the late response. I've been putting out fires at work (not literally). But your last point makes total sense. The provider application should be responding with appropriate error message appropriate to the incorrect data in the POST request. Thanks for clearing things up.

jmcknight
2019-03-19 04:04
has joined #pact-net

franklin.huynh
2019-04-01 03:23
has joined #pact-net

david.edwards
2019-04-12 12:32
has joined #pact-net

slack1949
2019-04-15 08:25
has joined #pact-net

iruben91
2019-04-17 14:17
has joined #pact-net

franklin.huynh
2019-05-01 00:59
Hi, do you have any example on how to write provider test for aws lambda service? I found this page but it is only for consumer test https://dius.com.au/2018/10/01/contract-testing-serverless-and-asynchronous-applications-part-2/

mcon
2019-05-02 11:23
Hi Franklin, I think the pact message functionality for .net is still on a branch as it's not complete.

joostvanwollingen
2019-05-02 11:47
has joined #pact-net

neil
2019-05-03 07:07
Yeah the pact message code currently lives on the `message-pact` branch

franklin.huynh
2019-05-06 04:17
I see. Thanks @matt.fellows and @neil

james.prescott
2019-05-09 09:10
has joined #pact-net

brwhaley
2019-05-11 01:27
has joined #pact-net

blyman
2019-05-14 19:02
has joined #pact-net

tyoder
2019-05-14 19:40
has joined #pact-net

gordon.barrs
2019-05-20 12:08
has joined #pact-net

gordon.barrs
2019-05-20 12:19
Hi, we are trying to run a pact verification against a response whose content is `text/csv`. We are getting an encoding error: Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8 Is csv content supported by pact-net or it it only json and form data that is supported?

neil
2019-05-21 00:26
To be honest, I have never tried with `text/csv`. I probably depends on if the ruby standalone supports it, which I am not sure.

neil
2019-05-21 00:27
@bethskurrie Do you know if the ruby standalone supports `text/csv`?

rune
2019-05-21 12:27
has joined #pact-net

rune
2019-05-21 12:28
Hi, I'm trying to work out a simple pact against a logging API. I's a REST API the I'm suppose to be able to POST a string value. I'm able to do it from already running application and in postman, but for some reason it want do it in pact using this interaction description. I'm receiving a response status 400.

neil
2019-05-21 13:26
I?m not sure if this is why, but it appears you are marking the request body as `application/json` and sending a plain text non json body.

dperez
2019-05-30 04:28
has joined #pact-net

dperez
2019-06-03 04:01
hi, I understand in PactJS 6.x.x there is something called GraphQLInteraction to help creating the expectations when trying to perform contract testing against a GraphQL endpoint. I'm kind of new with the whole Contract Testing topic so excuse me if I'm asking trivial or "already answered" questions. But I'm trying to perform the same on our .Net environment but haven't found an example as clear as I found it here http://blog.pact.io/2018/07/24/contract-testing-a-graphql-api/ Will really appreciate any guidance on this, I find my self in loops of readings saying it is possible with the current PactNet but without an example I could adapt to our environment. Thanks.

neil
2019-06-03 04:34
@dperez Hey. That?s new to me about PactJS. Nah the .NET implementation does not have any graphql interaction DSL.

neil
2019-06-03 04:35
As the article mentions though, you could construct a GraphQL request using the standard DSL. You?d just need to know the exact JSON that GraphQL is sending and replicate it.

dperez
2019-06-03 13:37
@neil thanks for the reply. Will use the standard DSL then. Regards.

iruben91
2019-06-13 09:39
Hello, I was asking a couple of months ago about message support in pact-net. It's a requirement in my company for the adoption of Pact for our .NET Core microservices and I wanted to how the development on it was going, and if any help was needed.

bethskurrie
2019-06-13 09:43
I believe someone is working on it at the moment.

bethskurrie
2019-06-13 09:43
Have a look at the PRs in the pact net repo.

iruben91
2019-06-13 09:46
There is an old December one still open about this, but I understand the work is currently being done outside of it in a separate branch.

bethskurrie
2019-06-13 09:49
@neil do you knoe what the current status is of the Pact net message impl? I thought I saw some discussion on it recently. More recently than December.

taranovskyi.anton
2019-06-13 09:54
has joined #pact-net

neil
2019-06-13 12:27
Yeah some people are using it from the `message-pact` branch and fixing some issues that are arising. There is a TODO.txt file with the known remaining bits. @iruben91 Feel free to take a look at that and see if there is anything you want to help with. I haven?t had any time lately to tick these off, house renos are taking up all my free time.

neil
2019-06-13 12:27
If the current pact-message branch does what you need, you can build your own package from that branch.


anna.lakstigala
2019-06-13 12:39
has joined #pact-net

neonmd
2019-06-14 09:42
has joined #pact-net

taranovskyi.anton
2019-06-19 09:16
hey guys, please, review pr above ^^ thanks

adamgreen
2019-06-21 09:45
Hi all, was wondering if anyone has any advice on how best to handle the PactNet.<OS> nuget packages depending on the target environment a build pipeline might be using eg Ubuntu for a Docker build pipeline or Windows when running locally etc Looked into condition nuget package references but that seems to be configurable only for the solution config. Thank you in advance

neil
2019-06-21 12:53
You can install both in your project and PactNet will pick which one it needs to use at runtime

mui_ume
2019-06-27 03:07
has joined #pact-net

mui_ume
2019-06-27 03:11
Hi guys, can I have a simple example for provider in C#?


mui_ume
2019-06-27 09:20
thanks

mui_ume
2019-07-05 05:53
Hi Neil, does it show how to publish the pact file to the pact broker?


dperez
2019-07-06 19:17
hi all, first at all, thanks for being so open and collaborative to questions in this channel. And sorry for the long post but I need to explain our code base the best I can, this is particularly about the message-pact branch. Now, we started playing with the message-pact branch about a month ago, and I know this is work in progress which I would love to collaborate back with our findings so far. But before that, I want to make sure I understand the "concepts" behind this branch. Currently we have microservices grouped by domains. We version our services by domain, not by single available operation inside the domain. We deliver a nuget package to our producers like: Builder.Microservices.1.0.0.0.nupkg containing all the possible messages the domain is expected to receive (among other commodity methods to interact with our messaging bus). If one of those message changes then a new package is created. (I know, not the best but a long history) So I want to test all the interactions *with my domain*. Some notes: a) Isn't an open public microservice, we know by hand who are our message producers. b) We use widely in our projects BDD, in this case SpecFlow. Just as a side note that might affect design decisions. With all that mind, 1. On the microservice consumer side I want to create a contract for *each producer* (is this correct?) 2. I have the following expected messages: CreateCorporation, CreateBrand, CreateDivision. Will all the expected messages be part of a single pact file? Or each needs to have it's own pact file? I was expecting to have all the possible messages of my domain in one single file per producer.

neil
2019-07-08 03:12
Hi @dperez I haven?t personally tried with SpecFlow, but there shouldn?t be anything technically stopping that from working. 1. You create a contract (Pact file) for each consumer/producer pair. 2. Same as above, you?ll likely want a contract for each consumers usage of those produced events. For example one consumer might only use a single field in CreateCorporation and not consume the CreateBrand event at all, so the contract for that consumer/producer pair would only contain the used fields and events.

dperez
2019-07-09 20:16
Hi @neil Thanks for the reply. The issue we are having now, is how to create some kind of protection from the Consumer side by the time of updating a contract to know before hand what producers we are affecting. Just uploading a new contract to the broker isn't enough since each producer must run their tests against the new contract to notify the broker if it passed or not. We had the idea that the broker worked in a different way, basically that the producers upload their side of the history (their version of the contract) and the broker performed a comparison based on that. Without running each producer tests is there some way to figure out if a producer that is compatible with my version 1.0.0 will be also compatible with the new version 2.0.0 I haven't even released?

neil
2019-07-10 03:35
I think I have understood the problem, however I?m not 100% sure. An event consumer can only use data that is made available by an event producer. If a consumer decides it needs something new, it?s their job to negotiate this with the producer team. Pact doesn?t remove the need for documenting and communication between teams. If there was some communication breakdown and the event consumers started using a field the producer had not made available, then the producers verification build should fail. The broker has a webhook feature which allows it to send a http request to a predetermined endpoint whenever a new consumer contract is pushed. This can be used to trigger the producer verification automatically. Once both the consumer and producer verifications pass, then the change can be deployed. If it fails, it generally signals that a conversation hasn?t happened. This is also worth having a read https://dius.com.au/2017/09/22/contract-testing-serverless-and-asynchronous-applications/

dperez
2019-07-10 04:13
Thanks a lot. This is a really good reading, and the point about the webhooks I think is the missing piece we were looking for.

neil
2019-07-10 04:24
Nice one!

mui_ume
2019-07-11 09:41
Hi in pact-js, there is an github example to show how to use Match based on arrays?

mui_ume
2019-07-11 09:41
is there one for http://pact.net?

adamgreen
2019-07-11 11:06
@mui_ume Looks like the MinType matcher will work https://github.com/pact-foundation/pact-net/blob/message-pact/PactNet/Matchers/Type/MinTypeMatcher.cs Seems to do the eachLike() ArrayLike reg ex type from what I can tell

neil
2019-07-11 11:07
Yep that?s the one you want

neil
2019-07-11 11:07
There isn?t an explicit example of that matcher in the samples, but it does have other matchers. Match.Type is the closest to Match.MinType https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Consumer.Tests/EventsApiConsumerTests.cs#L289

mui_ume
2019-07-22 02:43
can pact net support messaging comes from websockets?

franklin.huynh
2019-07-22 04:50
hi @matt.fellows and @bethskurrie is there a setting to match the body in case insensitive

franklin.huynh
2019-07-22 04:51
the pact file is pascal case and the return response is in lower cases

matt.fellows
2019-07-22 07:41
Do you mean in the actual request / response from provider? No

matt.fellows
2019-07-22 07:41
That seems... Odd

kapoorvishal23
2019-07-22 10:49
has joined #pact-net

franklin.huynh
2019-07-22 23:52
nm, it's something to do with the object deserialisation in the consumer service. we have updated the contract in consumer in order to match with the provider

matt.fellows
2019-07-23 01:32
ah ok

hvgiitr
2019-07-24 15:42
has joined #pact-net

au443479
2019-07-26 05:58
has joined #pact-net

shalygai.a
2019-07-26 12:31
has joined #pact-net

shalygai.a
2019-07-26 12:33
Hello! When will 'Multiple provider states' feature be supported for .net?

mohindroo.deepak
2019-08-01 06:06
has joined #pact-net

mohindroo.deepak
2019-08-02 18:15
I was trying to set PactDir in consumer side where pact files generated but it always create in d:\pacts directory? Is this a bug? Another issue coming is how provider will get all pact files for specific provider? It can be multiple consumers using one provider?

neil
2019-08-05 06:38
Without seeing your config, I can?t really help

neil
2019-08-05 06:39
You create a provider test for each of the consumers.

mohindroo.deepak
2019-08-05 09:07
public ConsumerPactClassFixture() { // Using Spec version 2.0.0 more details at https://goo.gl/UrBSRc PactBuilder = new PactBuilder(); PactBuilder.ServiceConsumer("Event Client") .HasPactWith("Event Server"); MockProviderService = PactBuilder.MockService(MockServerPort); var pactConfig = new PactConfig { SpecificationVersion = "2.0.0", PactDir = @"D:\pacts1\", LogDir = @"D:\pacts1\pact_logs" }; }

mohindroo.deepak
2019-08-05 09:11
When will pactbroker publishing and verifications for pactnet support?



mohindroo.deepak
2019-08-05 18:21
Thanks

mohindroo.deepak
2019-08-05 18:21
How to install pact broker in azure devops? I do not want to use docker image. Want to do installation manually?

mohindroo.deepak
2019-08-06 12:10
Please reply as it is urgent

mohindroo.deepak
2019-08-06 12:14
Also one more query that i am trying to access dius server to publish pacts but i am getting error ? no connection made because target machine refuses? We are using proxy so could not connect this url directly. How to use proxy ?

neil
2019-08-06 13:02
Sorry I can?t help you with Azure devops, I?ve never used it before

neil
2019-08-06 13:03
Maybe post the dius server pact broker question in #pact-broker

srikanthyadake
2019-08-06 13:15
has joined #pact-net

mohindroo.deepak
2019-08-06 14:46
Ok i will post

mohindroo.deepak
2019-08-06 14:47
Any luck with my second query on proxy issue?

pbarrientos
2019-08-06 16:38
has joined #pact-net

christophe.leray
2019-08-07 15:43
has joined #pact-net

neil
2019-08-08 00:02
That?s the one I suggested posting in #pact-broker

mohindroo.deepak
2019-08-12 07:48
I have a scenario in which consumer is using one of the wcf based service so how will i implement the solution using PACT?

thirumal.net
2019-08-12 17:28
@mohindroo.deepak - i don't think pactnet supports non jason services

mohindroo.deepak
2019-08-14 05:59
In one of the scenario, one of the consumer service A Get method calls another http service B internally. I want to test the service A here. i will make the mock http server for Service B but problem here is how will i redirect service A call to new mock server?

mohindroo.deepak
2019-08-14 06:02
In your samples, it is passing new mock server in get url. Which is not possible in my case. Obviously we can not make all api methods have url parameter.

bart.schotten
2019-08-14 06:45
Are you referring to this part of the sample? https://github.com/pact-foundation/pact-net/blob/e0532b782e673acb6d1d16b96b2cbb72c07a3075/Samples/EventApi/Consumer.Tests/EventsApiConsumerTests.cs#L51 It is actually good practice to allow every API client you want to test to have at least the base url injected.

mohindroo.deepak
2019-08-14 11:59
Yes. My consumer app is dotnet core which internally call the provider. In the test case, i cannot pass the mock url which i have made. How to implement pact mock server here?

bart.schotten
2019-08-14 14:39
You should really implement pact tests as unit tests in the consumer app. If that's not possible and the consumer app is a black box to you you must be able to inject the url somehow, there's no way around that.

mohindroo.deepak
2019-08-14 18:19
You are saying that i should run consumer tests before deploying the consumer service? Which i normally do in unit testing as well. In unit testing as well, i normally mock the dependencies and run my tests. Another point is that if i have 3 dependencies used in one of the POST function in consumer api then do i need to pass 3 different urls in the POST method parameters? Is this a good practice to change consumer api methods for the testing purpose only?

mohindroo.deepak
2019-08-14 18:40
Let me explain my case in detail: I have few tests which runs after the consumer service deployed and that is using restsharp to call the consumer api methods. In some of the methods, there is a call to 2 different providers to fetch data. I want to use pact to mock those 2 providers and run my tests and generate pact file. So below queries - 1) how to inject these urls for providers? 2) if i lets say inject those urls at the time of deployment of consumer service, then if i use pact mock code in the test case, will that work?

mohindroo.deepak
2019-08-14 18:44
3) on the provider side, pact tests will run on real provider service deployed?

bart.schotten
2019-08-15 06:43
To answer your first question: yes, I'm saying that you should run your consumer tests before deploying the consumer service. Second: you say you want to "use pact to mock those 2 providers". This is imo a bad practice, you should only use pact for what it's meant for: generating and verifying contracts. If you want to mock services to run functional integration tests I would recommend using another mocking tool. It's possible to do with pact but it just gets confusing. To answer your queries: 1) you probably want to get base urls from some kind of config anyway. I normally wouldn't hard code them anyway, so using configuration would be the way to go. 2) Probably, but again, I wouldn't recommend it. 3) On the provider side the same advice applies: please don't run the tests against the actual deployed service, but run them as unit tests against a self-hosted version of the service in some test-specific configuration. You only want to test the interface (i.e. your controller) so you need to be able to mock everything behind that.

mohindroo.deepak
2019-08-15 07:02
For 3) i have seen your sample and it runs against the actual provider service


bart.schotten
2019-08-15 07:15
But I guess we mean the same thing.

mohindroo.deepak
2019-08-15 12:22
Yeah but startup function of main service have azure keyvaults being used so how this will work on build agent

mohindroo.deepak
2019-08-15 12:23
How we can self host the app service in build pipeline

mohindroo.deepak
2019-08-15 12:33
Its slightly difficult

mohindroo.deepak
2019-08-15 17:13
One more query that in provider test, we are mentioning consumer name but if we have lot of consumers with different names and multiple consumers break then how will get info about the same.

mohindroo.deepak
2019-08-15 19:35
Are you there

mohindroo.deepak
2019-08-16 05:51
??

mohindroo.deepak
2019-08-16 06:05
There is an issue coming when i add pactnet.windows nuget because of long path in ruby at thebtime of building the project. Any solution for this?

mohindroo.deepak
2019-08-16 15:43
I am trying to run the pact verify code in dotnet and it works with pact file but not working with url. Giving some ruby files error? Need some help or code snippet to do that.


neil
2019-08-19 03:26
Does the url return a pact file json body? Does it require auth?

mohindroo.deepak
2019-08-19 05:31
Well when i run url on browser, it shows json content and this does not require authentication.

neil
2019-08-19 06:40
Are you using the broker or something else?

mohindroo.deepak
2019-08-19 06:58
I am using broker

mohindroo.deepak
2019-08-19 06:58
Consumer part working perfectly fine with broker

bart.schotten
2019-08-19 07:38
You don't need to mention the consumer name in the provider test. You only need to make sure that you support the provider states supplied by each consumer.

mohindroo.deepak
2019-08-19 07:42
Also what are these providestatemiddleware codebase

mohindroo.deepak
2019-08-19 08:27
Ok i need to understand provider states

mohindroo.deepak
2019-08-19 08:28
There is standard piece of code for providerstate middleware. What is the purpose of this? Is this fixed code need to use?

bart.schotten
2019-08-19 08:41
I doesn't have to be middleware, it can also be a controller. What basically happens is that the Pact Mock Consumer will perform a request to "/provider-states" with the providerState part of the contract. You need to expose this "/provider-states" endpoint somehow to be able to set up the correct data to be able to comply with the actual test.

mohindroo.deepak
2019-08-19 08:56
I did not get you fully here. Data is sometimes dynamic and data which is store in pact file might not work aftre few days

mohindroo.deepak
2019-08-19 08:57
So is there a way to bypass data check ? If we just want to validate properties name only? Also do you have some samples with provider states url on provider side

mohindroo.deepak
2019-08-19 08:57
?

mohindroo.deepak
2019-08-19 08:58
So now i am able to run the pact file on provider side

mohindroo.deepak
2019-08-19 08:58
But still getting some error

bart.schotten
2019-08-19 10:52
When the actual data doesn't matter you should use Matching Rules. You should really start by reading the official documentation (http://pact.io). It's really good.

mohindroo.deepak
2019-08-19 11:50
Do you have some samples around the customized provide states? Which explain my usecase?

neil
2019-08-19 13:50
Sorry I can?t help without more details

mohindroo.deepak
2019-08-19 16:40
That works now

mohindroo.deepak
2019-08-19 16:40
Thanks

mohindroo.deepak
2019-08-19 16:42
Now i have one question regarding the pact provider states. I do not want to validate the data in pact file. Just want to compare the json parameterss names. Is this possible?

mohindroo.deepak
2019-08-19 17:12
Any sample with pactnet with matchers?


mohindroo.deepak
2019-08-19 17:15
I have found this


neil
2019-08-20 00:17
Anything `Match.` is a matcher

neil
2019-08-20 00:17
Sounds like `Match.Type` is probably what you are after

mohindroo.deepak
2019-08-21 14:15
I am getting one issue that when provider tries to validate the pact file, it is failing that due to below issue 1) Verifying a pact between DummyConsumer and DummyProvider Given There is data Invalid SSI with current client id with GET /api/provider?clientid=222293222 returns a response which has a matching body Failure/Error: expect(response_body).to match_term expected_response_body, diff_options Actual: {"id":2,"name":"Test","clientId":2222222,"currencyCode":"DKK","countryCode":"CI"} Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown { - "Id": 2, - "Name": "Test", - "ClientId": 2222222, - "CurrencyCode": "DKK", - "CountryCode": "CI" } Description of differences -------------------------------------- * Could not find key "Id" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "Name" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "ClientId" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "CurrencyCode" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "CountryCode" (keys present are: id, name, clientId, currencyCode, countryCode) at $ This email may contain confidential and/or privileged information. If you are not the intended recipient - or have received this email by mistake - please notify the sender immediately and destroy the email. Any unauthorised copying, disclosure and/or distribution of the contents and/or attachments in this email is strictly prohibited. Email transmission security and error-free delivery cannot be guaranteed as information could be intercepted, corrupted, destroyed, delayed, incomplete and/or contain malware (virus). The sender of this email, therefore, does not accept liability for any errors and/or omissions in the contents of this message, which may arise as a result of email transmission.

mohindroo.deepak
2019-08-21 14:16
I can see one difference in actual: properties first character in lower case which is done by pact automatically? Dont know why

mohindroo.deepak
2019-08-21 14:16
This can be the cause i guess

mohindroo.deepak
2019-08-21 15:22
One more question about amqp messaging. My use case is that i am sending lot of messages to azure service bus/kafka so how will i handle those contracts?

thirumal.net
2019-08-21 18:00
@mohindroo.deepak - you can fix this issue by using JsonProperty . here is the example code which solves your issue public class ClassName { [JsonProperty(PropertyName = "id")] public string Id{ get; set; } [JsonProperty(PropertyName = "name")] public string Name{ get; set; } }

thirumal.net
2019-08-21 18:02
i have faced the same issue when i am doing POC on pactnet . above code helped me to fix the issue

mohindroo.deepak
2019-08-21 18:04
Thanks :blush:

mohindroo.deepak
2019-08-21 18:05
Any solution for this

mohindroo.deepak
2019-08-22 09:47
When i use matcher.type for the whole body, it is not showing in the pact file generated?

mohindroo.deepak
2019-08-22 09:47
Am i missed anything

mohindroo.deepak
2019-08-22 09:54
Sorry this part works. Pls ignore

mohindroo.deepak
2019-08-27 20:33
I have made the cicd pipeline for consumer And upload pact files to broker but how will i validate this to provider side? Do i need to trigger build cicd pipeline of provider side as contract tests is one of the task in provider build pipeline?

neil
2019-08-28 00:00
The Pact Broker has a webhook feature, which allows you to trigger a provider verification when a consumer pact is uploaded

mohindroo.deepak
2019-08-28 07:13
But that verification will trigger provider side build?

mohindroo.deepak
2019-08-28 07:14
Or it will just verify with latest pact version ?


thirumal.net
2019-08-29 18:30
@mohindroo.deepak - webhook will trigger the provider side build and provider side unit test case should fetch the latest version from pact broker and verify it. it depends which pact file you are getting from pact broker .

thirumal.net
2019-08-29 18:30
[Fact] public void VerfiyPacts () { string pactBrokerUrl = @"http:// .com/pacts/provider/Test_Provider/consumer/Test_Consumer/latest"; //Arrange const string serviceUri = "http://localhost:62809"; var config = new PactVerifierConfig { Outputters = new List<IOutput> { new XUnitOutput(_output) }, PublishVerificationResults=true, ProviderVersion= providerAPIVersion }; using (WebApp.Start<TestStartup>(serviceUri)) { //Act / Assert IPactVerifier pactVerifier = new PactVerifier(config); pactVerifier .ProviderState($"{serviceUri}/provider-states") .ServiceProvider("service", serviceUri) .HonoursPactWith("client") .PactUri(pactBrokerUrl) .Verify(); } }

mohindroo.deepak
2019-08-30 12:55
I am getting one issue that interaction not matching Consumer application has some dto which gets converted into json parameters and pass in httpresponse. When i am trying this in Pact so it fails and does not match. How to pass multiple parameters in Query? I also have dto which i need to pass here. Any help?

milleniumbug
2019-09-02 09:30
has joined #pact-net

mohindroo.deepak
2019-09-02 11:59
How to pass multiple parameters in query

mohindroo.deepak
2019-09-02 12:00
Can anybody help urgently

mohindroo.deepak
2019-09-02 12:33
How POST works with pact? How can i pass parameters and get response object?


adamgreen
2019-09-02 12:36
You can see at line 124 an example of a post for teh consumer side

mohindroo.deepak
2019-09-02 12:50
But in this case, you mentioned response object in body?

mohindroo.deepak
2019-09-02 12:52
In my case, there is parameters as well and there is response object. When i see consumer interaction in log file, it did not show response json in body. Rather it is showing request json in body

mohindroo.deepak
2019-09-02 13:13
??

mohindroo.deepak
2019-09-02 13:34
Post carries request data in body so if we have some reponse as well then why pact is not writing anywhere?

mohindroo.deepak
2019-09-02 13:50
I am getting one issue if i use Body in providerservicerequest then it breaks the execution and error pact exited due to *arguementexception*

adamgreen
2019-09-02 14:05
what do you have in your .WillRespondWith()?

mohindroo.deepak
2019-09-02 14:12
I am getting one issue if i use Body in providerservicerequest then it breaks the execution and error pact exited due to *arguementexception*

adamgreen
2019-09-02 14:24
Body is dynamic, not sure what problem it is you're having, check against the above see if you're set up is ok. https://github.com/pact-foundation/pact-net#3-write-your-test

mohindroo.deepak
2019-09-02 14:42
I am using body in providerservicerequest

mohindroo.deepak
2019-09-02 14:42
Then i got this issue. Execution breaks

mohindroo.deepak
2019-09-02 14:42
Otherwise it works fine

mohindroo.deepak
2019-09-02 14:47
It works now. I have not added content type header. But strange part is that execution should not break

neil
2019-09-03 00:00
In order for us to help, we need much more context about your specific issue. For example, if you?re getting an argument exception, there should be some info about which argument is causing the issue.

pbarrientos
2019-09-06 22:33
Hi, I have a question. Can I save an Enum name in the iteration or only be save the number? Sorry for my English.

mohindroo.deepak
2019-09-07 05:02
1) I have a query on implementation of provider side- consumer pact will be published everytime when consumer ci build will trigger. When provider build will run, will they check all versions of consumer pacts everytime? Consumer pacts which has been verified in previous provider verification, will they also be picked up?

mohindroo.deepak
2019-09-07 05:04
2) if provider will release api version 2 and trigger ci build, how will we stop validating consumer pacts? Whats the best practice to implement?

mohindroo.deepak
2019-09-07 05:06
3) i am also confused about data management here. Set of data being used by consumer can be failed when provider will validate. As provider hitting actual api so that wrong data can change the response type. Any suggestions on that?

mohindroo.deepak
2019-09-07 05:06
Really appreciate if somebody can answer

neil
2019-09-07 05:22
You should be able to just cast the enum to an int. So `int thing = (int) MyEnum.Member`

neil
2019-09-07 05:26
You choose what version of the pact you want to run by specifying the PactUri.

neil
2019-09-07 05:28
I don?t really understand the question. Why would you want to stop validating the consumer pacts because version 2 has been released?

neil
2019-09-07 05:30
You can either use matchers, provider state or both on the consumer side. Provider states give the provider a chance to setup the consumers data prior to running the verification. See https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Provider.Api.Web.Tests/EventAPITests.cs#L39 and https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Provider.Api.Web.Tests/ProviderStateMiddleware.cs#L24

mohindroo.deepak
2019-09-07 10:32
I did not get this. In provider verification, i have written the code to get all pacts under this provider and build so it always update all pact which has been verified before

mohindroo.deepak
2019-09-07 10:36
I mean that if there is a change in provider api contract and release new version of api but pact validate code picks old consumers which has older versions so it gets fail?

mohindroo.deepak
2019-09-07 10:42
Thanks. i am aware of the matchers but there is a different case here E.g. in provider function, there is a condition if. Clientid not exists then return response code BadRequest. Client data is in input parameter. Consumer Pact is expecting OK status

mohindroo.deepak
2019-09-09 05:37
Provide side code is generic and you normally call all pacts from specific branch. Whats the best practice to fetch pacts in provider build?

mohindroo.deepak
2019-09-09 05:39
There can be some business logic on provider side and if data is wrong then response code can be changed due to that verification failed.

uglyog
2019-09-09 06:07
has joined #pact-net

bethskurrie
2019-09-09 07:07
You either need to use provider states to set up the right data, or you need to use middleware to change the response so that it matches the IDs that you have.


bethskurrie
2019-09-09 07:09
Unfortunately it needs to be written in ruby.

bethskurrie
2019-09-09 07:09
I believe there is a config option to set the middleware file @neil?

bethskurrie
2019-09-09 07:10
You actually want to verify the "old consumers" because that's what allows you to ensure you have backwards compatibility.

bethskurrie
2019-09-09 07:10
You should use tags.


neil
2019-09-09 07:50
Unfortunately there is no custom middleware in Pact-Net land, however a lot of the .NET web servers support middleware, which you could load when starting the provider for verification.

mohindroo.deepak
2019-09-10 18:47
But it might possible that new property gets introduced in return json so it is fine for tthe consumers but pact verification will fail.

neil
2019-09-11 00:13
In that scenario the verification should not fail as the consumers have not specified the field in their contract

mohindroo.deepak
2019-09-11 05:08
Ok

mohindroo.deepak
2019-09-11 05:31
Sometimes pact mock server interactions not clear if something goes wrong at the time of development. Then no log file generated, no pact file in that case. I need to change the port number and then it start working.

neil
2019-09-11 13:56
Yeah that?s due to Pact-Net not being able to kill the ruby mock server process as it died unexpectedly

neil
2019-09-11 13:56
If you search for the ruby process and kill it manually, you shouldn?t need to change port

mohindroo.deepak
2019-09-11 18:24
Ok. But i think that problem will not occur in cicd pipeline

mohindroo.deepak
2019-09-11 18:24
On the build agents

neil
2019-09-11 23:56
Yeah it shouldn?t

neil
2019-09-11 23:56
It?s one of those ones, I wish I could fix, but unfortunately when the app domain crashes, I have no hooks to terminate other processes


thirumal.net
2019-09-12 21:52
@mohindroo.deepak - you can manually kill the mock service. at the end of the unit test case you can write like this public void KillByPort(int port) { var processes = GetAllProcesses(); // This gets all running process if (processes.Any(p => p.Port == port)) try { Process.GetProcessById(processes.First(p => p.Port == port).PID).Kill(); } catch (Exception ex) { Console.WriteLine(ex.Message); } else { Console.WriteLine("No process to kill!"); } }

thirumal.net
2019-09-12 21:53
i am calling this method in end of my unit test case. let me know if you want complete code snippet

bethskurrie
2019-09-12 22:18
There is a flag in the cli that lets you specify a Ruby file. But if you can load middleware in the net app, that would be much nicer.

mohindroo.deepak
2019-09-13 07:07
:+1:

mohindroo.deepak
2019-09-13 07:12
I need to know more on PactNet support on consumer sending messages to Azure Service bus and on the side, another service is receiving. Who will be the provider here? I guess message receiver should be provider. And how can we ensure contract testing here?

bethskurrie
2019-09-13 07:13
I'm not sure if the message pact support in .net is complete yet.


bethskurrie
2019-09-13 07:14
``` Consumer: An application that makes use of the functionality or data from another application to do its job. For applications that use HTTP, the consumer is always the application that initiates the HTTP request (eg. the web front end), regardless of the direction of data flow. For applications that use queues, the consumer is the application that reads the message from the queue. Provider: An application (often called a service) that provides functionality or data for other applications to use, often via an API. For applications that use HTTP, the provider is the application that returns the response. For applications that use queues, the provider (also called producer) is the application that writes the messages to the queue. ```

neil
2019-09-13 07:14
But if the test process is terminates unexpectedly, then I don?t think that code will run.

neil
2019-09-13 07:15
Nah it?s not complete yet, but it is somewhat functional on the `message-pact` branch

mohindroo.deepak
2019-09-13 07:20
Any ETA when it will be officially launched?

neil
2019-09-13 07:37
Some of the people working on it have gone quite and I haven?t had the time to get it done. So no ETA at the moment


neil
2019-09-13 07:41
The above thread will tell you have to create a nuget package for that branch

dperez
2019-09-13 14:49
From our experience, and from our requirements I can say it have done the job. The branch at least for us have worked very good, some minor adjustments but mostly all works pretty well

thirumal.net
2019-09-13 18:21
@neil - Thank you and Nice to see response from you. i am wondering , it is fine to kill the process in Dispose method of XUnit right ? or before starting the unittest case we can make sure mock service is not runnung on same port

thirumal.net
2019-09-13 20:58
@neil - Hi Could you please look into my scenario and suggest me if my thinking is correct ? i am doing analysis on pact implementation for C++ projects but there is no out of box support for C++ from pact community . as a work around i am creating one library in .NET which included PactNet and pact-win32( Ruby stand alone libraries for windows) . i am thinking to provide this .net library to C++ team so that they can include this .net library and call necessary methods like below (my understanding is calling C# library methods from C++ is possible ) 1) Start Mock Provider service 2) Clear Interactions 3) Register interactions 4) Consumer Code under test 4) Verify interactions 5) Stop Mock Provider Service 6) Publish the pact to pact broker Do you think this is good idea to implement pact where there is no language support ? Thanks in Advance,

milleniumbug
2019-09-14 14:26
This would mean that from your C++ code, you're calling C# code which calls the Ruby code by launching the process. You can skip the middleman by launching the Ruby process yourself. Also do note that while Ruby executable is the current approach for Pact, there is a work in progress on creating a Rust library (https://github.com/pact-foundation/pact-reference) which will eventually replace the Ruby executable.

mohindroo.deepak
2019-09-15 05:21
Oh Great. I will try in next few days and will share the feedback

neil
2019-09-17 02:09
Yeah agree with the above. I definitely wouldn?t be using the .NET library here. Either use the Ruby standalone directly in a similar way to how .NET does it, or even better use FFI bindings for Rust. The downside of the Rust implementation is that I don?t think currently any of the Pact libraries use it. That being said, I?m told that it?s ready to go.

neil
2019-09-17 02:10
@dperez Any adjustments that you can share in a PR?

dperez
2019-09-17 02:12
hi, nothing yet, all the adjustment we have done are for specific business requirement

neil
2019-09-17 02:14
Ah no worries :thumbsup:

tritorto
2019-09-19 07:32
has joined #pact-net

tritorto
2019-09-20 07:41
Hey guys, Ive just started hooking up PACT for a few new microservices im working on - I have the consumer/provider tests running locally and just in the process of setting up TeamCity CI. In TeamCity, it seems to be going fine with the consumer side, in that I can build and publish to the pact broker - however on the Provider build, I am having difficulty spinning up the Webhost which fails pact verification. In the PACT broker, it gives me: `Cannot assign requested address - connect(2) for "localhost" port 9223 (Errno::EADDRNOTAVAIL)` Im developing in .net core and typically I would use a TestServer, however looking around at samples and various comments online it is stated that you need to use a proper Webhost for the PactVerifier to work? I've pretty much got a solution similar to this: https://github.com/tdshipley/pact-workshop-dotnet-core-v1/blob/master/CompletedSolution/Provider/tests/ProviderApiTests.cs#L26 Has anyone had any luck hooking this up in TeamCity? As I mentioned Ive always used TestServer, so wondering whats missing to get it going..

tritorto
2019-09-20 07:43
Running the build step inside a docker container seems to have resolved my issue - all good :slightly_smiling_face:

mohindroo.deepak
2019-09-20 17:15
How can i use can-i-deploy with PactNet consumer ? How to use in ci/cd pipeline?

mohindroo.deepak
2019-09-20 17:16
Any example somewhere? How can i download can-i-download utility?

mohindroo.deepak
2019-09-24 08:38
Any idea how to resolve this

mohindroo.deepak
2019-09-24 08:38
I cant put jsonproperty

mohindroo.deepak
2019-09-24 08:39
I am getting one issue that when provider tries to validate the pact file, it is failing that due to below issue 1) Verifying a pact between DummyConsumer and DummyProvider Given There is data Invalid SSI with current client id with GET /api/provider?clientid=222293222 returns a response which has a matching body Failure/Error: expect(response_body).to match_term expected_response_body, diff_options Actual: {"id":2,"name":"Test","clientId":2222222,"currencyCode":"DKK","countryCode":"CI"} Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown { - "Id": 2, - "Name": "Test", - "ClientId": 2222222, - "CurrencyCode": "DKK", - "CountryCode": "CI" } Description of differences -------------------------------------- * Could not find key "Id" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "Name" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "ClientId" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "CurrencyCode" (keys present are: id, name, clientId, currencyCode, countryCode) at $ * Could not find key "CountryCode" (keys present are: id, name, clientId, currencyCode, countryCode) at $ This email may contain confidential and/or privileged information. If you are not the intended recipient - or have received this email by mistake - please notify the sender immediately and destroy the email. Any unauthorised copying, disclosure and/or distribution of the contents and/or attachments in this email is strictly prohibited. Email transmission security and error-free delivery cannot be guaranteed as information could be intercepted, corrupted, destroyed, delayed, incomplete and/or contain malware (virus). The sender of this email, therefore, does not accept liability for any errors and/or omissions in the contents of this message, which may arise as a result of email transmission.

mohindroo.deepak
2019-09-24 08:39
Any help on this?

mohindroo.deepak
2019-09-24 09:27
This is Urgent

bethskurrie
2019-09-24 09:32
I think you'll work it out if you read the error message properly.

bethskurrie
2019-09-24 09:34
`Could not find key "CountryCode" (keys present are: id, name, clientId, currencyCode, countryCode) at $`

mohindroo.deepak
2019-09-24 09:39
But countryCode key is available

mohindroo.deepak
2019-09-24 09:39
First letter is not caps

matt.fellows
2019-09-24 09:39
Check case maybe?

mohindroo.deepak
2019-09-24 09:39
Is the comparison case sensitive?

bethskurrie
2019-09-24 09:40
Correct

mohindroo.deepak
2019-09-24 09:40
How to check case in provider side

mohindroo.deepak
2019-09-24 09:40
Consumer has already send the pacts to broker

bethskurrie
2019-09-24 09:40
Either the code or the pact is wrong. One of them needs to change.

mohindroo.deepak
2019-09-24 09:42
On the consumer side, json generated from dto and that is having first letter is in Caps

mohindroo.deepak
2019-09-24 09:43
Is there any way to skip this on provider side?

bethskurrie
2019-09-24 09:43
No - it appears to be an integration bug.

bethskurrie
2019-09-24 09:44
This is exactly the kind of thing contract testing is supposed to identify.

bethskurrie
2019-09-24 09:44
One side expects capitalised names, the other expects ones with a lower case. They will not work correctly together in real life.

mohindroo.deepak
2019-09-24 09:44
On the consumer side, i am using body=Match.Type(dto)

mohindroo.deepak
2019-09-24 09:45
Dto properties is in caps

bethskurrie
2019-09-24 09:45
Well change the code.

matt.fellows
2019-09-24 09:45
Urgent for you maybe. Please do not pass on urgency to others. We're here to help, but we aren't paid to help you. We do it because we love it

mohindroo.deepak
2019-09-24 09:45
I think when pact generated, it change the first letter to small

bethskurrie
2019-09-24 09:46
No, the pact expects an upper case. The provider is returning a lower case.

mohindroo.deepak
2019-09-24 09:46
Sorry about that but it looks like an issue

bethskurrie
2019-09-24 09:46
As I said early, you need to change either the consumer+pact, or the provider, so that they match.

bethskurrie
2019-09-24 09:46
This is all the advice I can give now unfortunately.

bethskurrie
2019-09-24 09:47
There is no bug with the Pact code.

mohindroo.deepak
2019-09-24 09:48
There is a dto which is having 2 properties and both are strings. First letter is in caps. When we generate the pact using consumer side code. It change the first letter to small.

mohindroo.deepak
2019-09-24 09:51
Sorry Pls ignore my last line as consumer is generating the right properties. Only provider side makes issue

mohindroo.deepak
2019-09-24 09:58
I just check swagger also showing json object properties first letter in smaller case

mohindroo.deepak
2019-09-24 16:32
I got the problem. That is related to newtonsoft json which converts the property name first character.

mohindroo.deepak
2019-09-25 12:30
I am getting NilClass as value of property is coming null. I do not want to compare the data so i used Match.Type but seems it does not work with null values

mohindroo.deepak
2019-09-25 12:30
Any help on this?

bart.schotten
2019-09-25 12:33
If a property can be null you should leave it out of the contract entirely.

mohindroo.deepak
2019-09-25 12:36
No but i just do not want to compare data under that property but would like to check the contract.

bart.schotten
2019-09-25 12:37
What do you mean by "check the contract?"

neil
2019-09-25 12:40
Yeah what @bart.schotten said. If you don?t care about the property, don?t include it in the interaction on the consumer test

mohindroo.deepak
2019-09-25 12:41
Actual provider service does not have that data. So consumer pact is generating response body with some fake data which is not available on provider side. But property in response body needs to be compared.

mohindroo.deepak
2019-09-25 12:41
Thats why i used Match.Type

mohindroo.deepak
2019-09-25 12:41
On the consumer side

bart.schotten
2019-09-25 12:42
Yeah, that doesn't make any sense. If the provider does not have that property it has no business being in the contract.

mohindroo.deepak
2019-09-25 12:45
Provider do have this property. But value is coming null because consumer is sending some fake data here

mohindroo.deepak
2019-09-25 12:46
So in provider code, they fetch the data on the basis of some clientid

mohindroo.deepak
2019-09-25 12:46
And that clientid is fake in the consumer pact

bart.schotten
2019-09-25 12:47
Of course, but that's why you have provider states, so that the provider can set up realistic test data to return

bart.schotten
2019-09-25 12:49
If the provider returns a value in reality, but not during the pact test, the provider test is not set up correctly.

mohindroo.deepak
2019-09-25 12:51
In provider states, setting up test data means mocking of data?

mohindroo.deepak
2019-09-25 12:52
Or you are saying, generating that client setup in database so that when actual provider call happens, it works accordingly?

bart.schotten
2019-09-25 12:54
You can do it either by setting up data in the database, or by mocking a repository or service, that's up to the provider to decide. As long as it does hit the actual controller/endpoint.

mohindroo.deepak
2019-09-25 14:11
Adding in database not feasible in my case. Will provider middleware support Mocking of provider service?

mohindroo.deepak
2019-09-25 14:18
I mean to say here that verifier code hits the actual controller end point. If i would like to mock the provider service or response data, how can i do that?

bart.schotten
2019-09-25 14:39
This question is not really related to Pact anymore. You're basically asking how you can test an API.

mohindroo.deepak
2019-09-25 15:12
Not really. I am actually looking for some felxibility on provider side code to skip data validation

mohindroo.deepak
2019-09-25 15:16
Like i have another example. There is a dto Which has 2 properties IsOK book and ErrorText string In case if IsOk come true then errortext set to null in the provider code. Consumer also send it as null in the property. But when provider runs, it marks as Nil

mohindroo.deepak
2019-09-25 15:16
How can i compare null data in one of the consumer pact property with provider side Nil

mohindroo.deepak
2019-09-25 15:17
Nil is NilClass

bart.schotten
2019-09-25 15:22
You don't. You should define two interactions in your contract. - Interaction 1: in which IsOK is true and ErrorText is not present (so not null, but really non-existent) - Interaction 2: IsOK is false and ErrorText has a string value.

mohindroo.deepak
2019-09-25 15:23
In interaction 1, i cannot remove that errortext property. As there is dto desiarilize in the code to make json.

mohindroo.deepak
2019-09-25 15:23
Interaction 2 works fine here

mohindroo.deepak
2019-09-25 15:25
If i give c# null in json in consumer side

mohindroo.deepak
2019-09-25 15:25
Will that work when provider will run

mohindroo.deepak
2019-09-25 15:25
Compare the pact

mohindroo.deepak
2019-09-25 15:27
Let me try this

mohindroo.deepak
2019-09-25 15:28
That works :blush:

mohindroo.deepak
2019-09-25 16:27
That is working now. Thanks

mohindroo.deepak
2019-09-25 16:28
I am trying to get all pacts for particular provider using /latest

mohindroo.deepak
2019-09-25 16:28
But i am getting mesage that deprecated

mohindroo.deepak
2019-09-25 16:29
I am trying to get all pacts for particular provider using /latest But i am getting mesage that deprecated

vk.regs
2019-09-26 08:53
Hi, all I see that in latest PactNet.Windows nuget there is no Version property for PactOption. Could somebody suggest any other code that I can use to generate it?

vk.regs
2019-09-26 09:01
I only found way to generate it manually string version = DateTime.UtcNow.ToString(_pactOption.CustomDateTimeFormat, (IFormatProvider) CultureInfo.InvariantCulture) + (object) Guid.NewGuid();

mohindroo.deepak
2019-09-26 15:59
I was trying to use PACT_Description environment variable for individual interaction verification for consumer pact. But it does not update on the broker. There are 3 interactions in 1 consumer pact file. I am trying to execute one by one in 3 different tests on provider side. Pact broker do not updated in this.

mohindroo.deepak
2019-09-26 17:16
Anyone who tried environment variable for individual pact verification?

mohindroo.deepak
2019-09-27 07:09
@??

mohindroo.deepak
2019-09-27 07:37
Another issue i am facing is that i have created 2 consumers for 1 provider and when we run provider verification . Should validate all consumers pactVerifier. Serviceprovider(providername, provideruri) .pacturi(url) .verify

vk.regs
2019-09-27 10:47
sorry, posted by mistake

mohindroo.deepak
2019-09-30 05:33
I was trying to use PACT_Description environment variable for individual interaction verification for consumer pact. But it does not update on the broker. There are 3 interactions in 1 consumer pact file. I am trying to execute one by one in 3 different tests on provider side. Pact broker do not updated in this. Any help on this?

bethskurrie
2019-10-01 07:15
You can only publish verification results if you verify the entire pact.

bethskurrie
2019-10-01 09:16
@mohindroo.deepak ^^

mohindroo.deepak
2019-10-01 09:17
Hi

phillip.goff
2019-10-03 13:23
has joined #pact-net

jack.middleton
2019-10-07 13:43
has joined #pact-net

dperez
2019-10-07 15:11
hi @neil hope everything is good on your end. I noticed there's being some releases and was wondering if we could have those merged into the messaging branch ?

neil
2019-10-07 15:12
Yep sure can, will sort that out tomorrow.

dperez
2019-10-07 15:12
thanks a lot

neil
2019-10-08 10:44
@dperez master is now merged into message-pact

dperez
2019-10-08 14:39
thanks!

olaniyanayobamijr
2019-10-09 07:36
has joined #pact-net

vikassd2012
2019-10-11 02:26
Hey guys, had 2 questions on Pactnet

vikassd2012
2019-10-11 02:27
1. When I call PactBuilder.Build(); function to save the contract json file on my local I am noticing the casing of the file saved changes

vikassd2012
2019-10-11 02:28
For example my consumer and producer names that I am passing are

vikassd2012
2019-10-11 02:28
EventService and WorkService respectively

vikassd2012
2019-10-11 02:29
but the function saves the file in format eventservice-workservice.json

vikassd2012
2019-10-11 02:30
I am also using pactbroker after above step

vikassd2012
2019-10-11 02:30
to publish the pacts and there the name casing matches as per my input

vikassd2012
2019-10-11 02:31
what I am doing wrong? How I can get the local file casing to match as per my inputs and also PactBroker?

vikassd2012
2019-10-11 02:31
The 2nd question

bethskurrie
2019-10-11 02:31
I don't think you can

bethskurrie
2019-10-11 02:31
Pretty sure the code performs a downcase on it. Why does it matter?

bethskurrie
2019-10-11 02:32
You should just be able to publish the directory, and not care about the names.

vikassd2012
2019-10-11 02:32
Thanks Beth for your response, is it a convention to use downcase for service names?

bethskurrie
2019-10-11 02:33
You can make your own convention

bethskurrie
2019-10-11 02:33
the file name should be irrelevant - the contents of the file will contain the names with cases as you specified.

vikassd2012
2019-10-11 02:34
yes you are correct the content of the file has the right name casing

vikassd2012
2019-10-11 02:34
it mattered because I accidentally tried to query the pactbroker api with lower case

vikassd2012
2019-10-11 02:34
and got a 404

vikassd2012
2019-10-11 02:34
as expected

vikassd2012
2019-10-11 02:35
my concern was if I did this mistake other people in my team could do it too

vikassd2012
2019-10-11 02:35
so I was curious for the reasons

bethskurrie
2019-10-11 02:35
To be honest, you're the first person who has ever raised it.

bethskurrie
2019-10-11 02:35
I don't think it will be a major issue.

bethskurrie
2019-10-11 02:36
You'll have many bigger issues :stuck_out_tongue:

vikassd2012
2019-10-11 02:36
yes thats what I am trying to solve right now :slightly_smiling_face:

vikassd2012
2019-10-11 02:36
so I will leave the naming as is for now, hoping I am the only one who ran into it

vikassd2012
2019-10-11 02:37
my 2nd question was regarding pact broker api

vikassd2012
2019-10-11 02:37
I was trying to get interactions

vikassd2012
2019-10-11 02:38
using api


vikassd2012
2019-10-11 02:39
it only returned me 1 interaction

vikassd2012
2019-10-11 02:39
but I have 2 interactions

vikassd2012
2019-10-11 02:39
how I can get all ?

bethskurrie
2019-10-11 02:40
Have you published the version with 2 interactions?

bethskurrie
2019-10-11 02:40
Go to the broker UI and look at the matrix page

bethskurrie
2019-10-11 02:40
Its the icon with a little grid

vikassd2012
2019-10-11 02:40
oh

vikassd2012
2019-10-11 02:40
it only shows 1

vikassd2012
2019-10-11 02:40
but my local file has 2

bethskurrie
2019-10-11 02:40
well, it hasn't been published then

vikassd2012
2019-10-11 02:41
I will take a look not sure why it only published one

vikassd2012
2019-10-11 02:41
thanks Beth

bethskurrie
2019-10-11 02:44
np

mohindroo.deepak
2019-10-16 16:08
How can we start pact mock server in some other server apart from localhost?

mohindroo.deepak
2019-10-16 16:08
We are running main service in cloud and test running in onprem server

mohindroo.deepak
2019-10-16 16:08
So localhost will not work

mohindroo.deepak
2019-10-16 16:15
Any suggestions how to implement that

psychopomp3x
2019-11-11 20:37
has joined #pact-net

kalinets
2019-11-29 14:44
has joined #pact-net

christian.johann.eder
2019-12-03 11:10
has joined #pact-net

andrew.williams439
2019-12-03 16:09
has joined #pact-net

sliu7
2019-12-04 00:09
has joined #pact-net

theriaultnicolas
2019-12-12 03:26
has joined #pact-net

shilpa3006
2019-12-27 13:54
has joined #pact-net

akkoubak
2020-01-09 01:01
has joined #pact-net

akkoubak
2020-01-09 01:02
Hello, I am having trouble creating a PACT for a particular request using the .Net implementation of PACT. More specifically I am attempting to test a GraphQL POST request against a host server on this IP (http://52.188.176.147:4000). When running my dotnet test command, I am getting the following exception: ```System.Exception: 'There was a problem connecting to Provider API - {MYAPI}' - HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error )``` I am able to successfully test my ConsumerAPIClient which contains the following code: ```using Newtonsoft.Json; using RA; using System; using System.Collections.Generic; using http://System.Net; using http://System.Net.Http; using http://System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; namespace Consumer { public static class ConsumerApiClient { static public async Task<HttpResponseMessage> LocationQuery(string baseUri) { using (var client = new HttpClient { BaseAddress = new Uri(baseUri) }) { try { string json = JsonConvert.SerializeObject(new { query = "\n{\n locations {\n displayName\n }\n}" }); var content = new StringContent(json.ToString(), Encoding.UTF8, "application/json"); var response = await client.PostAsync($"{baseUri}", content); response.EnsureSuccessStatusCode(); return response; } catch (Exception ConnectionEx) { throw new Exception("There was a problem connecting to Provider API - LocationQuery.", ConnectionEx); } } } } }``` Here is my consumer test class:

akkoubak
2020-01-09 01:02
``` using Xunit; using PactNet.Mocks.MockHttpService; using PactNet.Mocks.MockHttpService.Models; using Consumer; using System.Collections.Generic; using PactNet.Matchers; using RA; namespace tests { public class ConsumerPactTests : IClassFixture<ConsumerPactClassFixture> { private IMockProviderService _mockProviderService; private string _mockProviderServiceBaseUri; private int _mockProviderServiceBasePort; public ConsumerPactTests(ConsumerPactClassFixture fixture) { _mockProviderService = fixture.MockProviderService; _mockProviderService.ClearInteractions(); //NOTE: Clears any previously registered interactions before the test is run _mockProviderServiceBaseUri = fixture.MockProviderServiceBaseUri; // _mockProviderServiceBaseUri = "http://52.188.176.147:4000/"; } [Fact] public void LocationQuery() { // Arrange _mockProviderService.Given("There is no data") .UponReceiving("A valid POST request to validate location GraphQL") .With(new ProviderServiceRequest { Method = http://HttpVerb.Post, Path = "", //Query = "", Headers = new Dictionary<string, object> { { "Content-Type", "application/json" } }, Body = new { query = "\n{\n locations {\n displayName\n }\n}" } }) .WillRespondWith(new ProviderServiceResponse { Status = 200, Headers = new Dictionary<string, object> { { "Content-Type", "application/json; charset=utf-8" } }, Body = new { data = (new { locations = Match.MinType(new { displayName = "" }, 2) }) } }); // Act var result = ConsumerApiClient.LocationQuery(_mockProviderServiceBaseUri).GetAwaiter().GetResult(); var resultBodyText = result.Content.ReadAsStringAsync().GetAwaiter().GetResult().ToString(); ; // Assert Assert.Contains("data", resultBodyText); } } }``` I would appreciate your help on this issue.

akkoubak
2020-01-09 02:28
@neil regarding the issue above, I also changed my MockProviderService's configs to use the IP address binding settings, but still has no luck. Here is my ConsumerPactClassFixture.cs: ```using PactNet; using PactNet.Mocks.MockHttpService; using PactNet.Models; using System; using Xunit; namespace tests { // This class is responsible for setting up a shared // mock server for Pact used by all the tests. // XUnit can use a Class Fixture for this. // See: https://goo.gl/hSq4nv public class ConsumerPactClassFixture : IDisposable { public IPactBuilder PactBuilder { get; private set; } public IMockProviderService MockProviderService { get; private set; } public int MockServerPort { get { return 9222; } } public string MockProviderServiceBaseUri { get { return String.Format("http://localhost:{0}", MockServerPort); } } public ConsumerPactClassFixture() { // Using Spec version 2.0.0 more details at https://goo.gl/UrBSRc var pactConfig = new PactConfig { SpecificationVersion = "2.0.0", PactDir = @"..\..\..\..\..\pacts", LogDir = @".\pact_logs" }; PactBuilder = new PactBuilder(pactConfig); PactBuilder.ServiceConsumer("TaxonomyConsumer") .HasPactWith("TaxonomyProvider"); MockProviderService = PactBuilder.MockService(MockServerPort, host: IPAddress.Any); } //teardown #region IDisposable Support private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // This will save the pact file once finished. PactBuilder.Build(); } disposedValue = true; } } // This code added to correctly implement the disposable pattern. public void Dispose() { // Do not change this code. Put cleanup code in Dispose(bool disposing) above. Dispose(true); } #endregion } }```

neil
2020-01-09 02:50
Looks like you?re getting a 500 response from the server, so it?s likely something to do with provider not knowing how to handle the request it has been sent.

neil
2020-01-09 02:51
`Body = new { query = "\n{\n locations {\n displayName\n }\n}" }` seems a little odd to me

neil
2020-01-09 02:52
It means you?ll be sending the following json to the server ```{ "query": "\n{\n locations {\n displayName\n }\n}" }```

neil
2020-01-09 02:53
It feels like you might be trying to send ```{ "query": { locations { displayName: "" } } }```

neil
2020-01-09 02:54
Also the string inside query isn?t valid json

akkoubak
2020-01-09 04:42
That's correct. However, when I execute dotnet run in consumer proj using the same string, I am getting the correct response and payload. I also tested the same string in Postman and was able to get the desired response. I have a feeling the error is related to how I am passing the host server's ip address and port to the mockserver

neil
2020-01-09 06:12
Is your provider verification code using the correct pact file? I?d build a very simple test provider api, which just logs the request that has been sent by pact, to ensure it?s as expected. Without any of the provider verification code and the provider api, I can?t really help much here.

franklin.huynh
2020-01-28 05:48
hi team, I would like to try .net core for messaging-pact. anyone could suggest where I can start? I see that we have this branch "https://github.com/pact-foundation/pact-net/tree/message-pact" how can I start with that?

bethskurrie
2020-01-28 05:49
There was a repo somewhere

bethskurrie
2020-01-28 05:49
BTW, hi!

bethskurrie
2020-01-28 05:50
I think there was another repo, as well as that branch

bethskurrie
2020-01-28 05:50
@neil might remember. Unfortunately we have the free slack, and so the messages about that might have dropped off our storage.

franklin.huynh
2020-01-28 05:52
do you meant you guys are not actively working on that at the moment?

franklin.huynh
2020-01-28 06:02

bethskurrie
2020-01-28 06:02
Nope

bethskurrie
2020-01-28 06:03
It's been a long while since anyone touched it

dperez
2020-01-28 15:13
hi @franklin.huynh take a look at this thread for a message implementation https://pact-foundation.slack.com/archives/C5F4KFKR8/p1559190383002900

dperez
2020-01-28 15:16
I noticed the thread is now archived, I'm able to see it but probably because I starred it, let me know if you have some problem reaching it.

franklin.huynh
2020-01-28 22:48
hi @dperez I cannot see the message. Could you share it to me?

dperez
2020-01-28 23:08
@franklin.huynh hope it helps.

franklin.huynh
2020-01-28 23:34
thanks @dperez I'll try follow the thread . many thanks

dperez
2020-01-28 23:35
we are actually using the branch mentioned in the thread for our contract testing with our messaging infraestructure and have to say, it does the job

akkoubak
2020-01-29 02:29
Hello there, I am attempting to run my consumer and provider tests in an Azure Pipeline using an ubuntu agent with Azure tasks. I am able to run the tests fine in my local machine on Windows. However, whenever I switch my PactNet Nuget package to Linux64, and build/run my tests projects, I encounter a failure in my provider test with the following message: ```Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command Version : 2.164.0 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli ============================================================================== /usr/bin/dotnet test /home/vsts/work/1/s/pact/Provider/tests --logger trx --results-directory /home/vsts/work/_temp Test run for /home/vsts/work/1/s/pact/Provider/tests/bin/Debug/net472/tests.dll(.NETFramework,Version=v4.7.2) Microsoft (R) Test Execution Command Line Tool Version 16.3.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. [http://xUnit.net 00:00:02.69] tests.ProviderApiTests.EnsureProviderApiHonoursPactWithConsumer [FAIL] X tests.ProviderApiTests.EnsureProviderApiHonoursPactWithConsumer [274ms] Error Message: System.TypeInitializationException : The type initializer for 'PactNet.Constants' threw an exception. ---- System.UriFormatException : Invalid URI: The format of the URI could not be determined. Stack Trace: at PactNet.PactVerifier+<>c.<.ctor>b__47_0 (PactNet.Core.PactVerifierHostConfig hostConfig) [0x00000] in <24e08d8a874b4357a3f70f66dbe375e6>:0 at PactNet.PactVerifier.Verify (System.String description, System.String providerState) [0x0010b] in <24e08d8a874b4357a3f70f66dbe375e6>:0 at tests.ProviderApiTests.EnsureProviderApiHonoursPactWithConsumer () [0x000a4] in <37a774785b2a4ef3a32cbac10560f0ad>:0 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <c453bf849bb84e719dbec0475e99db95>:0 ----- Inner Stack Trace ----- at System.Uri.CreateThis (System.String uri, System.Boolean dontEscape, System.UriKind uriKind) [0x0007b] in <4d8f95b7df544b3fa1a27dda924b4424>:0 at System.Uri..ctor (System.String uriString) [0x00014] in <4d8f95b7df544b3fa1a27dda924b4424>:0 at PactNet.Constants..cctor () [0x0001e] in <24e08d8a874b4357a3f70f66dbe375e6>:0 ``` All my tasks (Nuget restore, dotnet run/test) are running fine, and my consumer tests are passing. One thing to note, not sure if relevant, is the fact that I targeted different frameworks for my consumer proj (netcoreapp 2.1) and provider proj (net 472). Below is my code for my provider test class: ``` using System; using System.Collections.Generic; using PactNet; using PactNet.Infrastructure.Outputters; using Xunit; using Xunit.Abstractions; using Microsoft.Owin.Hosting; using tests.XUnitHelpers; namespace tests { public class ProviderApiTests: IDisposable { private string _serviceUri { get; } private string _providerUri { get; } //private string _pactServiceUri { get; } private readonly ITestOutputHelper _output; public ProviderApiTests(ITestOutputHelper output) { _output = output; _providerUri = "http://52.142.17.145:4000"; _serviceUri = "http://localhost:9001"; } [Fact] public void EnsureProviderApiHonoursPactWithConsumer() { //Arrange const string serviceUri = "http://localhost:9001"; // var buildNumber = Environment.GetEnvironmentVariable("BUILD_NUMBER"); DateTime utcDate = DateTime.UtcNow; var buildNumber = utcDate.ToString(); var config = new PactVerifierConfig { ProviderVersion = !string.IsNullOrEmpty(buildNumber) ? buildNumber : null, //NOTE: This is required for this feature to work PublishVerificationResults = !string.IsNullOrEmpty(buildNumber), Outputters = new List<IOutput> { new XUnitOutput(_output) } }; using (WebApp.Start<TestStartup>(serviceUri)) { //Act / Assert IPactVerifier pactVerifier = new PactVerifier(config); pactVerifier.ProviderState($"{serviceUri}/provider-states") .ServiceProvider("TaxonomyGraphQLProvider", _providerUri) .HonoursPactWith("TaxonomyGraphQLConsumer") // .PactUri(@"..\..\..\..\..\pacts\taxonomygraphqlconsumer-taxonomygraphqlprovider.json") .PactUri("https://blnmanagermobilesvc.pact.dius.com.au/pacts/provider/TaxonomyGraphQLProvider/consumer/TaxonomyGraphQLConsumer/latest", new PactUriOptions("MyAPIKey")) .Verify(); } } public virtual void Dispose() { } } }``` Please advise if you need further details to look at this. I am hoping this is a simple formatting issue that I missing given the fact that I've been staring at this for hours! Thank you much!!

franklin.huynh
2020-01-29 02:39
hi @dperez can I know which OS you are running the test? I did publish the nuget package (PactNet) and it ran successfully on Windows. However, it failed on mac saying it cannot find the . I think I need to publish the PactNet.OSX package. do you know how can I publish it?

dperez
2020-01-29 02:41
hi, correct, I'm running the Windows one only. Let me try to find the instructions about that one. Or probably @matt.fellows or @bethskurrie can give us a hint how to build that one.

franklin.huynh
2020-01-29 03:15
@bethskurrie @neil @matt.fellows would you be able to advice?

franklin.huynh
2020-01-29 03:39
FYI @dperez I just realised in your archived message has instruction how to publish the package including OSX, Linux. I will follow through

bethskurrie
2020-01-29 04:26
Sorry, I know less than nothing about dot net! @neil is the expert (sorry to bug you Neil!)

franklin.huynh
2020-01-30 03:11
it happened to me as well. What version of pact you're using?


franklin.huynh
2020-01-30 03:13
if you're using 2.5.0, try converting to 2.4.8

franklin.huynh
2020-01-30 05:00
I think I'm progressing with the publish the OSX package. But this issue is blocking me https://github.com/pact-foundation/pact-net/issues/231

bethskurrie
2020-01-30 20:56
@franklin.huynh if you give me a docker container to reproduce the issue, I'll investigate.

akkoubak
2020-02-05 03:08
Thank you so much! That worked!

akkoubak
2020-02-05 03:12
Hello, I am unable to serialize hyphenated JSON keys in the body content of my consumer tests. This is needed as some of the keys returned in the response payload follow the "xx-id" format. Please see example (application-id) below: ``` [Fact] public void RejectTimesheetWithoutAComment() { // Arange _mockProviderService.Given("There is no data") .UponReceiving("Timesheet to reject without an approver's comments") .With(new ProviderServiceRequest { Method = http://HttpVerb.Post, Path = "/approvals/actions/reject/4faf9285-78d4-4c09-b836-1cd48c393ed2", Query = "", Headers = new Dictionary<string, object> { { "Authorization", "Bearer TOKEN"}, {"Content-Type", "application/json; charset=utf-8" } }, Body = new { } }) .WillRespondWith(new ProviderServiceResponse { Status = 400, Headers = new Dictionary<string, object> { { "Content-Type", "application/json; charset=utf-8" } }, Body = Match.Type(new { application-id = new { comments = new { location = "body", param = "comments", msg = "Comments are required" } }}) }); // Act var result = ConsumerApiClient.RejectTimesheetWithoutComment(_mockProviderServiceBaseUri).GetAwaiter().GetResult(); var resultBodyText = result.Content.ReadAsStringAsync().GetAwaiter().GetResult().ToString(); // Assert Assert.Contains("errors", resultBodyText); }``` When attempting to build my test projects, VS fails the build due to the hyphen being part of the key. Is there a way around this? Please advise

matt.fellows
2020-02-05 03:24
Is this a Pact specific issue? Seems like you need a way to specific a key as a string in .NET

akkoubak
2020-02-05 03:52
There seems to be no way for me to manipulate the key when it is inside the body section of the test. Even if I attempt to serialize it outside the method, it does not appear to recognize keys. Am I missing something?

matt.fellows
2020-02-05 12:30
Might have to wait for someone else here, I'm not experienced .NET

sliu7
2020-02-05 23:30
It's not a Pact specific issue. I don't think .NET supports hyphens in identifiers https://stackoverflow.com/questions/5771577/can-you-have-a-property-name-containing-a-dash/5771598

neil
2020-02-06 03:00
No .NET doesn?t support that. If you want to do that you?ll need to create a .NET class which with http://Json.net JsonProperty attributes (https://www.newtonsoft.com/json/help/html/JsonPropertyName.htm) to represent that object rather than using a dynamic/anonymous object.

rafael.negron
2020-02-06 15:07
has joined #pact-net

conallbennett
2020-02-10 22:33
has joined #pact-net

paolaagudelo10
2020-02-21 19:01
has joined #pact-net

paolaagudelo10
2020-02-24 17:07
Hi everyone, i am trying to tag my provider with my branchName, to publish into the broker, but it is not working i am doing this: i don't now if this is well implemented?

neil
2020-02-24 23:21
Is it not getting sent to the broker at all? Are there errors? Are you running on Windows, Linux or OSX?

tomas.sakinis611
2020-02-25 11:03
has joined #pact-net

tomas.sakinis611
2020-02-25 11:07
Hi, i was wondering if i can save all interactions to json file without executing any endpoint tests?

naamam
2020-02-25 13:08
has joined #pact-net

naamam
2020-02-25 13:17
Hi guys, maybe you can help me. Trying to find out if there a way I can validate fields name & type and not actual values?

paolaagudelo10
2020-02-25 16:14
Hello, i am running on windows when i review the broker it has the provider version correctly however tag is not been added, the variable is already returning a value so i do´nt know if i am missing something when try to add the tag to the provider.

sliu7
2020-02-25 23:13
You can try Match.Type ```_mockProviderService.Given(...) .With(...) .WillRespondWith(new ProviderServiceResponse { Status = 200, Body = new { eventType = Match.Type("Test") } });```


naamam
2020-02-26 07:55
thanks! that worked perfect

naamam
2020-02-26 08:17
I have another question and I will explain it with an example. I have a request to get session (generated guid) and I'm using this session for the next request to get some data from the provider. I want to test both requests, is there a way to "save" the response from the first request and use it on the second request?

matt.fellows
2020-02-26 08:18
You want to research the topic called ?provider states?

matt.fellows
2020-02-26 08:18
Each interaction should be able to be tested in isolation - you?re talking about a _functional_ test (that relies on state and a sequence of pre-conditions to be setup)

matt.fellows
2020-02-26 08:19
Pact takes a different approach

matt.fellows
2020-02-26 08:20
So in your example, you should have two tests: 1. Get (or generate?) a session ID 2. Do something to /some/API _given_ session ID 1234 exists (the ?given? bit, is the state)


naamam
2020-02-26 08:26
OK, Thanks, I will look into that

naamam
2020-02-27 15:56
Hi there, I have encoding problem. Seems like when reading the pact file (provider side) somehow encoding of some character messed-up, This is the error I received: Expected "\u256B\u00C9\u256B\u00D6\u256B\u00DC \u256B\u00C9\u256B\u00E1\u256B\u00F9\u256B\u00E1\u256B\u00F2 \u256B\u00D6\u256B\u00A2\u256B\u00F2\u256B\u00A3\u256B\u00D6\u256B\u00A5 \u256B\u00A3\u256B\u00F3\u256B\u00FB\u256B\u00F2\u256B\u00BF \u256B\u00A3\u256B\u00DC?" *but got* "\u05D0\u05D9\u05DA \u05D0\u05E0\u05D7\u05E0\u05D5 \u05D9\u05DB\u05D5\u05DC\u05D9\u05DD \u05DC\u05E2\u05D6\u05D5\u05E8 \u05DC\u05DA?" at $.result.unavailableSelfServiceActions[1].selfServiceActions[3].selfServiceActionFields[1].fieldTitle The 'Expected' unicode characters aren't in the actual pact file (the character int the pact file are actually unicode characters after 'but got' ) How can I fix that?

neil
2020-02-27 23:37
Can you send a simple repro repo, which demonstrates the issue?

akkoubak
2020-02-28 03:20
Hello again, our company is in the early stages of implementing PACT. We currently have a running provider service in Azure that returns data of a certain user using a JWT stored in the QA database. I've been having some discussions with some of the devs and QAs, and few of them are under the impression that PACT mocks the provider in both consumer and provider tests. Their theory is that PACT validates the contract against a mocked instance of the provider service that way dependencies are handled without impacting the tests. Is that the case, or does PACT replay the interactions recorded in contract against the running service? Finally, are there any guidelines around mocking databases with the http://a.NET implementation of PACT? I am leaning towards using provider-states to inject data in the QA database before running the provider test, but some of the dev have a preference of staging up a database prior to a test run. Thank you for your help!

bethskurrie
2020-02-28 03:20
> Is that the case, or does PACT replay the interactions recorded in contract against the running service?

bethskurrie
2020-02-28 03:21
Yes


akkoubak
2020-02-28 03:31
Thank you Beth. I've been using PACT for the past couple of months, and I've created some training around running tests against a live provider. However, that point was challenged by some of the team member based on some the examples they found online. Thank you for confirming. Per your knowledge, are there use cases where provider is a mocked instance?

bethskurrie
2020-02-28 04:54
No - that would defeat the purpose

bethskurrie
2020-02-28 04:54
Could you find me this misleading documentation?

bethskurrie
2020-02-28 04:55
> I am leaning towards using provider-states to inject data in the QA database before running the provider test, but some of the dev have a preference of staging up a database prior to a test run.

bethskurrie
2020-02-28 04:55
You want your pact verification tests to be able to be run on a local developer machine.

bethskurrie
2020-02-28 04:55
That way you can know if you're going to break any consumers *before* you commit.

bethskurrie
2020-02-28 04:56
If you use a shared QA database, you would (I imagine) have to commit first, which would slow down your feedback loop.

akkoubak
2020-02-28 19:28
I am just trying to wrap my head around testing the service in the local box. How would that play into implementing contract testing in the pipeline? My theory was to commit and deploy changes, then run a canary/A-B type of test in the pipeline where you have multiple instances of the running service (stage vs prod). If stage pipeline fails, it rolls back to most recent stable version of master. Today our company is operating with a monolithic on-premise architecture that is being changed to a distributed model. This means we will be, initially, bringing in developed services from the legacy app to Azure and run contract testing for each service in isolation. Is that something you recommend, or do you have other thoughts in mind?

matt.fellows
2020-02-29 02:40
Contract tests aside, can you run unit tests in this thing? Can you run those on your local development machine?

matt.fellows
2020-02-29 02:41
If so, then you should definitely try to run your contract tests as part of that cycle. Running against a deployed environment is possible but adds some of the downsides of interested tests (in particular, the possibility of non-determinism)

paolaagudelo10
2020-02-29 13:48
Hi everyone, there is a way to retrieve the tags available in the pactBroker, according to the consumer tag versions, to build the url to verify in the provider side? i am working with pact-net in my provider side

paolaagudelo10
2020-02-29 13:51
something like "pactbroker.consumerVersionTags" but i want to verify it in my code building in the CI process, without dependency with the webhook broker

elliot.whiley94
2020-03-01 20:47
has joined #pact-net

sliu7
2020-03-04 06:01
I'm seeing similar behaviour on OSX too. It versions the verification result with the ProviderVersion but does not add any tags

neil
2020-03-05 01:04
Thanks for extra info, I?ll have a look into it.

neil
2020-03-05 14:32
So it turns out that option was added accidentally. If you want to use ProviderTags, you set it by using `.PactBroker` rather than `.PactUri` when configuring the broker url and auth settings ect. The `PactBroker` method will give you the option to supply `providerVersionTags` .


neil
2020-03-05 14:33
I?ll remove the `ProviderTags` from `PactVerifierConfig` now

sliu7
2020-03-06 03:15
Yup, using `.PactBroker` and giving the `providerVersionTags` works. Thanks! Any specific reason why we're wrapping the tags in quotes? Using `pactPublisher.PublishToBroker` on the consumer side tags it with the string without any wrapper in quotes

sliu7
2020-03-06 06:37
Also, using the consumerVersionTags don't seem to be applied. I have a consumer contract with `test` tag but running the verification doesn't verify the contract ```.PactBroker("<<pactBrokerUri>>", consumerVersionTags: new List<string> { "test" });```

sliu7
2020-03-06 06:38
But removing the consumerVersionTags verifies the contract with `master` tag

akkoubak
2020-03-06 20:45
Yes, when testing locally, a localhost is running in the a developer's box where we can test all the changes before deployment. Does that mean that we need to implement PACT as a manual step before merging? If that's the idea, then I am suspecting that we tag branch name on both provider and consumer sides, publish branch contract to broker, test branch provider against branch contract, merge branch contract into master contract , test branch provider against master contract, and then merge branch provider into master?

matt.fellows
2020-03-07 10:49
I wouldn't say as a "manual step" - it's all automatible. But yes something like you described is correct. There are a few pages about effective Pact setup on http://docs.pact.io that can help you think about it

neil
2020-03-08 10:56
It?s usually to handle spaces in the value and things like that

neil
2020-03-08 10:56
Any reason not to wrap in quotes?

neil
2020-03-08 10:57
Pretty sure I tested the consumer tags and it worked

neil
2020-03-08 11:06
Just tested it again and it worked for me. What PactNet version are you running? Maybe try updating to the latest if you haven?t already.

sliu7
2020-03-08 22:56
Yup, it's working for me now. Thanks! I was using 2.5.1 and updating to 2.5.2 worked :slightly_smiling_face:

dikili
2020-03-11 09:54
has joined #pact-net

dikili
2020-03-11 14:43
Hi All, I am new to CDCT and some help would be greatly appreciated, I use pactflow and able to publish the pact via my consumer code but for my provider i want to do the verification of that pact this fails on the PactVerifier last step , with the following error; /// PactNet.PactFailureException: 'Pact verification failed. See output for details. If the output is empty please provide a custom config.Outputters (IOutput) for your test framework, as we couldn't write to the console.' Help would greatly appreciated my code is as below; var comp= new PactClient(); /* //this is calling the api endpoint /pacts/provider/provider/consumer/Service_Consumer/latest to retrieve the pact file which works fine */ var pact= comp.GetPact(); var config = new PactVerifierConfig { Outputters = new List<IOutput> { new XUnitOutput(_output) }, ProviderVersion = "1.0.0", PublishVerificationResults = true, CustomHeaders = new Dictionary<string, string> { { "Authorization", "Bearer xxxxx" } }, }; IPactVerifier pactVerifier = newPactVerifier(config); pactVerifier.ServiceProvider("Service_Consumer", "https://dev-api-endpoint.com") .HonoursPactWith("contract") .PactBroker(pact.ResponseUri.AbsoluteUri) .Verify( description: "A request is made", providerState: "A GET request for getting titles is submitted");

neil
2020-03-11 23:41
What does the logs/output say? Without that info, I can?t tell what the problem is.

neil
2020-03-11 23:42
Is the value of `pact.ResponseUri.AbsoluteUri` the base Pactflow url?

neil
2020-03-11 23:42
Also I don?t understand why you need to do: ```var comp= new PactClient(); var pact= comp.GetPact();```

neil
2020-03-12 09:24
I think you want to checkout, the below line in the readme ```.PactBroker("http://pact-broker", uriOptions: new PactUriOptions("sometoken"), enablePending: true, consumerVersionTags: new List<string> { "master" }, providerVersionTags: new List<string> { "master" }, consumerVersionSelectors: new List<VersionTagSelector> { new VersionTagSelector("master", false, true) })```

neil
2020-03-12 09:25
Using: ```CustomHeaders = new Dictionary<string, string> { { "Authorization", "Bearer xxxxx" } }``` is not the way to specify your broker/pactflow token (if that?s what it is in your example)

dikili
2020-03-12 12:27
yes the url was not correct that was the issue for the test not passing now it passes but now the issue is even though PactFlow dashboard should reflect the verification for some reason it is not.

dikili
2020-03-12 12:28
i do it to call pactflow api to get the pact from the broker url and it returns be the published pact. i thought it wd make more sense for the provider test to find the pact first.

dikili
2020-03-12 12:39
@neil I submitted the logs, compare to yesterday definitely it is better but now only problem i face is the dashboard does not reflect the verification and i do not see any errors

dikili
2020-03-12 12:42
i believe it can not find any interactions as in the logs but normally it should have ??

dikili
2020-03-12 12:44
in the pact file which is json, i see that there is an interactions section on there which is not empty

bethskurrie
2020-03-12 19:50
@dikili if you can copy the latest version of your code into a gist we can have a look.

bethskurrie
2020-03-12 19:51
@neil what happens to the stdout from the Ruby code? Does it get printed or saved anywhere? It should say that it's either published or not published the verification results.

neil
2020-03-12 23:36
Yeah that?s a fun one. Some test runners in .NET redirect stdout way from the console, that?s what the Outputters part of the PactVerifierConfig is.

neil
2020-03-12 23:51
Please use these channels rather than direct message, that way others can help and this can hopefully help others. Any logs should be formatted and any not useful or sensitive information removed/redacted.

bethskurrie
2020-03-13 05:55
Righto

matt.fellows
2020-03-13 06:12
if anyone is interested in joining the .NET team as a core maintainer, please reach out - we have a number of big items on our roadmap that will require significant investment and collaboration across the group. For example: v3.0, better messages support, gRPC/Protobufs and more. Pact has open many doors for the core team, we?d love to help open some for you too

pbarrientos
2020-03-13 15:27
@dperez

dperez
2020-03-13 15:38
Hi @matt.fellows , @pbarrientos and myself we are highly interested to contribute to the team.

matt.fellows
2020-03-13 22:24
Amazing folks. I?ll tee up a chat

christian.johann.eder
2020-03-27 08:47
Cross posting from the protobuf channel: Just wanted to share that I finally managed to release my custom pact implementation with support for protobuf serialization. It?s compatible with the pact spec v2 (I.e. makes the specs tests green), and is available for .NET Standard 2.0 https://github.com/ChristianEder/impact The path I took allows to add custom serialization formats - such as protobuf - in addition to Json, and also to exchange the transport layer (out of the box, I support HTTP) at will. Pleased let me know what you think!

lbraymusso
2020-04-02 05:43
has joined #pact-net

siddharth.gupta
2020-04-08 07:28
has joined #pact-net

siddharth.gupta
2020-04-08 07:37
Hi there , I am beginner with Pact , I have been able to run consumer and provider tests provided at https://github.com/pact-foundation/pact-net. But I have question for the experts , when we test the provider APIs which interacts with and external component for example a SQL db , how do we deal with such scenario when running contract tests on local developer machine . As we do not deploy the services instead use self hosted routing .


siddharth.gupta
2020-04-08 09:48
Could not find relation 'pb:latest-provider-pacts' in resource at https://variantest.pact.dius.com.au/pacts/provider/Event%20API/consumer/Event%20API%20Consumer/latest-untagged (Pact::Hal::RelationNotFoundError)

siddharth.gupta
2020-04-08 09:48
Can anyone help on this ?

siddharth.gupta
2020-04-08 09:51
v

siddharth.gupta
2020-04-08 09:52
pactVerifier .ProviderState($"{serviceUri}/provider-states") .ServiceProvider("Event API", serviceUri) .HonoursPactWith("Event API Consumer") //.PactUri($"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}Consumer.Tests{Path.DirectorySeparatorChar}pacts{Path.DirectorySeparatorChar}event_api_consumer-event_api.json") .PactBroker("https://test.pact.dius.com.au/pacts/provider/Event%20API/consumer/Event%20API%20Consumer/latest-untagged", new PactUriOptions("rALSJLBCK;JDVBK")) .Verify();

bethskurrie
2020-04-08 10:50
Do you have a very very old version of the Pact Broker?

bethskurrie
2020-04-08 10:51
Oh, right, you're on Pactflow. Have a look at the resource.

bethskurrie
2020-04-08 10:52
Oh, I see.

bethskurrie
2020-04-08 10:52
You just need the base url of the Pact Broker

bethskurrie
2020-04-08 10:53
You're putting the pact url in.

bethskurrie
2020-04-08 10:54
You either give it the pact uri, which is the full url to the pact, or you give it the provider name and the base url of the Pact Broker, and it will fetch the pacts automatically for you.

siddharth.gupta
2020-04-08 12:06
thanks for the reply Beth , when I used PactURI the was passed but the verification status was not updated on Pactflow . I also tried setting up PublishVerificationResutls to true , but got an error . I am strill struggling to successfully use PactBroker even with just the baseuri , most of the time I am getting 301 status code . can you point me to some examples with .NET , where .Also how can I publish the tag and version for consumer while pushing Pact file to PactFlow ?

matt.fellows
2020-04-08 13:19
Siddharth, did the example I share with you the other day not work?

matt.fellows
2020-04-08 13:20
OH! I did not push, that would explain that



matt.fellows
2020-04-08 13:21
I hope this clears things up

siddharth.gupta
2020-04-09 05:08
Thanks Matt , I was able to pus back the verification results using Pacturi by specifying ProviderVersikon in PactverifyerConfig . Above code and document also helps me . I am going to try my hands with webhook today and let you know if I have any questions , Can I delete the Pact file from pactflow as developer account supports only one pact file ?

matt.fellows
2020-04-09 05:10
It should support up to 5 contracts, but yes you can delete

matt.fellows
2020-04-09 05:10
the API supports it via a `DELETE`

matt.fellows
2020-04-09 05:11
we don?t yet have a UI option in the new style, but if you go to `use old UI` you can delete from there

siddharth.gupta
2020-04-09 06:09
thanks

rahulpandey8920
2020-04-12 19:27
has joined #pact-net

rahulpandey8920
2020-04-14 21:05
Hello, I was looking at the example code to setup the mock providers within the consumer unit tests and it makes me think if specific implementation of `ProviderServiceRequest` and `ProviderServiceResponse` would be useful to make the setup a little compact ? so that we could do something like ```_mockProviderService .Given("There is a something with id 'tester'") .UponReceiving("A GET request to retrieve the something") .With(new JsonGetRequest("/somethings/tester") .WillRespondWith(new JsonOkResponse { Body = new { id = "tester", firstName = "Totally", lastName = "Awesome" } );```

paolaagudelo10
2020-04-15 16:59
Hi everyone, someone can help me with this problem? The broker is already up because the test are verified, but when try to publish the verification result to the broker, the result the following message appears pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.2/lib/pact/provider/verification_results/publish.rb:103:in `publish_verification_results': Error returned from verification results publication 500 {"error"=>{"message"=>"An error has occurred. The details have been logged with the reference agMzWQbfmU", "reference"=>"agMzWQbfmU"}} (Pact::Provider::VerificationResults::PublicationError) i am using "PactNet.Linux.x64" Version="2.5.3" in a jenkins pipeline

jan.falek
2020-04-16 13:16
has joined #pact-net

akkoubak
2020-04-30 23:45
Hello, I am attempting to validate the following contract for a provider that returns an array of objects: using the eachLike matcher method: ```{ "consumer": { "name": "assignmentApolloGQL" }, "provider": { "name": "CWS" }, "interactions": [ { "description": "An existing assignment Id", "providerState": "default", "request": { "method": "POST", "path": "/EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses", "headers": { "Content-Type": "application/json;charset=utf-8" }, "body": { "skip": 0, "top": 10, "assignmentNumber": 4961 } }, "response": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": [ { "friendlyId": "4961", "assignmentId": "a425c44e-868e-4bb4-b80e-ad64d1060011", "status": "Expired", "subStatus": "N/A", "approvalStatus": "Extension in Progress", "modifyDate": "0001-01-01T05:00:00Z", "clientName": "Foggy" } ], "matchingRules": { "$.body": { "min": 1 }, "$.body[*].*": { "match": "type" } } } } ], "metadata": { "pactSpecification": { "version": "2.0.0" } } }``` The payload that provider returns a payload that looks like this: `[`     `{`         `"friendlyId": "4961",`         `"assignmentId": "a425c44e-868e-4bb4-b80e-ad64d1060011",`         `"status": "Expired",`         `"subStatus": "Extension in Progress",`         `"approvalStatus": "HM Approval",`         `"modifyDate": "0001-01-01T05:00:00Z",`         `"clientName": "Foggy"`     `}` `]` However, when validating the provider I am getting the following error: `Failures:` `1) Verifying a pact between assignmentApolloGQL and CWS Given default An existing assignment Id with POST /EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses returns a response which has a matching body` `Failure/Error: let(:response_body) { parse_body_from_response(response) }` `JSON::ParserError:` `757: unexpected token at '???[{"friendlyId":"4961","assignmentId":"a425c44e-868e-4bb4-b80e-ad64d1060011","status":"Expired","subStatus":"Extension in Progress","approvalStatus":"HM Approval","modifyDate":"0001-01-01T05:00:00Z","clientName":"Foggy"}]'` `1 interaction, 1 failure` `Failed interactions:` `To re-run just this failing interaction, change the verify method to '.Verify(description: "An existing assignment Id", providerState: "default")'. Please do not check in this change! # An existing assignment id given default` `WARN: Cannot publish verification for assignmentApolloGQL as there is no link named pb:publish-verification-results in the pact JSON. If you are using a pact broker, please upgrade to version 2.0.0 or later.`

akkoubak
2020-04-30 23:49
Also here is the log from the provider: ```I, [2020-04-30T19:44:30.265610 #19644] INFO -- : Running example 'Verifying a pact between assignmentApolloGQL and CWS Given default An existing assignment Id with POST /EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses returns a response which has status code 200' I, [2020-04-30T19:44:30.574623 #19644] INFO -- : Sending POST request to path: "/EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses" with headers: {"CONTENT_TYPE"=>"application/json;charset=utf-8", "HTTP_X_PACT_ORIGINAL_HEADER_NAMES"=>"Content-Type", "X_PACT_PROVIDER_STATES"=>[{"name"=>"default"}]}, see debug logs for body D, [2020-04-30T19:44:30.574623 #19644] DEBUG -- : body :{"skip":0,"top":10,"assignmentNumber":4961} I, [2020-04-30T19:44:35.295607 #19644] INFO -- : Received response with status: 200, headers: {my headers"}, see debug logs for body D, [2020-04-30T19:44:35.296614 #19644] DEBUG -- : body: [{"friendlyId":"4961","assignmentId":"a425c44e-868e-4bb4-b80e-ad64d1060011","status":"Expired","subStatus":"Extension in Progress","approvalStatus":"HM Approval","modifyDate":"0001-01-01T05:00:00Z","clientName":"Foggy"}]```

bethskurrie
2020-04-30 23:50
I can't see anything immediately wrong. You've got an array as a top level element, but that should be supported.

bethskurrie
2020-04-30 23:50
Can you try and reproduce it using this repository, so we can take a look at it? https://github.com/pact-foundation/pact-ruby-standalone-e2e-example

bethskurrie
2020-04-30 23:51
This is an example using the underlying engine that Pact Net uses.

bethskurrie
2020-04-30 23:51
That will help us identify where the issue lies.

matt.fellows
2020-05-01 00:10
maybe also check the headers that are coming back. I looked at your logs just there and saw ?my headers? - not sure if you edited it. Thtis being said, I?m pretty sure another issue would first show up

matt.fellows
2020-05-01 00:11
If you can cURL that endpoint and share the fully headers/response body, that would be useful

akkoubak
2020-05-01 00:16
Hi Matt, I omitted the headers here is the full log: `I, [2020-04-30T20:14:22.866006 #40704] INFO -- : Running example 'Verifying a pact between assignmentApolloGQL and CWS Given default An existing assignment Id with POST /EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses returns a response which has status code 200'` `I, [2020-04-30T20:14:23.164009 #40704] INFO -- : Sending POST request to path: "/EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses" with headers: {"CONTENT_TYPE"=>"application/json;charset=utf-8", "HTTP_X_PACT_ORIGINAL_HEADER_NAMES"=>"Content-Type", "X_PACT_PROVIDER_STATES"=>[{"name"=>"default"}]}, see debug logs for body` `D, [2020-04-30T20:14:23.164009 #40704] DEBUG -- : body :{"skip":0,"top":10,"assignmentNumber":4961}` `I, [2020-04-30T20:14:27.620041 #40704] INFO -- : Received response with status: 200, headers: {"Date"=>"Fri, 01 May 2020 00:14:27 GMT", "Content-Type"=>"application/json", "Content-Length"=>"223", "Connection"=>"keep-alive", "Set-Cookie"=>"__cfduid=d4e63f8909d64d03ead55af65d25b03491588292066; expires=Sun, 31-May-20 00:14:26 GMT; path=/; domain=.http://beeline.com; HttpOnly; SameSite=Lax\n.BEEAUTH_qa059=4c04bcea-5a60-4663-891b-e76f2d652312; expires=Sun, 03-May-2020 00:14:27 GMT; path=/; secure; HttpOnly\na74qacl051=qaweb403.sfld; path=/; HttpOnly; Secure\n__cfruid=515b3ca5ba0b16ce5ab42e254ddf44ee65cf8261-1588292067; path=/; domain=.http://beeline.com; HttpOnly; Secure; SameSite=None", "Cache-Control"=>"private", "Strict-Transport-Security"=>"max-age=300; includeSubDomains; preload; always;", "Content-Security-Policy"=>"frame-ancestors *.http://beeline.com *.http://iqnavigator.com *.http://iqnavigator.eu *.http://beeline.to *.http://beelinetowork.io` `http://beeline.to` `http://beelinetowork.io` `https://beebot-bot-sales.azurewebsites.net` `https://beebot-bot-prod.azurewebsites.net` `https://beebot-bot-proj.azurewebsites.net` `https://beebot-bot-hfreg.azurewebsites.net` `https://beebot-bot-reg.azurewebsites.net` `https://beebot-bot-pct.azurewebsites.net` `https://beebot-bot-qa.azurewebsites.net` `https://beebot-bot-hfqa.azurewebsites.net` `https://cdn.botframework.com` `` `https://directline.botframework.com", "X-Xss-Protection"=>"1", "Totalserverpagetime"=>"569", "Cdnheader"=>"{\"AuthenticationDate\":\"2020-05-01T00:14:27.5297229Z\",\"AuthenticationType\":\"Auth0CwsLogin\",\"ImpersonationType\":\"Self\",\"UserName\":\"gmurray\",\"OrganizationType\":\"Beeline\",\"Organization\":null,\"ImpersonateeUserName\":null,\"ImpersonateeOrganizationType\":null,\"ImpersonateeOrganization\":null,\"CFRAY\":\"58c54d6a6ce7e3c2-DTW\"}", "X-Content-Type-Options"=>"nosniff", "X-Ua-Compatible"=>"IE=edge", "Accept-Ranges"=>"bytes", "Cf-Cache-Status"=>"DYNAMIC", "Expect-Ct"=>"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Server"=>"cloudflare", "Cf-Ray"=>"58c54d6a6ce7e3c2-ATL", "Cf-Request-Id"=>"026f2eb6830000e3c259184200000001"}, see debug logs for body` `D, [2020-04-30T20:14:27.620041 #40704] DEBUG -- : body: [{"friendlyId":"4961","assignmentId":"a425c44e-868e-4bb4-b80e-ad64d1060011","status":"Expired","subStatus":"Extension in Progress","approvalStatus":"HM Approval","modifyDate":"0001-01-01T05:00:00Z","clientName":"Foggy"}]`

kaypee90
2020-05-01 00:18
has joined #pact-net

akkoubak
2020-05-01 00:29
Hi Beth, I can certainly do that, my only concern is that I am passing a JWT as a custom header on the provider side, not sure if I'd be allowed to include it in my forked solution. Do you want me to fork it without the JWT?

bethskurrie
2020-05-01 00:30
yes, it shouldn't affect the repro.

bethskurrie
2020-05-01 00:30
the standalone example doesn't actually include any pact net code - it's doing the bare minimum to reproduce an issue.

bethskurrie
2020-05-01 00:31
it looks like the issue is in the body

matt.fellows
2020-05-01 00:42
Abdel - for future code posts, can you try using the triple backtick? That will format the code much better

matt.fellows
2020-05-01 00:46
in any case - it looks OK to my eyes

akkoubak
2020-05-01 00:48
Sorry, if it helps: ```I, [2020-04-30T20:14:22.866006 #40704] INFO -- : Running example 'Verifying a pact between assignmentApolloGQL and CWS Given default An existing assignment Id with POST /EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses returns a response which has status code 200' I, [2020-04-30T20:14:23.164009 #40704] INFO -- : Sending POST request to path: "/EndPoints/Cloud/Assignment/AssignmentService.svc/RawJSON/GetAssignmentStatuses" with headers: {"CONTENT_TYPE"=>"application/json;charset=utf-8", "HTTP_X_PACT_ORIGINAL_HEADER_NAMES"=>"Content-Type", "X_PACT_PROVIDER_STATES"=>[{"name"=>"default"}]}, see debug logs for body D, [2020-04-30T20:14:23.164009 #40704] DEBUG -- : body :{"skip":0,"top":10,"assignmentNumber":4961} I, [2020-04-30T20:14:27.620041 #40704] INFO -- : Received response with status: 200, headers: {"Date"=>"Fri, 01 May 2020 00:14:27 GMT", "Content-Type"=>"application/json", "Content-Length"=>"223", "Connection"=>"keep-alive", "Set-Cookie"=>"__cfduid=d4e63f8909d64d03ead55af65d25b03491588292066; expires=Sun, 31-May-20 00:14:26 GMT; path=/; domain=.http://beeline.com; HttpOnly; SameSite=Lax\n.BEEAUTH_qa059=4c04bcea-5a60-4663-891b-e76f2d652312; expires=Sun, 03-May-2020 00:14:27 GMT; path=/; secure; HttpOnly\na74qacl051=qaweb403.sfld; path=/; HttpOnly; Secure\n__cfruid=515b3ca5ba0b16ce5ab42e254ddf44ee65cf8261-1588292067; path=/; domain=.http://beeline.com; HttpOnly; Secure; SameSite=None", "Cache-Control"=>"private", "Strict-Transport-Security"=>"max-age=300; includeSubDomains; preload; always;", "Content-Security-Policy"=>"frame-ancestors *.http://beeline.com *.http://iqnavigator.com *.http://iqnavigator.eu *.http://beeline.to *.http://beelinetowork.io http://beeline.to http://beelinetowork.io https://beebot-bot-sales.azurewebsites.net https://beebot-bot-prod.azurewebsites.net https://beebot-bot-proj.azurewebsites.net https://beebot-bot-hfreg.azurewebsites.net https://beebot-bot-reg.azurewebsites.net https://beebot-bot-pct.azurewebsites.net https://beebot-bot-qa.azurewebsites.net https://beebot-bot-hfqa.azurewebsites.net https://cdn.botframework.com https://directline.botframework.com", "X-Xss-Protection"=>"1", "Totalserverpagetime"=>"569", "Cdnheader"=>"{\"AuthenticationDate\":\"2020-05-01T00:14:27.5297229Z\",\"AuthenticationType\":\"Auth0CwsLogin\",\"ImpersonationType\":\"Self\",\"UserName\":\"gmurray\",\"OrganizationType\":\"Beeline\",\"Organization\":null,\"ImpersonateeUserName\":null,\"ImpersonateeOrganizationType\":null,\"ImpersonateeOrganization\":null,\"CFRAY\":\"58c54d6a6ce7e3c2-DTW\"}", "X-Content-Type-Options"=>"nosniff", "X-Ua-Compatible"=>"IE=edge", "Accept-Ranges"=>"bytes", "Cf-Cache-Status"=>"DYNAMIC", "Expect-Ct"=>"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Server"=>"cloudflare", "Cf-Ray"=>"58c54d6a6ce7e3c2-ATL", "Cf-Request-Id"=>"026f2eb6830000e3c259184200000001"}, see debug logs for body D, [2020-04-30T20:14:27.620041 #40704] DEBUG -- : body: [{"friendlyId":"4961","assignmentId":"a425c44e-868e-4bb4-b80e-ad64d1060011","status":"Expired","subStatus":"Extension in Progress","approvalStatus":"HM Approval","modifyDate":"0001-01-01T05:00:00Z","clientName":"Foggy"}]```

matt.fellows
2020-05-01 00:51
:slightly_smiling_face:

matt.fellows
2020-05-01 00:51
ALl good, that?s better - but unfortunately I still can?t see why it might be failing :disappointed:

akkoubak
2020-05-01 02:25
Hi Beth, I am attempting to install the correct version of the app which is 1.80.1. However, I am running on a windows machine. Does the script support windows? If not, is there a manual way around it?

bethskurrie
2020-05-01 04:52
No, it doesn't support Windows, sorry. You don't have cygwin?

bethskurrie
2020-05-01 04:53
You can always push your changes and they'll run on Travis.

bethskurrie
2020-05-01 04:53
It's a very quick build.

rahulpandey8920
2020-05-05 09:17
Is there any work being done for incorporating pact specification version 3.0 in PactNet ? So that it can be used for contract testing with things like kafka streams ?

bethskurrie
2020-05-05 09:17
Someone was working on message pact for .net

bethskurrie
2020-05-05 09:18
I think they lost momentum on it though.


rahulpandey8920
2020-05-05 09:19
Thanks for the quick response @bethskurrie !

a.smith
2020-05-07 08:18
has joined #pact-net

bethskurrie
2020-05-08 03:23
Hey .net people - anyone have some free lockdown time and interested in helping with this feature? https://pact.canny.io/feature-requests/p/create-e2e-example-that-runs-on-appveyor-or-similar-to-help-diagnose-issues

priyafa
2020-05-08 13:38
has joined #pact-net

priyafa
2020-05-08 13:43
Hi there, I am a QA engineer. I am just very new to contract testing and read about PACT online today. I am not sure this is the right place to ask. Please redirect me if not. I would like to know whether its right to use PACT in my scenario. I have a rest api to test, which takes data from a third party wcf service , process and gives some result. Can someone please advice ? THanks in advance

neil
2020-05-10 23:18
You probably won?t be able to test the WCF part, but you likely can test between your consumers and the rest api, if it?s JSON based.

neil
2020-05-10 23:19
I?m guessing the WCF service is SOAP/XML based.

a.smith
2020-05-11 08:13
Hi @bethskurrie, I can probably help out with this :+1: The Ruby sample looks like a good source to crib from.

bethskurrie
2020-05-11 08:49
@a.smith that would be amazing!

bethskurrie
2020-05-11 08:51
We want the barest of bare bones end to end scenarios - it's not about showing best practice, it's about providing people with something they can quickly modify to demonstrate bugs or problems they're having.

a.smith
2020-05-11 09:18
The feature mentions AppVeyor. I'm happy to put it there, but just wanted to check what you use for CI in other repos, and whether you think it would be worthwhile keeping it all together?

bethskurrie
2020-05-11 09:18
Appveyor is the one I've used

bethskurrie
2020-05-11 09:19
As long as it's something that people can get a free oss account with their github account when they fork it, I'm not fussy though

bethskurrie
2020-05-11 09:19
Like, when you fork a github repo, you can see the Travis build comes pretty much automatically if you have a Travis account.

bethskurrie
2020-05-11 09:21
It looks like Travis does Windows now though.


bethskurrie
2020-05-11 09:22
They didn't when I set up the appveyor builds years ago. Travis would be my preference, if it's available for oss projects, because all our other builds are on Travis

a.smith
2020-05-11 09:32
:+1: Also .NET does not-Windows now :wink:

a.smith
2020-05-11 09:33
Let's go with Travis then. I've taken a fork of the Ruby repo and will see what I can do with this over the next few days

lewis.thorley
2020-05-11 10:11
has joined #pact-net

bethskurrie
2020-05-14 22:01
Awesome sauce @a.smith

bethskurrie
2020-05-14 22:02
> Also .NET does not-Windows now We seem to have more people with http://Pact.NET problems with Windows on than we do on not-Windows :cry:

a.smith
2020-05-15 06:32
Ah well, between my work laptop and my personal laptop, I've Windows, macOS and Ubuntu covered, so... :crossed_fingers:

arindam.datta
2020-05-23 15:42
has joined #pact-net

arindam.datta
2020-05-23 15:44
Hi, any plan soon to support message pact as per v3 spec?

matt.fellows
2020-05-24 09:48
There is an active branch, I suggest jump on the PR for it and help vote/get it thru

a.smith
2020-05-25 14:14
I?m about done with this, just trying to wrap my head around the build bits. I?m trying to port the Rakefiles directly to PowerShell?s Invoke-Build, but am somewhat struggling with the provider?s tasks, as I _think_ the magic appears to be mostly within imported gems, and I don?t understand the comment about doing the whole publish-verify flow in Rake. I?ve pushed what I?ve done so far for some feedback: https://github.com/alastairs/pact-net-e2e-example/tree/dotnet-port

a.smith
2020-05-25 14:17
Sharing here because I forgot to tick the necessary box :upside_down_face:

bethskurrie
2020-05-26 03:49
Hi @a.smith

bethskurrie
2020-05-26 03:51
I'm just having a look at your net port of the rake tasks.

bethskurrie
2020-05-26 03:58
@a.smith have sent you a PM

bethskurrie
2020-05-26 04:00
PactNet maintainers, I've made a new branch, message-pact-2, which has the latest changes from master, merged into the message-pact branch. I didn't do a straight merge, because I am not a pact-net maintainer or even a .net developer, so I didn't want to screw anything up, but we have a Pactflow customer who is already using the message branch who needs some of the fixes from master. cc @neil

neil
2020-05-26 04:18
:thumbsup: I?ll get master merged into message-pact

bethskurrie
2020-05-26 04:18
Ta. Who knows what's outstanding on the message work?

neil
2020-05-26 04:18
TODO.txt

bethskurrie
2020-05-26 04:18
Our customer is already using it quite happily apparently.

bethskurrie
2020-05-26 04:18
cool

neil
2020-05-26 04:20
It?s not crazy far off, it just lost momentum as the person who was driving it just disappeared (I?m guessing got super busy with other stuff)

bethskurrie
2020-05-26 04:20
We all know what that's like.

bethskurrie
2020-05-26 04:20
The problem with OSS. Lost momentum due to lack of free time.

neil
2020-05-26 04:21
Yep, it?s constant struggle. I always feel bad for not putting in more time.

bethskurrie
2020-05-26 04:21
I didn't do much the year the bots were born.

a.smith
2020-05-26 11:14
Has anyone successfully used Pact-Net with Azure Event Grid?

neil
2020-05-27 14:08
I have just merged master into the `message-pact` branch. Are you ok with me deleting `message-pact-2` ?

arindam.datta
2020-06-01 12:39
hi, can anyone please redirect me towards a sample implementation of CDC using pact-net? I got the Consumer side. But I am struggling to understand the provider verification part. I feel that the ".net workshop" thing is incomplete and misleading.

arindam.datta
2020-06-01 12:40
I am looking forward to kind of a more complete implementation...

a.smith
2020-06-01 13:37
@arindam.datta Can you elaborate on what you're missing?

arindam.datta
2020-06-01 17:18
If I am not missing anything, following are the things which seem either incomplete or erroneous to me: ? the Provider test project doesn't have any relation with the actual Project api project ? Any endpoint except "/provider-states" throws 404

a.smith
2020-06-01 18:54
Gotcha. This side of things is a bit confusing :slightly_smiling_face: The Provider tests are almost a framework for running the API project and executing the pacts against it. There?s a lot of boilerplate to running Provider tests in .NET right now. https://github.com/pact-foundation/pact-net#2-tell-the-provider-it-needs-to-honour-the-pact is where you should start; the `using` statement ~50% through the first code sample starts the API project and tells it the URL on which it should listen: in this sample, that URI is `http://localhost:9222`. Note from the second code sample that the `TestStartup` class composes an instance of `Startup` from your API project and the `ProviderStateMiddleware`. This middleware is a test-only piece of boilerplate, and is included to support the `state` item from the Pact specification. If you?ve not added any State lines to your pacts, you don?t need this bit. The `ProviderStateMiddleware` is a door into your API project, that allows you to put it into the appropriate state for that part of the pact. It is called by Pact on the `/provider-states` endpoint, and maps the `state` string from the pact to an arbitrary action. The mapping is in `ProviderStateMiddleware.Invoke()` and the `_providerStates` dictionary, the specific example state and action are defined in the `ProviderStateMiddleware` constructor. To be honest, I found the provider states portion _really_ confusing until I talked it through at length with a colleague. I?d love to see this part of the library simplified for developers. For our use case, testing Azure Functions, we actually spin up the Azure Function application standalone, and run the `provider-states` route in a completely separate http://ASP.NET Core application, which monkeys around with the database (or whatever) on behalf of the Function. This of course assumes that the state is outside of the Function and not in-process somehow? Meaning no disrespect whatsoever to the library maintainers, the Pact-Net README is quite general (=> vague), and a bit out of date (=> confusing). You might find the https://github.com/pact-foundation/pact-net/tree/master/Samples/EventApi/Provider.Api.Web.Tests clearer, especially if you step through it with the debugger.

matt.fellows
2020-06-02 00:54
> To be honest, I found the provider states portion really confusing until I talked it through at length with a colleague. I?d love to see this part of the library simplified for developers. For our use case, testing Azure Functions, we actually spin up the Azure Function application standalone, and run the provider-states route in a completely separate http://ASP.NET Core application, which monkeys around with the database (or whatever) on behalf of the Function. This of course assumes that the state is outside of the Function and not in-process somehow? that?s a decent strategy, but does require knowledge

matt.fellows
2020-06-02 00:54
Agree, provider states are hard to wrap your head around

matt.fellows
2020-06-02 00:54
(also, thanks heaps for that workshop)

matt.fellows
2020-06-02 00:55
@arindam.datta you might want to check out https://github.com/pact-foundation/pact-workshop-js. It?s a solid workshop that explains all of the concepts (in JS). But they should translate across to .NET pretty well

arindam.datta
2020-06-04 08:19
Thanks @matt.fellows. I am already doing that. things are so neat with Node and so clumsy with .Net.

arindam.datta
2020-06-04 08:20
@a.smith, thanks for such a detailed response. It was really helpful. Indeed the other sample test project which you mentioned was somewhat clearer than the workshop samples.

a.smith
2020-06-04 08:45
Glad it helped @arindam.datta :slightly_smiling_face:

arindam.datta
2020-06-08 16:16
Hi, my provider verification tests running inside docker container fails even though the interaction is passed. The logs from the container as below: `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:34:in `run'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:69:in `run_with_pact_uri_object'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:50:in `run_specs'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:21:in `call'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:13:in `call'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:169:in `verify_pact'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:43:in `block in call'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `collect'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `call'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:34:in `call'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/verify.rb:56:in `verify'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'` `from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/app/pact-provider-verifier.rb:33:in `<main>'` `DEBUG: This pact is still in pending state for ProviderSvc as the successful verification results have not yet been published.` `Test Run Failed.` `Total tests: 1` `Failed: 1` `Total time: 13.6085 Seconds` `The command '/bin/sh -c dotnet test "./tests/ProviderSvc.Tests/ProviderSvc.Tests.csproj"' returned a non-zero code: 1` `##[error]The command '/bin/sh -c dotnet test "./tests/ProviderSvc.Tests/ProviderSvc.Tests.csproj"' returned a non-zero code: 1` `##[error]The process '/usr/bin/docker' failed with exit code 1`

arindam.datta
2020-06-08 16:17
Wheras, the interaction is passed: `Content-Type: "application/json"` `I, [2020-06-08T16:06:17.959905 #146] INFO -- response: Status 200` `D, [2020-06-08T16:06:17.960059 #146] DEBUG -- response: connection: "close"` `date: "Mon, 08 Jun 2020 16:06:17 GMT"` `server: "Kestrel"` `transfer-encoding: "chunked"` `has status code 200` `has a matching body` `includes headers` `"Content-Type" which equals "application/json; charset=utf-8"` `1 interaction, 0 failures`

arindam.datta
2020-06-08 16:18
Can anyone please give me a clue what I am doing wrong?

arindam.datta
2020-06-08 16:21
Can anyone please provide me a clue where I am going wrong about this :point_up:?

a.smith
2020-06-08 16:26
@arindam.datta your test failed: ```Test Run Failed. Total tests: 1 Failed: 1``` Do you have any assertions in your test, or just the pact verification?

arindam.datta
2020-06-08 16:27
hi @a.smith, I don't have any assertion. It's just the pact verification `verifier.Verify()` that's it.

arindam.datta
2020-06-08 16:28
However, you can also see, in the log that the interaction is passed (I have only one interaction)

arindam.datta
2020-06-08 16:28
Earlier the log was not complete. Let me give you the complete log.

arindam.datta
2020-06-08 16:29
```2020-06-08T16:06:20.0522439Z Verifying a pact between ConsumerSvc and ProviderSvc [PENDING] 2020-06-08T16:06:20.0523115Z Given Data doesn't exist for user username 2020-06-08T16:06:20.0523416Z A post request with ApiRequest 2020-06-08T16:06:20.0523675Z with POST /api/v1/home 2020-06-08T16:06:20.0523928Z returns a response which 2020-06-08T16:06:20.0524927Z DEBUG: Setting up provider state 'Data doesn't exist for user username' for consumer 'ConsumerSvc' using provider state set up URL http://localhost:9223/provider-states 2020-06-08T16:06:20.0526439Z I, [2020-06-08T16:06:17.783962 #146] INFO -- request: POST http://localhost:9223/provider-states 2020-06-08T16:06:20.0527420Z D, [2020-06-08T16:06:17.784182 #146] DEBUG -- request: User-Agent: "Faraday v0.17.3" 2020-06-08T16:06:20.0528037Z Content-Type: "application/json" 2020-06-08T16:06:20.0528675Z I, [2020-06-08T16:06:17.959905 #146] INFO -- response: Status 200 2020-06-08T16:06:20.0529423Z D, [2020-06-08T16:06:17.960059 #146] DEBUG -- response: connection: "close" 2020-06-08T16:06:20.0529841Z date: "Mon, 08 Jun 2020 16:06:17 GMT" 2020-06-08T16:06:20.0530108Z server: "Kestrel" 2020-06-08T16:06:20.0530564Z transfer-encoding: "chunked" 2020-06-08T16:06:20.0530831Z has status code 200 2020-06-08T16:06:20.0531079Z has a matching body 2020-06-08T16:06:20.0531319Z includes headers 2020-06-08T16:06:20.0531915Z "Content-Type" which equals "application/json; charset=utf-8" 2020-06-08T16:06:20.0532202Z 2020-06-08T16:06:20.0532386Z 1 interaction, 0 failures 2020-06-08T16:06:20.0534537Z /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/verification_results/publish.rb:103:in `publish_verification_results': Error returned from verification results publication 400 {"errors"=>{"provider_version"=>["Version number 'default' cannot be parsed to a version number. The expected format (unless this configuration has been overridden) is a semantic version. eg. 1.3.0 or 2.0.4.rc1"]}} (Pact::Provider::VerificationResults::PublicationError) 2020-06-08T16:06:20.0536655Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/verification_results/publish.rb:35:in `call' 2020-06-08T16:06:20.0537901Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/verification_results/publish.rb:21:in `call' 2020-06-08T16:06:20.0542977Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/verification_results/publish_all.rb:22:in `block in call' 2020-06-08T16:06:20.0544297Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/verification_results/publish_all.rb:19:in `collect' 2020-06-08T16:06:20.0545823Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/verification_results/publish_all.rb:19:in `call' 2020-06-08T16:06:20.0547094Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/verification_results/publish_all.rb:10:in `call' 2020-06-08T16:06:20.0548328Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/rspec/pact_broker_formatter.rb:28:in `close' 2020-06-08T16:06:20.0549557Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:209:in `block in notify' 2020-06-08T16:06:20.0550713Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:208:in `each' 2020-06-08T16:06:20.0552047Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:208:in `notify' 2020-06-08T16:06:20.0553195Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:243:in `close' 2020-06-08T16:06:20.0554349Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:196:in `close_after' 2020-06-08T16:06:20.0555523Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:174:in `finish' 2020-06-08T16:06:20.0556657Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:76:in `report' 2020-06-08T16:06:20.0557836Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:115:in `run_specs' 2020-06-08T16:06:20.0558960Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:89:in `run' 2020-06-08T16:06:20.0560069Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:71:in `run' 2020-06-08T16:06:20.0561244Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:88:in `run_specs' 2020-06-08T16:06:20.0562415Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:34:in `run' 2020-06-08T16:06:20.0563674Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:69:in `run_with_pact_uri_object' 2020-06-08T16:06:20.0564897Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:50:in `run_specs' 2020-06-08T16:06:20.0566268Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:21:in `call' 2020-06-08T16:06:20.0567531Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:13:in `call' 2020-06-08T16:06:20.0568787Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:169:in `verify_pact' 2020-06-08T16:06:20.0570291Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:43:in `block in call' 2020-06-08T16:06:20.0571565Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `collect' 2020-06-08T16:06:20.0572803Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `call' 2020-06-08T16:06:20.0574026Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:34:in `call' 2020-06-08T16:06:20.0575297Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/verify.rb:56:in `verify' 2020-06-08T16:06:20.0576603Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' 2020-06-08T16:06:20.0577746Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' 2020-06-08T16:06:20.0578835Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' 2020-06-08T16:06:20.0579912Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' 2020-06-08T16:06:20.0581110Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' 2020-06-08T16:06:20.0582231Z from /app/tests/ProviderSvc.Tests/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/app/pact-provider-verifier.rb:33:in `<main>' 2020-06-08T16:06:20.0582920Z DEBUG: This pact is still in pending state for ProviderSvc as the successful verification results have not yet been published. 2020-06-08T16:06:20.0583294Z 2020-06-08T16:06:20.0583412Z 2020-06-08T16:06:20.0583611Z 2020-06-08T16:06:20.0583987Z [91mTest Run Failed. 2020-06-08T16:06:20.0584396Z [0mTotal tests: 1 2020-06-08T16:06:20.0584633Z Failed: 1 2020-06-08T16:06:20.0611265Z Total time: 13.6085 Seconds 2020-06-08T16:06:20.6811884Z The command '/bin/sh -c dotnet test "./tests/ProviderSvc.Tests/ProviderSvc.Tests.csproj"' returned a non-zero code: 1 2020-06-08T16:06:20.6955808Z ##[error]The command '/bin/sh -c dotnet test "./tests/ProviderSvc.Tests/ProviderSvc.Tests.csproj"' returned a non-zero code: 1 2020-06-08T16:06:20.6968648Z ##[error]The process '/usr/bin/docker' failed with exit code 1 2020-06-08T16:06:20.6989096Z ##[section]Finishing: Docker Build```

arindam.datta
2020-06-08 16:32
@a.smith I think I found the issue. It could be this: ```1.49.3/lib/pact/provider/verification_results/publish.rb:103:in `publish_verification_results': Error returned from verification results publication 400 {"errors"=>{"provider_version"=>["Version number 'default' cannot be parsed to a version number. The expected format (unless this configuration has been overridden) is a semantic version. eg. 1.3.0 or ``` Seems like some configuration issue when running on CI build. So, the exception might be occurring while trying to publish with "not supported" version format.

matt.fellows
2020-06-08 23:27
If you?re verifying from a Pact Broker and publishing results, that makes sense

matt.fellows
2020-06-08 23:27
Looks like you should update the version property

tjones
2020-06-12 03:10
has joined #pact-net

tritorto
2020-06-15 01:50
Hi there - im keen to start using Pact with some of our serverless, event driven lambdas (AWS sqs event triggers) ... have done a bit of reading on Message Pact, which seems ideal for what we would want to implement, however it seems like this port may not be available for some time in http://Pact.Net. My question is, is there any advice or code samples on handling this scenario in the meantime? One thought i've had is, I could spin up a test web server and wrap our lambda with an api call, but if I can avoid all that extra boilerplate it would be good...

bethskurrie
2020-06-15 01:50
That's actually what happens under the hood.

bethskurrie
2020-06-15 01:51
There was some movement on the message branch - I believe some people are using it successfully already.

tritorto
2020-06-15 01:51
ahh interesting

bethskurrie
2020-06-15 01:51
I think it's mostly tests and refactoring that are outstanding. There's a TODO file on that branch that you can have a look at.

tritorto
2020-06-15 01:52
yea I took a look at the Todo - is there a way to get access to this? ie are they publishing the branch nuget package?

bethskurrie
2020-06-15 01:53
I'm not sure, sorry. I'm not a .net developer, so I don't know how they're doing it.

bethskurrie
2020-06-15 01:53
I'll ping the person who was doing it and find out how.

tritorto
2020-06-15 01:53
cool cool - thank you!!


bethskurrie
2020-06-15 05:58
Thanks @neil :slightly_smiling_face:


michaelphi
2020-06-16 02:40
has joined #pact-net

michaelphi
2020-06-16 02:50
Initially, we cloned the message-pact branch and use the PactNet project directly into our tests. Later on, we wanted to ensure that all test projects used the exact same version of PactNet, so we published it as a nuget package and shared it with all the test projects. We followed the instructions from https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package#create-the-nuspec-file to build a nukpg based off a nuspec file. Neil's method is probably the simplest, so I would go with that approach first

tritorto
2020-06-16 07:34
Thanks for the updates

alexandre.cuva
2020-06-18 12:59
has joined #pact-net

baquinteros
2020-06-19 03:17
has joined #pact-net

baquinteros
2020-06-19 03:23
Hi there, When pulling from the broker and verifying on the provider side. Are the ServiceProvider/HonoursPactWith supposed to filter the contracts verified? pactVerifier .ServiceProvider("ProviderService", ServiceUri) .HonoursPactWith("ConsumerService") .PactBroker(PactBrokerUri, uriOptions: new PactUriOptions(PactBrokerUsername, PactBrokerPassword)) I have added a new ConsumerService2 contract for the ProviderService in the broker and it seems to be pulling/verifying that contract as well? PactNet 2.5.4 PactBroker https://hub.docker.com/layers/pactfoundation/pact-broker/2.57.0.0/images/sha256-b2c82e7533631074fbfc13f162d7ee3b474186f4cf1d26b28bfca2d3b11a1264?context=explore

bethskurrie
2020-06-19 03:24
if you give it broker credentials, it will pull all hte contracts

bethskurrie
2020-06-19 03:24
if you want to verify one contract, give it the direct URL

bethskurrie
2020-06-19 03:25
the HonoursPactWith is not meant to be used in conjuction with PactBroker

bethskurrie
2020-06-19 03:25
you can raise an issue to get those docs clarified

baquinteros
2020-06-19 03:27
Thanks for the fast response

bethskurrie
2020-06-19 03:27
We

bethskurrie
2020-06-19 03:27
We're fast when we're awake!

bethskurrie
2020-06-19 03:27
Most of the time everyone in Australia is going to bed or asleep when the questions get asked

matt.fellows
2020-06-19 05:08
At least Ben is one of the people in our TZ!

matt.fellows
2020-06-19 05:08
glad to see you guys moving ahead with it all despite COVID challenges

sklein
2020-06-19 19:35
has joined #pact-net

nouri.tawfik
2020-06-20 08:34
has joined #pact-net

nouri.tawfik
2020-06-26 13:50
Hello pact Team, Could you please help me to enable wip feature? The wip feature it's ready for. Net library, any additional configuration? Thanks

nouri.tawfik
2020-06-26 17:25
It seems my pact broker use old version It's working right now. Thanks.

alexandre.cuva
2020-06-27 07:19
I have a full example under .Net Core 3.1, with extra stuff like using TestServer. We could use it?

alexandre.cuva
2020-07-10 11:48
Hi PactNet team, where can I found a doc on how to contribute? I have an example on Net 3.1 with TestServer to push

bethskurrie
2020-07-10 20:33
Awesome @alexandre.cuva. Thanks! If you want to put it in the examples directory of the Pact net repository, just open a PR.

bethskurrie
2020-07-10 20:34
If you want to keep it in a separate repository, you could transfer the repo to pact-foundation organisation (you get to keep admin rights).

a.smith
2020-07-15 15:12
Hi :wave: I'd like to lend a hand with development of PactNet. I'm particularly interested in moving the library over to the Rust standalone per the https://github.com/pact-foundation/pact-specification#how-to-get-started-writing-a-pact-implementation. Would this work be useful? Is there somewhere better I can focus my energy? (I'm not keen to add another cook to the group working on the Pact 3 / MessagePact branch...)

uglyog
2020-07-15 23:08
I don't think anyone has started looking at integrating the V3 libs into PactNet yet. That would be awesome.

neil
2020-07-16 01:52
I think moving over to the rust standalone would be a massive win.

matt.fellows
2020-07-16 04:42
This would he awesome. Let us know how we can support you

a.smith
2020-07-16 10:01
The questions that immediately come to mind are: ? Has any spike work been done on this already? (Sounds like a 'no' from @uglyog) ? What is the appetite for making breaking changes in the library? (Some were made for Pact v2.) ? What documentation is there around writing implementations over it? Are there any examples of implementations using it? (I've found https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_mock_server_ffi on the Rust binaries/FFI themselves.)

matt.fellows
2020-07-16 10:15
I think breaking changes are worth tabling, particularly if they improve the situation. Obviously it would be ideal not to

matt.fellows
2020-07-16 10:15
As for implementing, JS technically does but not in the way it'll likely he done for .NET

matt.fellows
2020-07-16 10:16
I'm currently doing it for go and can share my experience

matt.fellows
2020-07-16 10:16
Actually, C++ could be used as a basis also (consumer only)

a.smith
2020-07-16 10:58
Cool, thanks @matt.fellows. A useful starting point would be pointers on how to consume the Rust binaries from Bintray (if that's the appropriate source)

matt.fellows
2020-07-16 11:49
I haven't gotten to the distribution bit yet, but it's either that or a GitHub release artifact

krisdinesh
2020-07-21 22:49
has joined #pact-net

krisdinesh
2020-07-21 22:54
@all - looking for pactnet matcher, current doc shows the example in ruby. Could you please share any example on the matcher using pactnet

matt.fellows
2020-07-22 00:23
Ruby? Are you referring to http://docs.pact.io? Best to look at the Pact .NET github repo directly


matt.fellows
2020-07-22 00:23
Those samples are .NET matchers

krisdinesh
2020-07-22 03:08
Thanks a lot Matt and I am looking exactly the same.... :pray:

krisdinesh
2020-07-22 22:52
There is variable in api response "modifierName: "Krisdinesh". This variable sometimes comes as string and sometimes it NULL. How to handle this in matcher like OR condition and also I would like to know if you want to ignore some specific variable during provider test comparison


matt.fellows
2020-07-23 00:04
TL;DR - write two tests. One for when it is mandatory and one for when you don?t need it (or if it must be null)

krisdinesh
2020-07-23 13:39
Thanks Matt, this makes sense but I can't predict when it is going to be NULL to have separate test.

lewis.thorley
2020-07-24 07:09


matt.fellows
2020-07-24 07:24
TL;DR - not yet. Albeit some people here had luck running the WIP branch

a.smith
2020-07-29 16:04
:point_up: I created this for info, and to link to the more detailed planning I'm doing

krisdinesh
2020-07-29 16:53
Hello All - When I am running my pact test within docker container, I am getting error like "_Error Message:_   _System.AggregateException : One or more errors occurred. (One or more errors occurred. (Address not available))"_. Below is the full log. Please provide some input to get over this issue. I am able to run the test in mac and windows without any problem ``` X ContractTesting.Tests.ConsumerPactTest.GetBenchmarksByProgramIdTrue_VerifyIfItReturns [1ms] Error Message: System.AggregateException : One or more errors occurred. (One or more errors occurred. (Address not available)) (The following constructor parameters did not have matching fixture data: ConsumerPact data) ---- System.AggregateException : One or more errors occurred. (Address not available) -------- System.Net.Http.HttpRequestException : Address not available ------------ System.Net.Sockets.SocketException : Address not available ---- The following constructor parameters did not have matching fixture data: ConsumerPact data Stack Trace: ----- Inner Stack Trace #1 (System.AggregateException) ----- at PactNet.Mocks.MockHttpService.Host.RubyHttpHost.Start() at PactNet.Mocks.MockHttpService.MockProviderService.Start() at PactNet.PactBuilder.MockService(Int32 port, JsonSerializerSettings jsonSerializerSettings, Boolean enableSsl, IPAddress host, String sslCert, String sslKey) at PactNet.PactBuilder.MockService(Int32 port, Boolean enableSsl, IPAddress host, String sslCert, String sslKey) at ContractTesting.Consumer.ConsumerPact..ctor() in /asc-lms-rptp-api/ContractTesting/Consumer/ConsumerPact.cs:line 31 ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) ----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----```

krisdinesh
2020-07-29 23:07
RESOLVED: once i changed the docker image from _*http://mcr.microsoft.com/dotnet/core/sdk:3.1-alpine*_ to http://mcr.microsoft.com/dotnet/core/sdk:3.1 it worked. But I am not sure why it didnt work with alpine though


matt.fellows
2020-07-29 23:55
Alpine is a very lean image and doesn?t have all of the necessary libraries for Pact to work. You can add the packages though and you should be right

uglyog
2020-07-30 00:14
Alpine also doesn't have a full libc, it is based on musl and busybox

krisdinesh
2020-07-30 00:53
Got it, thanks!!

francis.lobo
2020-08-04 22:48
has joined #pact-net

jacques.murekezi
2020-08-07 11:09
has joined #pact-net

bret.mcclory
2020-08-11 19:02
has joined #pact-net

jack.middleton
2020-08-18 09:48
Hey - Is anyone able to help me understand what the best practice is for setting the value of `PactVerifierConfig.ProviderVersion`? (This is set to `build_number` in the example shown here: https://github.com/pact-foundation/pact-net#publishing-provider-verification-results-to-a-broker) Should this `build_number` be the git SHA as described here: https://docs.pact.io/pact_broker/pacticipant_version_numbers or should I just use the build number from in my pipeline? Maybe it makes sense to use {branch_name}+{build_number} so I end up with something like `feature/123-pact-update+a86579910`

jack.middleton
2020-08-18 09:57
I think I might have found the answer here: https://docs.pact.io/getting_started/versioning_in_the_pact_broker I think I will use `{build_number}+{gitCommitSHA}`

matt.fellows
2020-08-18 10:52
Yep

matt.fellows
2020-08-18 10:52
I tend to use both

jack.middleton
2020-08-18 10:54
Great, thanks for confirming. I've been toying with the idea of using branch name in addition/instead of build number, but I can track back to branches using build number

matt.fellows
2020-08-18 11:00
you could add those in too - it?s really whatever works for you, but importantly, you want each commit to produce a new version so git sha is always a good one

parveensultanauk
2020-08-24 11:33
has joined #pact-net

heytaco
2020-08-25 03:57
has joined #pact-net

heytaco
2020-08-25 03:57
Hi there! My name is HeyTaco!, and you can use me to give people tacos to show your appreciation. My tacos will spread joy through Slack!

jack.middleton
2020-08-25 08:43
Hey all, I am attempting to achieve Pact Nirvana but need some advise/help. In the https://docs.pact.io/pact_nirvana/step_4/#e-configure-pact-to-be-verified-when-contract-changes (E. 1.) it says you should pass the Pact URL to the verification step. My questions are: 1. Can someone confirm the verification step is referring to this: https://github.com/pact-foundation/pact-net#publishing-provider-verification-results-to-a-broker 2. If 1) is correct, I guess then we pass the Pact URL from the webhook into `.PactUri()` . In that case, should the `HonoursPactWith("Consumer")` "Consumer" string match the consumer name that is in the URL that is passed in? I am struggling to understand what `HonoursPactWith` does if you are passing in the whole Pact, which includes the consumer name Does this make sense?

matt.fellows
2020-08-25 10:44
Hi Jack!

matt.fellows
2020-08-25 10:45
That?s correct

matt.fellows
2020-08-25 10:47
Don?t specify the ?honourspactwith? because that should be dynamic. See https://github.com/pactflow/example-provider-dotnet/blob/master/tests/ProviderApiTests.cs#L56-L71

matt.fellows
2020-08-25 10:49
> struggling to understand what `HonoursPactWith` does if you are passing in the whole Pact, which includes the consumer name understandable. It?s basically _not_ required if using a broker / Pactflow (because that will dynamically work all of that out)

jack.middleton
2020-08-25 12:18
Legend, thanks Matt. That clears this part of my journey up! Can't believe I missed that example...

matt.fellows
2020-08-25 13:10
It's not in our docs yet. Next week or so I'll have them all in there somewhere

jack.middleton
2020-08-25 16:41
I can't tell you how much that example has simplified my approach. I had been doing all sorts of work arounds and slightly "hacky" things. E.g.: I had two tests on the provider side, one for the Webhook approach and one for the Standard flow. This was also partly due to being based upon an old project I did which was using old version of Pact which didn't have `pactVerifier.PactBroker()`... Anyway, thanks again. Huge help today.

matt.fellows
2020-08-25 23:37
I?m glad! And sorry it wasn?t more obvious/available to you

andy.furnival
2020-08-26 16:51
has joined #pact-net

bethskurrie
2020-08-30 07:11
I've just moved the pact-net docs into http://docs.pact.io @jack.middleton

bethskurrie
2020-08-30 07:12
Though, it doesn't yet have the example that Matt's talking about.

rasih.caglayan
2020-09-01 00:34
has joined #pact-net

jack.middleton
2020-09-01 06:59
Ah great, thanks for the info, Beth

carlos.silva
2020-09-02 15:01
has joined #pact-net

carlos.silva
2020-09-02 15:06
Hi Guys, I'm Carlos and I'm an architect at LexisNexis. We are particular interested in http://PACT.NET and also in extending pact capabilities in order to fulfill our needs. If possible we would prefer to contribute to PACT instead of just fork it and make it to work for us. Happy to help.

lewis.prescott
2020-09-03 12:49
has joined #pact-net

siddharth.gupta
2020-09-04 06:03
I am socializing Pact testing in my organization . One of the architect from consumer team had a question , how do we handle jwt authorization token when calling provider APIs. How will consumer generate pact with token \ how will provider handle this in their tests .

matt.fellows
2020-09-04 06:15
(for anybody else answering, let?s keep in in this thread https://pact-foundation.slack.com/archives/C9VPNUJR2/p1599199532022300)

christian.johann.eder
2020-09-10 13:45
Hi @matt.fellows you wrote on twitter that you?d like to talk about my blog regarding hosting api mocks on azure functions

matt.fellows
2020-09-12 23:24
Nice work on the impact library! Are you able to elaborate more on its goals and how you see it fitting in with the pact ecosystem?

matt.fellows
2020-09-12 23:26
If I understand correctly, it is essentially a pact NET replacement? Or at the least, it will generate pact compatible contracts. I couldn't tell from the readme if it integrated with the pact broker natively, particularly on the provider side? I wondered if you'd be open to collaborating with us to align it with our roadmap going forward and also find at least another maintainer? Without trying to be negative, we often see tools like this created only for them to stop being supported which creates a challenge for the community. Of course the flipside is that we need things like this to drive innovation and push the ecosystem forward

matt.fellows
2020-09-12 23:31
Was there a reason you didn't look to contribute the the .NET port? We are actively seeking help to uplift it

matt.fellows
2020-09-12 23:35
Alternatively, could this be a replacement for the .net library and we look to bring it in as the officially supported one?

matt.fellows
2020-09-12 23:35
Cc @bethskurrie @uglyog @neil

matt.fellows
2020-09-12 23:35
(I'm on a mobile so there are plenty of other thoughts I'd like to add here)

yann.courtel
2020-09-23 07:08
has joined #pact-net


siddharth.gupta
2020-09-29 06:42
Hi All, I was trying to fail the provider tets by modifying the actual response provider sends vs that expected in Contract .Attached is the contract json from consumer tests and following is the provider response .

siddharth.gupta
2020-09-29 06:43
here is the Provider verification result

siddharth.gupta
2020-09-29 06:43
I am modifying the attribute "eventType" in response , but stiil test is passing . Does it has to do with match type "$.body.eventType": {             "match": "type"           }, in the contract

matt.fellows
2020-09-29 06:50
Exactly. So you are currently matching on the ?type?, which in your case, means any string value for the key `eventType` will make the test pass.

matt.fellows
2020-09-29 06:51
Option 1: don?t use a type matcher in the consumer test (match exact event type, or a regex) Option 2: rename the property or something, so that the key itself won?t match (e.g. rename it to ?type? or something)

collin.johnson
2020-09-29 13:58
has joined #pact-net

nazar.khmil
2020-10-05 10:34
has joined #pact-net

xandebianchi
2020-10-05 13:05
has joined #pact-net

dorin.enache
2020-10-05 15:01
has joined #pact-net

michael_james
2020-10-06 10:01
has joined #pact-net

ledinhcuong99
2020-10-06 12:53
has joined #pact-net

dothetan.040490
2020-10-07 09:14
has joined #pact-net

dagostino.remy
2020-10-07 23:03
has joined #pact-net

abhi.nandan
2020-10-08 06:38
has joined #pact-net

przemyslaw.dabrowski
2020-10-08 12:36
has joined #pact-net

emiliano.righi
2020-10-08 13:25
has joined #pact-net

cariaga.bh
2020-10-08 21:03
has joined #pact-net

campellcl
2020-10-09 00:06
has joined #pact-net

elenitsaa043
2020-10-09 10:00
has joined #pact-net

adriangabrieloros
2020-10-09 11:05
has joined #pact-net

sh.ilgam_pact
2020-10-11 16:12
has joined #pact-net

yann.courtel
2020-10-12 09:29
Hi everyone! Has anyone tried to set up a PACT between two APIs that were using messaging such as Kafka queue? I ran into this article yesterday but only available in the java specifications. https://stackoverflow.com/questions/44884316/how-to-implement-contract-testing-when-kafka-is-involved-in-microservice-archite Thanks a lot.

anastasiia.bielik
2020-10-12 11:13
has joined #pact-net

deepika.krishnakumar
2020-10-12 15:03
has joined #pact-net

anbansal27
2020-10-12 23:02
has joined #pact-net

anbansal27
2020-10-13 00:27
Hi Team, I am currently looking out for a solution to integration test event driven systems using RabbitMq as the messaging platform. Does http://Pact.Net support it ? If yes, please could you help me with links to some resources ?

matt.fellows
2020-10-13 00:48
Maybe have a little search of this channel first Ankit, there are definitely some posts on it. Have a read of those first, and then come back with any specific questions

prabhakar.thippa
2020-10-13 04:58
has joined #pact-net

giadinhluong
2020-10-13 06:24
has joined #pact-net

pavank
2020-10-13 08:41
has joined #pact-net

stephane.meng
2020-10-13 09:06
has joined #pact-net

abirlal.bose
2020-10-13 09:45
has joined #pact-net

mateusz.mrzyglod
2020-10-14 09:32
has joined #pact-net

cathleen.yuan
2020-10-14 11:16
has joined #pact-net

ramana.jaladurgam
2020-10-14 16:10
has joined #pact-net

alik.berezovsky
2020-10-14 18:38
has joined #pact-net

a.robecke
2020-10-14 19:24
has joined #pact-net

mikahchapman
2020-10-14 21:47
has joined #pact-net

hem_kec
2020-10-15 00:44
has joined #pact-net

dothetan.040490
2020-10-15 02:22
@dothetan.040490 has left the channel

marco.cordeiro
2020-10-15 10:54
has joined #pact-net

betty.he
2020-10-15 14:32
has joined #pact-net

tamer
2020-10-16 09:08
has joined #pact-net

mario.gioiosa
2020-10-16 18:57
has joined #pact-net

alik.berezovsky
2020-10-18 17:58
@alik.berezovsky has left the channel

lior.baber
2020-10-19 07:33
has joined #pact-net

jeffbdye
2020-10-19 17:10
has joined #pact-net

jace
2020-10-19 19:22
has joined #pact-net

almaak
2020-10-20 09:35
has joined #pact-net

andra.moraru
2020-10-20 14:13
has joined #pact-net

camila.coder91
2020-10-20 17:06
has joined #pact-net

julzelements
2020-10-21 05:25
has joined #pact-net

kapil.mathur
2020-10-21 06:40
has joined #pact-net

mark.hudson
2020-10-21 10:45
has joined #pact-net

cluu
2020-10-21 17:16
has joined #pact-net

camila.campos
2020-10-21 21:35
has joined #pact-net

longlevan
2020-10-22 09:15
has joined #pact-net

justin.garfield
2020-10-22 16:15
has joined #pact-net

guppy0356.nakira
2020-10-23 00:34
has joined #pact-net

ercalbwar
2020-10-24 19:24
has joined #pact-net

andrewshtamburg
2020-10-25 13:04
has joined #pact-net

siad.ardroumli
2020-10-25 18:16
has joined #pact-net

srikanthpmailid
2020-10-26 01:02
has joined #pact-net

yann.courtel
2020-10-26 09:15
Hi everyone, I was wondering about a known issue we are having about sending form/multipart in requests. After investigation, we realized it was because of the windows' path limitation (246 characters) and as of right now, there is nothing we can do. Has anyone run into this issue recently? Thanks a lot.

matt.fellows
2020-10-26 10:35
Does this relate to the multi-part form upload? That problem is usually about invoking the underlying matching engine


photesthesis_geospiza
2020-10-26 15:10
has joined #pact-net

jackbwheatley
2020-10-27 21:02
has joined #pact-net

carlosalmeida.xon
2020-10-27 22:06
has joined #pact-net

nasir.amin
2020-10-28 11:07
has joined #pact-net

jimish.shah.-nd
2020-10-28 11:26
has joined #pact-net

adam_figgins
2020-10-28 14:20
has joined #pact-net

dale.bennett
2020-10-28 14:34
has joined #pact-net

aperdomobo
2020-10-28 15:42
has joined #pact-net

diazguerra2
2020-10-28 16:06
has joined #pact-net

xsamore
2020-10-28 19:52
has joined #pact-net

simon
2020-10-28 20:49
has joined #pact-net

ruben.cagnie
2020-10-29 01:24
has joined #pact-net

272939217
2020-10-29 05:33
has joined #pact-net

driloni92
2020-10-29 09:05
has joined #pact-net

pauloavra
2020-10-29 12:33
has joined #pact-net

jikogay728
2020-10-30 17:20
has joined #pact-net

blmlcu
2020-10-31 14:51
has joined #pact-net

jamescourtoy
2020-11-02 21:04
has joined #pact-net

telmo.ferreira.costa
2020-11-03 11:32
has joined #pact-net

sergii.kopovskyi
2020-11-03 12:35
has joined #pact-net

dikili
2020-11-03 16:41
I do have a question to seek help pls, I have 5 consumer tests and have a mockclient implementation in c# .net , when I run all tests at once only 1 of the tests pass others fail, however if i create a new instance of ConsumerPact class file which has the configurations and assign a new port each time when a new test calls it.. This makes all the tests pass but then when I check the contract file generated it only have 1 interaction of all the tests run so contract file is missing data.. What do you think I should do here ?

dikili
2020-11-03 16:49
I am using NUnit project and not XUnit by the way

dikili
2020-11-03 17:42
I have realized the pactBuilder.Build is called for each test which was causing the above so no need to worry about any longer for above ,fyi Thanks

silverton.gimenes
2020-11-03 17:58
has joined #pact-net

colber16
2020-11-03 18:34
has joined #pact-net

cvoong
2020-11-03 18:55
has joined #pact-net

cvoong
2020-11-03 19:07
Hi, does anyone have any examples of Pact tests in .NET which test Kafka Messages?

matt.fellows
2020-11-04 05:13
> Hi, does anyone have any examples of Pact tests in .NET which test Kafka Messages? The current version of Pact .NET doesn?t fully support what we call message pact, which is how we deal with things like Kafka

matt.fellows
2020-11-04 05:14
there _is_ a beta branch that I think you can use (see above in this channel if the history goes that far back, or the issues on the GH repo)

matt.fellows
2020-11-04 05:14
Do you need it for consumer or provider side (or both)? If provider only, I may have a way for you

cvoong
2020-11-04 08:34
Thanks for the info, we need it for the consumer only at the moment. Is that available in the beta brance?

matt.fellows
2020-11-04 20:38
I think it is, I'd review that branch/issue on the repo and see how you go

cvoong
2020-11-05 09:31
we've decided to park it for now. Do you know roughly when that work is going to get merged in? Not to chase - just curious.

dikili
2020-11-05 10:21
hello all, I am working on a consumer test and get an error "No Interaction found for GET /jobs/12314/anonymous ...." , this is a consumer test thus not hitting the actual endpoint

dikili
2020-11-05 10:23
I ensured that _mockProviderService.Given("xxxx") .UponReceiving("yyyy") xxxx and yyyy is unique in the test file, so I am not really understanding why I am getting this error and how to fix this , Is ensuring this to be unique not enough and am i missing something with this ?

dikili
2020-11-05 10:23
I would appreciate your helps @here

dikili
2020-11-05 18:02
Also when I delete the pact file which has 5 interactions and run only one of the consumer tests, 5 of the interactions still created in the newly created pact contract json file locally although the test that was run has only 1 interaction, not sure how did all 5 is restored back when i only run 1 test, I would also really like to understand this which i am lost

matt.fellows
2020-11-06 00:55
fair enough, I don?t I?m sorry - might be worth popping your hand up on that issue/PR to check in?

matt.fellows
2020-11-06 00:56
please share your code @dikili, it?s hard to know what you?re asking I?m afraid

dikili
2020-11-06 12:35
hello @matt.fellows thanks for the feedback.. pls see the set of consumer tests...

dikili
2020-11-06 12:35
as you can see there are 5 tests in the file... and they execute, however when i check the uploaded pact file to the broker

dikili
2020-11-06 12:37
I see 9 interactions

dikili
2020-11-06 12:37
which i believe is an issue...

dikili
2020-11-06 12:39
when I was developing the cons. tests I have changed the wordings on the description and providerState section on the tests.. this might have caused this I believe ? is this an issue and how can i ensure I can start fresh and instead get 5 interactions I desire to get pls ? Pls feel free to add any suggestions for improvements that I could also make

dikili
2020-11-06 12:40
pls note that in the tear down of this tests, i already call _mockProviderService.ClearInteractions(); so I was thinking it would help me reset it but I am not sure from where it is picking up all 9 interactions as in the screenshot ?

dikili
2020-11-06 12:40
hope this is much clarified question now, and sorry for the confusion

dikili
2020-11-06 12:48
And when the provider test run... execution failure log is as attached...

dikili
2020-11-06 12:49
so I want to get these tests work end to end.. with provider tests passing.. pls feel free to advice what I might be getting wrong here ? @matt.fellows @here

dikili
2020-11-06 17:01
W.r.t my above msg.. I have somehow managed to drop the # of interactions in the composed pact contract file down to two... when I run the provider test I see the below failure as in the file attached.. two interactions only and out of two 1 of the interaction fails , however when I do the actual call on postman with same headers etc.. it is working fine.. I am on the VPN as well and it is being done through pactflow.. here is the log of that failing one test.. i would also appreciate if you can help me understand how I can manage to fix it ? logs attached:

dikili
2020-11-06 17:02
In the last log file , it is clear that I get status code 308 , which is not something i get on the postman though

dikili
2020-11-06 17:03
:thinking_face:

pbobba
2020-11-09 23:03
has joined #pact-net

jun.li
2020-11-09 23:05
has joined #pact-net

douweicai
2020-11-10 04:11
has joined #pact-net

douweicai
2020-11-10 04:16
Hi there, I am new to pact and .net. I want to download the basic pact demo and install it to visual studio. Please send out the link and detail instruction to install and run it? @matt.fellows

matt.fellows
2020-11-10 06:08
Here are the examples I think you?re referring to: 1. https://docs.pactflow.io/docs/examples/dotnet/consumer/readme 2. https://docs.pactflow.io/docs/examples/dotnet/provider/readme (they are based on this workshop: https://github.com/pactflow/pact-workshop-dotnet-core-v1) If you export the following two environment variables in the shell you execute things from, you should be able to go: ```export PACT_BROKER_TOKEN=<your pactflow token here> export PACT_BROKER_BASE_URL=https://<your pactflow subdomain>.http://pactflow.io``` you can then run: ```make restore make test # to just run the tests, or make fake_ci # emulates a CI build``` From either code base

christian.huber
2020-11-10 09:20
has joined #pact-net

vuttithatkrongyot
2020-11-10 10:57
has joined #pact-net

dan.iosif
2020-11-10 17:06
has joined #pact-net

douweicai
2020-11-11 00:19
Thanks! I will look at it tonight to see whether I can set up and slack you for any quetions. @matt.fellows

douweicai
2020-11-11 05:31
@matt.fellows Matt, I manually import the project to visual studio using the zip file from the link you provided (it taking me a lot of time). I am new to visual studio,.net and mac . I was mainly using java before. Can we set up half hour demo tomorrow, you can help me walk through the code and run it locally to help me speed up?

douweicai
2020-11-11 05:37
I am getting compile error for using Newtonsoft.Json and JsonConvert, and others. I am stuck on the environment

matt.fellows
2020-11-11 23:20
Hi Wei!

matt.fellows
2020-11-11 23:21
So from the outset, I?ll be honest I cannot help you at all with Visual Studio - I don?t have it installed and have never used it!

matt.fellows
2020-11-11 23:21
Second point - I also don?t know .NET any more than enough to make that demo work :slightly_smiling_face:

matt.fellows
2020-11-11 23:22
I have .NET 3.1.201 installed. You can install it from here: https://docs.microsoft.com/en-us/dotnet/core/install/macos

matt.fellows
2020-11-11 23:23
```make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin11.3.0```

matt.fellows
2020-11-11 23:23
I don?t think you?ll need the same version of Make, but I have the default version of make that comes with OSX

matt.fellows
2020-11-11 23:24
I have Visual Studio Code (not visual studio) installed, and I have the following extension to help with code navigation and syntax highlighting

matt.fellows
2020-11-11 23:24
I don?t run any commands from within the IDE, I use my terminal

matt.fellows
2020-11-11 23:25
```make restore make test```

douweicai
2020-11-11 23:29
what is the token I need to export?


matt.fellows
2020-11-11 23:30
FYI I?ve just added these notes to those readme?s

douweicai
2020-11-11 23:31
I just install VS code and set it up

douweicai
2020-11-11 23:32
are you going to join?

matt.fellows
2020-11-11 23:33
join what, sorry?

matt.fellows
2020-11-11 23:33
Oh, you?ve booked me for tomorrow!

matt.fellows
2020-11-11 23:33
I can do now quickly

douweicai
2020-11-11 23:34
cool

rodrigo.costa20
2020-11-12 00:59
has joined #pact-net

yong.gong188
2020-11-12 09:13
has joined #pact-net

anandhadeepak
2020-11-12 13:03
has joined #pact-net

david.dias
2020-11-12 20:04
has joined #pact-net

billal.patel
2020-11-13 10:31
has joined #pact-net

billal.patel
2020-11-13 10:42
@billal.patel has left the channel

dikili
2020-11-13 16:42
@here are there any built in matchers for .net ?

dikili
2020-11-13 16:42
i.e how do i use Pact.like( name: "Mary", age: 73) something like this in the .net world when creating the test ?


wesleythomaswilliams
2020-11-14 22:54
has joined #pact-net

douweicai
2020-11-16 00:36
@here, I made the code change to comment out type from product code to test the breaking change (using the pact consumer/provider sample code for .net), after that, I ran the provider, it failed as following, it is expected? After that, I changed it back to add the type (just as the original code), however, I still getting the same error. Can you help to take a look? [2:24 PM] erifying a pact between pactflow-example-consumer-dotnet and pactflow-example-provider-dotnet Given products exist A request to get products with GET /products returns a response which has a matching body      Failure/Error: expect(response_body).to match_term expected_response_body, diff_options, example        Actual:        Diff        --------------------------------------        Key: - is expected             + is actual        Matching keys and values are not shown        -[        -  {        -    "id": "27",        -    "name": "burger",        -    "type": "food"        -  },        -]        Description of differences        --------------------------------------        * Expected an Array but got a String ("") at $   3) Verifying a pact between pactflow-example-consumer-dotnet and pactflow-example-provider-dotnet Given products exist A request to get products with GET /products returns a response which includes headers "Content-Type" which equals "application/json; charset=utf-8"      Failure/Error: expect(header_value).to match_header(name, expected_header_value)        Expected header "Content-Type" to equal "application/json; charset=utf-8", but was nil 1 interaction, 1 failure Failed interactions: To re-run just this failing interaction, change the verify method to '.Verify(description: "A request to get products", providerState: "products exist")'. Please do not check in this change! # A request to get products given products exist INFO: Verification results published to https://avalara.pactflow.io/pacts/provider/pactflow-example-provider-dotnet/consumer/pactflow-example-consumer-dotnet/pact-version/ae47e9fed1b12954ff5306fa24bd758cdc1e8346/verification-results/216 [http://xUnit.net 00:00:04.9152740]     tests.ProviderApiTests.EnsureProviderApiHonoursPactWithConsumer [FAIL]   X tests.ProviderApiTests.EnsureProviderApiHonoursPactWithConsumer [4s 133ms]   Error Message:    PactNet.PactFailureException : Pact verification failed. See output for details. If the output is empty please provide a custom config.Outputters (IOutput) for your test framework, as we couldn't write to the console.   Stack Trace:      at PactNet.Core.PactCoreHost`1.Start()    at PactNet.PactVerifier.Verify(String description, String providerState)    at tests.ProviderApiTests.EnsureProviderApiHonoursPactWithConsumer() in /Users/wendy.dou/Projects/example-provider/tests/ProviderApiTests.cs:line 73 Test Run Failed. Total tests: 1      Failed: 1  Total time: 5.4693 Seconds /usr/local/share/dotnet/sdk/3.1.403/Microsoft.TestPlatform.targets(32,5): error MSB4181: The "Microsoft.TestPlatform.Build.Tasks.VSTestTask" task returned false but did not log an error. [/Users/wendy.dou/Projects/example-provider/tests/tests.csproj] make[1]: *** [test] Error 1 make: *** [fake_ci] Error 2

bethskurrie
2020-11-16 00:38
`Actual:`

matt.fellows
2020-11-16 00:38
Could you please share the whole terminal log? As mentioned before, I think your provider isn?t running or is returning a `500` error

bethskurrie
2020-11-16 00:38
You have an empty response body

douweicai
2020-11-16 00:56
it is too long, cannot send. let me split

matt.fellows
2020-11-16 00:58
You can always upload a file instead of copying here

matt.fellows
2020-11-16 00:58
that will be easier to look at

louis.oliver
2020-11-16 10:33
has joined #pact-net

louis.oliver
2020-11-16 11:03
Would be interested in the outcome of Pact + Kafka myself in .net

ashishkujoy
2020-11-16 15:08
has joined #pact-net

douweicai
2020-11-16 18:02
@matt.fellows after restart my machine, and ran it again, I got the connection refused error below:

douweicai
2020-11-16 18:02
Verifying a pact between pactflow-example-consumer-dotnet and pactflow-example-provider-dotnet Given products exist A request to get products with GET /products returns a response which has a matching body    Failure/Error: replay_interaction interaction, options[:request_customizer]    Errno::ECONNREFUSED:     Connection refused - connect(2) for "localhost" port 9000  3) Verifying a pact between pactflow-example-consumer-dotnet and pactflow-example-provider-dotnet Given products exist A request to get products with GET /products returns a response which includes headers "Content-Type" which equals "application/json; charset=utf-8"    Failure/Error: replay_interaction interaction, options[:request_customizer]    Errno::ECONNREFUSED:     Connection refused - connect(2) for "localhost" port 9000 1 interaction, 1 failure

douweicai
2020-11-16 18:04
Any idea how to fix the refused connection?

douweicai
2020-11-16 19:43
this issue is fixed.

douweicai
2020-11-16 19:46
however, I am running the issue when try to change it back. For example, I comment type in product, then run the provide code, it breaks expected. then I try to change it back by uncommenting it, then run the provider code, however, it keep giving me the same error message, it looks it still use the old code.

douweicai
2020-11-16 19:47
here is the error: Failure/Error: expect(response_body).to match_term expected_response_body, diff_options, example     Actual: [{"type":null,"name":"pancake","id":"1","version":"1.0.0"},{"type":null,"name":"sanwhich","id":"2","version":"1.0.0"}]     Diff     --------------------------------------     Key: - is expected        + is actual      Matching keys and values are not shown     [      {     -  "type": String     +  "type": NilClass      },      {     -  "type": String     +  "type": NilClass

douweicai
2020-11-16 19:52
it is something in your pact broker side to have this old information?

matt.fellows
2020-11-16 23:36
Is your code available for review online?

matt.fellows
2020-11-16 23:36
```date: "Sun, 15 Nov 2020 20:37:18 GMT" server: "Kestrel" transfer-encoding: "chunked" fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HM493D70GSK0", Request id "0HM493D70GSK0:00000001": An unhandled exception was thrown by the application. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. [/Users/wendy.dou/Projects/example-provider/src/bin/Debug/netcoreapp3.1/provider.dll] The metadata is corrupt. Invalid assembly public key. (0x8013141E) Failure has occurred while loading a type. [/Users/wendy.dou/Projects/example-provider/src/bin/Debug/netcoreapp3.1/provider.dll] The metadata is corrupt. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeAssembly.get_DefinedTypes() at Microsoft.AspNetCore.Mvc.ApplicationParts.AssemblyPart.get_Types() at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable`1 parts, ControllerFeature feature) at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature) at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes() at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors() at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection() at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize() at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.get_ActionDescriptors() at Microsoft.AspNetCore.Mvc.Routing.AttributeRoute.GetTreeRouter() at Microsoft.AspNetCore.Mvc.Routing.AttributeRoute.RouteAsync(RouteContext context) at Microsoft.AspNetCore.Routing.RouteCollection.RouteAsync(RouteContext context) at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) System.BadImageFormatException: [/Users/wendy.dou/Projects/example-provider/src/bin/Debug/netcoreapp3.1/provider.dll] The metadata is corrupt. System.Security.SecurityException: Invalid assembly public key. (0x8013141E) System.TypeLoadException: Failure has occurred while loading a type.```

matt.fellows
2020-11-16 23:36
That looks like you?ve made a code change that?s not workable, so the app server is failing

matt.fellows
2020-11-16 23:36
I suspect you?ve removed/added a field in one place, but not made the appropriate changes elsewhere, so the server is unable to correctly run

matt.fellows
2020-11-16 23:37
> it is something in your pact broker side to have this old information? the pact broker simply maintains the contract itself, it doesn?t talk to the provider directly. That all happens locally

douweicai
2020-11-17 00:13
@matt.fellows the only change I made is to comment out "type" attribute inside product, then failed (which is expected), then uncomment out, it will always fail (something wrong here). Can you reproduce on your end?

douweicai
2020-11-17 00:18
In addition, can you send me the link where I publish the pact?


matt.fellows
2020-11-17 00:19
so if I remove the `type` property I get this expected failure: ``` 1) Verifying a pact between pactflow-example-consumer-dotnet and pactflow-example-provider-dotnet Given products exist A request to get products with GET /products returns a response which has a matching body Failure/Error: expect(response_body).to match_term expected_response_body, diff_options, example Actual: [{"name":"pancake","id":"1","version":"1.0.0"},{"name":"sanwhich","id":"2","version":"1.0.0"}] Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown [ { - "type": String }, { - "type": String }, Description of differences -------------------------------------- * Could not find key "type" (keys present are: name, id, version) at $[0] * Could not find key "type" (keys present are: name, id, version) at $[1]```

matt.fellows
2020-11-17 00:19
```namespace Products { public class Product { public Product(string id, string type, string name, string version) { this.id = id; this.name = name; // this.type = type; this.version = version; } // public string type { get; set; } public string name { get; set; } public string id { get; set; } public string version { get; set; } } }```

matt.fellows
2020-11-17 00:19
That is the change I made to produce that failure

matt.fellows
2020-11-17 00:20
reverting those changes returns to a green build

douweicai
2020-11-17 00:20
let me try again from my end

matt.fellows
2020-11-17 00:21
try running `make stop` in case the server is still running

douweicai
2020-11-17 00:22
here is my code:

douweicai
2020-11-17 00:23
namespace Products { public class Product { public Product(string id, string type, string name, string version) { this.id = id; this.name = name; this.type = type; this.version = version; } public string type { get; set; } public string name { get; set; } public string id { get; set; } public string version { get; set; } } }

douweicai
2020-11-17 00:23
when I ran it, I got the error below

douweicai
2020-11-17 00:23
ate: "Tue, 17 Nov 2020 00:22:18 GMT" server: "Kestrel" transfer-encoding: "chunked"      has status code 200      has a matching body (FAILED - 1)      includes headers       "Content-Type" which equals "application/json; charset=utf-8" Failures:  1) Verifying a pact between pactflow-example-consumer-dotnet and pactflow-example-provider-dotnet Given products exist A request to get products with GET /products returns a response which has a matching body    Failure/Error: expect(response_body).to match_term expected_response_body, diff_options, example     Actual: [{"type":"food","name":null,"id":"1","version":"1.0.0"},{"type":"food","name":null,"id":"2","version":"1.0.0"}]     Diff     --------------------------------------     Key: - is expected        + is actual      Matching keys and values are not shown     [      {     -  "name": String     +  "name": NilClass      },      {     -  "name": String     +  "name": NilClass          Description of differences     --------------------------------------     * Expected a String (like "burger") but got nil at $[0].name     * Expected a String (like "burger") but got nil at $[1].name 1 interaction, 1 failure Failed interactions: To re-run just this failing interaction, change the verify method to '.Verify(description: "A request to get products", providerState: "products exist")'. Please do not check in this change! # A request to get products given products exist INFO: Verification results published to https://avalara.pactflow.io/pacts/provider/pactflow-example-provider-dotnet/consumer/pactflow-example-consumer-dotnet/pact-version/ae47e9fed1b12954ff5306fa24bd758cdc1e8346/verification-results/239 [http://xUnit.net 00:00:04.6447031]   tests.ProviderApiTests.EnsureProviderApiHonoursPactWithConsumer [FAIL]

douweicai
2020-11-17 00:24
it somehow still use the one I commented out before

matt.fellows
2020-11-17 00:24
I suspect the provider server hasn?t re-started between testts

matt.fellows
2020-11-17 00:24
try a `make stop` and then `make fake_ci` again

matt.fellows
2020-11-17 00:24
there is probably a better way to start the provider server than the way it is being started now (separately to the test)

matt.fellows
2020-11-17 00:25
Somebody with .NET expertise could likely do a much better job of integrating the lifecycle of the test with starting the server

douweicai
2020-11-17 00:26
same error.

matt.fellows
2020-11-17 00:27
what does `lsof -i :9000` say?

douweicai
2020-11-17 00:28
lsof -i :9000 COMMAND  PID   USER  FD  TYPE       DEVICE SIZE/OFF NODE NAME dotnet 10225 wendy.dou 152u IPv4 0xc5e6e683be10e85d   0t0 TCP localhost:cslistener (LISTEN) dotnet 10225 wendy.dou 153u IPv6 0xc5e6e683c130542d   0t0 TCP localhost:cslistener (LISTEN)

matt.fellows
2020-11-17 00:28
ok, so the provider is stilll running

matt.fellows
2020-11-17 00:28
run `make stop`

matt.fellows
2020-11-17 00:28
and then `lsof -i :9000` again, it shtould be empty

douweicai
2020-11-17 00:28
kill `cat server.PID` && rm server.PID /bin/sh: line 0: kill: (11412) - No such process make: *** [stop] Error 1

matt.fellows
2020-11-17 00:29
ok, then just run this for now `kill 10225`

matt.fellows
2020-11-17 00:29
it looks like a rogue process is in the background, that is how you can detect and remove it

matt.fellows
2020-11-17 00:30
The failure relates to the `name` property, not `type` so it seems like at some point in the past you changed that too?

douweicai
2020-11-17 00:32
yes, I did. It is working now.

matt.fellows
2020-11-17 00:32
ok cool!

douweicai
2020-11-17 00:32
can you send me the link where you see my change from the broker?

douweicai
2020-11-17 00:33
The use case to support pact contract testing is that we have to use http protocol, right?

matt.fellows
2020-11-17 00:33
you can also do messages (e.g. kafka/SNS/active MQ)

douweicai
2020-11-17 00:33
how about event based architecture?

matt.fellows
2020-11-17 00:33
The support in .NET is beta though from what I understand

matt.fellows
2020-11-17 00:33
It is in high demand though

douweicai
2020-11-17 00:34
yes, we are building event based architecture also

douweicai
2020-11-17 00:37
I will do demo to our team tomorrow, if we decide to pilot with one of my team first, what is the process normally when you onboarding others?

matt.fellows
2020-11-17 00:38
great!

matt.fellows
2020-11-17 00:38
> can you send me the link where you see my change from the broker? What do you mean by this, sorry?

douweicai
2020-11-17 00:39
I mean the pactflow you used as broker to see my publish?

matt.fellows
2020-11-17 00:39
> I will do demo to our team tomorrow, if we decide to pilot with one of my team first, what is the process normally when you onboarding others? sorry I don?t follow this either - what did you need?


matt.fellows
2020-11-17 00:39
that?s your pactflow account (you should have an email with those details after you registered, just in case you lose it)

douweicai
2020-11-17 00:40
yes, i am able to see it.

douweicai
2020-11-17 00:41
my question for piloting with my team, I mean that how other teams work? they will set up pact broker by themselves first? how much effort to set up?

matt.fellows
2020-11-17 00:41
If you use Pactflow, there is no effort to setup the broker-

matt.fellows
2020-11-17 00:42
you only use 1 broker for the whole company.

matt.fellows
2020-11-17 00:42
Setting up your own broker, I can?t say. It?ll depending on a bunch of things - capability of the team, where it?s hosted, security and other constraints. Usually, you can get it up and running in a few days, and production ready in 1-2 weeks at most

matt.fellows
2020-11-17 00:43
This is a rough ROI calculation for SaaS vs doing it yourself

douweicai
2020-11-17 00:44
I think the first step is piloting with one team to use pact contract testing using open source, once team buy in the idea and like it, we can move to commercial, make sense?

matt.fellows
2020-11-17 00:44
totally up to you

matt.fellows
2020-11-17 00:45
A lot of people pilot with Pactflow because it saves on the cost/effort of setting up of the broker internally. So it?s up to you. If you need me to increase your limits in Pactflow to do the PoC with the team, let me know. Otherwise, good luck!

douweicai
2020-11-17 00:48
Sure. I will do the demo first, then we will start from there

matt.fellows
2020-11-17 00:49
Yes - that becomes before all of this! :smile:

douweicai
2020-11-17 00:49
Thank you for all your support!

matt.fellows
2020-11-17 00:50
You?re welcome. Sorry for some of the hassles, .NET is not a language I?m very familiar with, so being able to give you good advice is something for the #pact-net channel

matt.fellows
2020-11-17 00:50
:crossed_fingers: crossed, hope it goes well tomorrow

matt.fellows
2020-11-17 00:50
feel free to use the demo pack I sent you if helpful

douweicai
2020-11-17 01:03
where is the broker hosted? cloud or your server?


matt.fellows
2020-11-17 01:04
(we run on AWS)

douweicai
2020-11-17 01:04
I mean the one I am using

matt.fellows
2020-11-17 01:04
that?s the one you?re using

douweicai
2020-11-17 01:04
I see

matt.fellows
2020-11-17 01:04
You?re currently using Pactflow, a hosted, commercial version of the Open Source pact broker

matt.fellows
2020-11-17 01:05
This is the open source one that you would need to host yourself: https://github.com/pact-foundation/pact_broker

matt.fellows
2020-11-17 01:05

matt.fellows
2020-11-17 01:09
Just so I?m clear Wei, did you get the impression you weren?t using a Pactlfow account? And do you understand the relationship between Pactflow and the open source tools? It?ll help us ensure our marketing collateral is clearer if not

pradeepchoube
2020-11-17 03:49
has joined #pact-net

douweicai
2020-11-17 05:14
I am pretty new to pact, just one week experience. I need your guidance also. the relationship between open source and commercial is you two is owned by one company?

matt.fellows
2020-11-17 05:39
> is you two is owned by one company? do you mean, is Pact and Pactflow owned by a single company?

matt.fellows
2020-11-17 05:40
Pact is an open source framework. Like many open source tools, it is maintained by a community of developers and contributors

matt.fellows
2020-11-17 05:40
Pactflow is a commercial product (built out of http://dius.com.au), which extends the open source tools with extra https://pactflow.io/features

douweicai
2020-11-17 06:06
cool. I will take a look. thanks

matt.fellows
2020-11-17 06:07
FYI there is a #pactflow specific channel if there are questions relating to that service

meng-lingtao
2020-11-17 14:39
has joined #pact-net

pabvidcal
2020-11-17 15:30
has joined #pact-net

douweicai
2020-11-18 02:55
Thanks!

magesh.nagamani
2020-11-18 05:15
has joined #pact-net

jstoebel
2020-11-18 13:53
has joined #pact-net

daniel.sayer89
2020-11-19 10:33
has joined #pact-net

art.ptushkin
2020-11-19 10:34
has joined #pact-net

pact457
2020-11-19 10:36
has joined #pact-net

ajerthan.sivayoganath
2020-11-19 10:38
has joined #pact-net

philipchardwick
2020-11-19 11:05
has joined #pact-net

tanzmann
2020-11-19 11:09
has joined #pact-net

olivier.quere
2020-11-19 12:10
has joined #pact-net

wilfried.vandenberghe
2020-11-19 12:19
has joined #pact-net

alan.hanafy
2020-11-19 19:28
has joined #pact-net

michael.deutscher
2020-11-19 21:39
has joined #pact-net

gerry.power
2020-11-20 03:31
has joined #pact-net

alex900
2020-11-20 05:08
has joined #pact-net

tomas.panik
2020-11-20 08:28
has joined #pact-net

marc.ferland
2020-11-20 14:43
has joined #pact-net

sebastien.crapoulet
2020-11-20 15:24
has joined #pact-net

adutrillaux
2020-11-20 15:28
has joined #pact-net

he
2020-11-20 15:59
has joined #pact-net

ivgeni.slabkovski
2020-11-20 21:52
has joined #pact-net

serhatburakyildirim
2020-11-21 21:57
has joined #pact-net

alnasl
2020-11-22 18:46
has joined #pact-net

ashutosh23802
2020-11-23 06:20
has joined #pact-net

leonty
2020-11-23 10:33
has joined #pact-net

dariusz.piwko
2020-11-23 11:34
has joined #pact-net

praneeth.kumar
2020-11-23 16:18
has joined #pact-net

mark.white
2020-11-24 09:03
has joined #pact-net

ufuk.ozcelik
2020-11-24 14:58
has joined #pact-net

stefanos.varsanis
2020-11-24 16:48
has joined #pact-net

lalexander2810
2020-11-24 16:53
has joined #pact-net

sivaprasad9
2020-11-24 20:46
has joined #pact-net

scyr
2020-11-25 14:56
has joined #pact-net

timotheus.ruprecht
2020-11-25 22:12
has joined #pact-net

manali.mogre
2020-11-26 11:44
has joined #pact-net

erik.terpstra
2020-11-26 12:08
has joined #pact-net

kjayachandra2000
2020-11-26 20:40
has joined #pact-net

kjayachandra2000
2020-11-26 22:00
@kjayachandra2000 has left the channel

sushil.kumar
2020-11-27 01:45
has joined #pact-net

zhujian
2020-11-27 07:54
has joined #pact-net

h.octavian
2020-11-27 14:08
has joined #pact-net

dikili
2020-11-27 20:46
@here I have a question around CI/CD and the can-i-deploy.. does anyone have a working yaml file to show how provider test execution as well as the can-i-deploy check can be automated ?

matt.fellows
2020-11-27 21:01
What yaml file?

dikili
2020-11-28 13:51
thus I look forward to a .yml file when consumed by CI/CD pipelines it will create the necassary tasks (steps) to run these in order consumer, provider, can-i-deploy ? @matt.fellows

dikili
2020-11-28 13:51
it is a configuration file in the examples in pactfoundation/pact-broker, you have some examples of that file format which has the .yml extensions i.e docker-compose.yml

noel
2020-11-28 23:12
has joined #pact-net

matt.fellows
2020-11-29 03:44
so that?s a docker example in how to run the CLI.

matt.fellows
2020-11-29 03:45
you don?t have to use docker compose, you can run it without docker compose

matt.fellows
2020-11-29 03:45
what are you struggling with specifically?

matt.fellows
2020-11-29 03:46
You?ll have to execute the CLI in your own CI/CD pipelines in a way that is specific to your CI tool

matt.fellows
2020-11-29 03:46
so ?steps? is specific to you

muraalee
2020-11-30 01:56
has joined #pact-net

pooja.sharma
2020-11-30 08:52
has joined #pact-net

mo
2020-11-30 09:24
has joined #pact-net

dikili
2020-11-30 11:44
ok my struggle is ,I use Azure devops as CI/CD but not sure which task I should create in order to use /execute the CLI that enables can-i-deploy ?

dikili
2020-11-30 11:46
so if there is a yml file then i can use this yml file and tell azure to use that yml file which will then automatically create these tasks for me.. that is why i asked

david.greene
2020-11-30 21:47
has joined #pact-net

matt.fellows
2020-11-30 22:42
we don?t provide yaml files for all of the CI systems, sorry

matt.fellows
2020-11-30 22:42
I?m not familiar with Azure DevOps

bas
2020-12-01 09:00
has joined #pact-net

dikili
2020-12-01 14:54
Ok thanks @matt.fellows if there were a yaml file I believe it would support all CI/CD environments but I might be wrong as far as I know they are universal across all

wainstead
2020-12-01 14:57
has joined #pact-net

jerobinson
2020-12-01 20:32
has joined #pact-net

sumedhagamage
2020-12-02 03:33
has joined #pact-net

sumedhagamage
2020-12-02 04:12
@sumedhagamage has left the channel

fealaer
2020-12-02 11:40
has joined #pact-net

fealaer
2020-12-02 11:57
@fealaer has left the channel

patrick.hendron
2020-12-02 14:44
has joined #pact-net

lpratt
2020-12-02 18:19
has joined #pact-net

sandragnzalez
2020-12-03 11:04
has joined #pact-net

kristian
2020-12-03 14:34
has joined #pact-net

me1466
2020-12-03 23:42
has joined #pact-net

wenfeng.li
2020-12-04 11:42
has joined #pact-net

cdambo
2020-12-05 11:59
has joined #pact-net

gayatree.eee
2020-12-08 04:50
has joined #pact-net

c.pavan1986
2020-12-09 04:18
has joined #pact-net

william.pritchard
2020-12-09 15:28
has joined #pact-net

parveshchaudhary111
2020-12-09 17:54
has joined #pact-net

w.sobasik
2020-12-10 10:39
has joined #pact-net

thanuxxxx
2020-12-12 22:41
has joined #pact-net

ian.hamilton
2020-12-13 06:53
has joined #pact-net

colm.j.murphy91
2020-12-13 07:02
has joined #pact-net

victoria.kruczek
2020-12-13 14:13
has joined #pact-net

wuddarwin
2020-12-14 05:23
has joined #pact-net

connor.aird
2020-12-14 15:52
has joined #pact-net

arman.najafian
2020-12-14 15:52
has joined #pact-net

praveen.lakkaraju
2020-12-14 16:12
has joined #pact-net

alejandro.germain
2020-12-14 16:26
has joined #pact-net

josh.ellinger
2020-12-15 01:22
has joined #pact-net

ufuk.ozcelik
2020-12-15 08:22
@ufuk.ozcelik has left the channel

nikitsenka
2020-12-15 09:35
has joined #pact-net

hibahawes
2020-12-15 09:53
has joined #pact-net

sarvar
2020-12-15 14:24
has joined #pact-net

suruchipatidar14
2020-12-16 05:35
has joined #pact-net

smatheson
2020-12-16 06:33
has joined #pact-net

olayemifolakemi
2020-12-16 15:23
has joined #pact-net

nouri.tawfik
2020-12-16 19:14
Hello, It seems pact-net does not support asynchronous messages (specification v3) Do you have any updates? Do you recommend any other alternatives for. Net? Thank you for your help.

ania.kovalchuk
2020-12-17 00:09
has joined #pact-net

writetojoshma
2020-12-17 05:52
has joined #pact-net

rejeesh.g
2020-12-17 11:07
has joined #pact-net

lukas.kempec
2020-12-17 12:45
has joined #pact-net

lukas.kempec
2020-12-17 12:56
I would like to know as well. Any update on this? Anyone?

vikas543
2020-12-17 16:28
has joined #pact-net

bpugh
2020-12-17 17:05
has joined #pact-net

jeff.burmood
2020-12-19 17:45
has joined #pact-net

kyle.florence
2020-12-19 19:21
has joined #pact-net

ankurmalik22
2020-12-19 21:14
has joined #pact-net

vsukumaran
2020-12-20 01:56
has joined #pact-net

omer.morad
2020-12-20 08:10
has joined #pact-net

ringo
2020-12-20 10:51
has joined #pact-net

omer.moradd
2020-12-20 18:01
has joined #pact-net

souravsen1
2020-12-21 11:28
has joined #pact-net

andoni.arroyo
2020-12-21 17:51
has joined #pact-net

theovanessen
2020-12-22 10:47
has joined #pact-net

stuart3166
2020-12-22 12:35
has joined #pact-net

winfante
2020-12-22 22:51
has joined #pact-net

lars.bonnes
2020-12-23 13:05
has joined #pact-net

eungjun.yi
2020-12-25 14:25
has joined #pact-net

ebanster
2020-12-27 13:18
has joined #pact-net

onur.baskirt
2020-12-28 10:48
has joined #pact-net

massimo.daros
2020-12-29 13:18
has joined #pact-net

chris.fullinwider
2020-12-29 18:15
has joined #pact-net

piotr.soltysiak
2020-12-30 16:55
has joined #pact-net

adrian.przybyla
2021-01-04 13:41
has joined #pact-net

dcorrales
2021-01-04 22:06
has joined #pact-net

jokubas.lekevicius
2021-01-04 22:10
has joined #pact-net

matt195
2021-01-05 16:35
has joined #pact-net

rafael.manzoni
2021-01-05 17:56
has joined #pact-net

animesh2712
2021-01-05 19:29
has joined #pact-net

info
2021-01-06 01:55
has joined #pact-net

pascal.libenzi
2021-01-06 10:57
has joined #pact-net

brett
2021-01-06 18:55
has joined #pact-net

josh.rosenfeld
2021-01-06 19:39
has joined #pact-net

carlo
2021-01-07 13:24
has joined #pact-net

andrewshtamburg
2021-01-07 16:03
@andrewshtamburg has left the channel

danny.porrello
2021-01-07 16:48
has joined #pact-net

dawood.abbas
2021-01-08 07:00
has joined #pact-net

victoria.kruczek
2021-01-10 16:36
@victoria.kruczek has left the channel

cksharma122
2021-01-10 17:19
has joined #pact-net

caiquedpfc
2021-01-11 04:05
has joined #pact-net

henrik.rudstrom
2021-01-11 18:30
has joined #pact-net

eric
2021-01-12 10:23
has joined #pact-net

fnguyen
2021-01-13 00:39
has joined #pact-net

fnguyen
2021-01-13 01:44
Hello. Starting with PactNet in c# on azure. I have successfully created a consumer unit test with one interaction. in CI build we push it to pactflow. Producer build can pull the pacts file from pactflow and verify it and it shows as verified on pactflow. I am trying to understand the way the tags work. According to https://docs.pact.io/pact_broker/tags, if I PUT my pacts file to _/pacticipants/MyConsumer/versions/b5236e772/tags/prod_ (this succeeds and returns an object with 3 links for self, version and pacticipant) I should be able to get it from _/pacts/provider/MyProvider/consumer/MyConsumer/latest/prod_ However when I try this, I get a _404_. I guess there is a concept I am missing. Am I supposed to be PUTting the pacts file itself? Thank you.

matt.fellows
2021-01-13 01:52
Are you just trying to understand the API resources themselves?

matt.fellows
2021-01-13 01:52
I suppose, given that you already have the publishing/retrieving from Pactflow, you don?t really need to be manually making API calls to manipulate tags

fnguyen
2021-01-13 01:52
Trying to understand the concepts and exercise them from postman.

matt.fellows
2021-01-13 01:53
I?d recommend starting with the HAL browser in the top r/h corner of your Pactflow screen

matt.fellows
2021-01-13 01:53
you can navigate the contracts and tags from there, and then translate to Postman if needed

fnguyen
2021-01-13 01:54
the publishing is done as a CI step (with curl), the retrieval is done with PactVerifier.PactUri()

uglyog
2021-01-13 01:54
You don't post the Pact file to the tags endpoint.

matt.fellows
2021-01-13 01:54
I would recommend using the CLI tools to publish the pact and tag it

uglyog
2021-01-13 01:54
You first create the Pact resource with the file, then create the tag (probably with an empty body)

fnguyen
2021-01-13 02:02
This works: ? PUT my pacts file to /pacts/provider/MyProvider/consumer/MyConsumer/version/_b5236e772_ ? PUT an empty object to /pacticipants/MyConsumer/versions/b5236e772/tags/prod. returns an object with name and links ? Finally retrieve it from GET /pacts/provider/MyProvider/consumer/MyConsumer/latest/prod The version must match. Thanks Ronald.

pollet_22
2021-01-13 16:04
has joined #pact-net

dshattuck
2021-01-13 20:49
has joined #pact-net

thomas.rosati
2021-01-13 21:58
has joined #pact-net

rahulsmalpani
2021-01-14 07:56
has joined #pact-net

sacha.camfferman768
2021-01-14 09:42
has joined #pact-net

brandonbeard86
2021-01-14 22:10
has joined #pact-net

geetishnayak
2021-01-15 01:02
has joined #pact-net

shettyg
2021-01-15 14:18
has joined #pact-net

natarajang1
2021-01-15 15:29
has joined #pact-net

michel.neufeglise
2021-01-18 08:55
has joined #pact-net

bart.boersma
2021-01-18 10:48
has joined #pact-net

monica.wu
2021-01-19 06:25
has joined #pact-net

makobernal
2021-01-19 08:23
has joined #pact-net

jibrail.idris
2021-01-19 10:11
has joined #pact-net

jmvb.registros
2021-01-19 11:01
has joined #pact-net

irldev
2021-01-19 15:37
has joined #pact-net

irldev
2021-01-19 15:39
I'm starting to look at http://pact.net and was wondering is there a .net equivalent of the @state("consumer scenario here") ? An example can be seen here: https://github.com/pact-foundation/pact-jvm/blob/master/provider/junit/src/test/java/au/com/dius/pact/provider/junit/ContractTest.java I'm just wondering how we write tests for specific scenarios in .net the way you can with Java.

irldev
2021-01-19 15:41
As I understand from the Java version we had to have an @state annotated method for each scenario in the contract, which then ran the actual provider test.

fnguyen
2021-01-19 22:09
Are there any best practices to run the *pact provider test* as part of the CI/CD of an *azure function* ? Running it in a function emulator or actually deploy the function and run the provider test on deployed function? Thank you

tpham
2021-01-19 22:36
has joined #pact-net

matt.fellows
2021-01-19 22:38
No, you need to setup a (test only) provider endpoint that will receive the state to configure

matt.fellows
2021-01-19 22:38
I think you've discovered this already based on your other question

vishal.grover
2021-01-20 03:12
has joined #pact-net

irldev
2021-01-20 07:39
Yeah, I think so. Thanks :+1:

priya.saraf
2021-01-20 08:43
has joined #pact-net

fahad.aj.khan
2021-01-20 08:58
has joined #pact-net

nicole.jaenchen
2021-01-20 09:38
has joined #pact-net

dinakaran.ulaganathan
2021-01-20 13:59
has joined #pact-net

yann.courtel
2021-01-20 16:09
Hi paulh, using attribute for that would be an overkill and not necessarily the best way to go in .NET. We use a base provider test class where there is a dictionary containing the states, then a simple link with the state name and a method execution does the trick.

ptsiakos77
2021-01-20 21:55
has joined #pact-net

mhdtouban
2021-01-21 01:58
has joined #pact-net

veeraprathap.n
2021-01-21 04:10
has joined #pact-net

tsiakos
2021-01-21 09:24
has joined #pact-net

oleg
2021-01-21 13:05
has joined #pact-net

thomas.powell
2021-01-22 10:18
has joined #pact-net

stefan.selent
2021-01-23 01:54
has joined #pact-net

paulo
2021-01-25 11:37
has joined #pact-net

kmckeever
2021-01-25 14:38
has joined #pact-net

robert.land
2021-01-25 19:25
has joined #pact-net

aparnachaudhari
2021-01-25 21:34
has joined #pact-net

gwhill7
2021-01-25 23:23
has joined #pact-net

bibinc99
2021-01-26 14:37
has joined #pact-net

luisc.barretog
2021-01-27 00:42
has joined #pact-net

laxmi.somni508
2021-01-27 10:27
has joined #pact-net

ryanding16
2021-01-27 20:25
has joined #pact-net

athurner
2021-01-28 13:55
has joined #pact-net

alex.mcnair
2021-01-28 18:35
has joined #pact-net

mailinglistsspammedme
2021-01-28 23:30
has joined #pact-net

elliottmurray
2021-01-29 09:09
has joined #pact-net

steven.beaver.retail
2021-01-29 15:34
has joined #pact-net

ekberli.elbrus
2021-01-30 16:33
has joined #pact-net

george.south
2021-02-01 21:12
has joined #pact-net

twierzchowski
2021-02-03 07:05
has joined #pact-net

yassin.hajaj
2021-02-03 10:35
has joined #pact-net

dany.marques90
2021-02-03 12:48
has joined #pact-net

marcelo
2021-02-03 13:11
has joined #pact-net

sandeeparthur
2021-02-03 19:46
has joined #pact-net

octoberclub
2021-02-04 16:27
has joined #pact-net

slavick
2021-02-04 17:21
has joined #pact-net

imran.settuba
2021-02-04 18:57
has joined #pact-net

christopher.roberts
2021-02-05 01:02
has joined #pact-net

r.darcel
2021-02-05 09:15
has joined #pact-net

irldev
2021-02-05 20:59
Has anyone hit issues with pact-net on the provider side where they get a connection refused error? We've tried several things to get it working including starting up a connection on localhost before the test starts, yet still get the same error. We can run an instance of our real provider code in CI so we don't need to create a mock endpoint but it still throws the same error. Although I'm wondering now if we have to forget about trying to use our real provider code in CI and just create a mock version and endpoints, but I'd rather not as it seems like we'd have to just recreate all our methods and endpoints, just in a mocked/test version, rather than using the real application code. It seems very similar to this issue except ours happens on the provider verification https://github.com/pact-foundation/pact-net/issues/233

matt.fellows
2021-02-05 21:55
On the provider side you do need to start your provider API in CI and locally. So if you're getting a connection refused, that seems the cause

matt.fellows
2021-02-05 21:55
What is your provider test pointing at now?

ashish.joshi
2021-02-06 01:07
has joined #pact-net

fnguyen
2021-02-06 01:28
My understanding is indeed for the provider test, your service must be already running and accepting connections. You pass in the endpoint in PactVerifier.ServiceProvider(). Check with postman that your service runs, if so your provider test should run too. The Consumer test always runs on a mock service. This is so it gets exactly what is expects and the consumer test always passes. The result of running the consumer test is that it creates the pact file.

irldev
2021-02-06 09:00
It seems even when I have it run locally to test our provider verification, I still get a connection refused which is odd.

matt.fellows
2021-02-06 09:43
That is odd. How have you configured the pact verification? The port and server address need to line up and the server obviously needs to be up

yann.courtel
2021-02-08 08:27
Hi Paulh, from time to time it happens to us as well. Check how you build your service locally. Make sure the service are properly mocked and that you are referencing a port that is not used. Then check if the call to your api doesn't depend on an external component such as a custom serialization you would have to declare. It's an issue that is corrected at the CI for us usually. Plan of action : -> check your service is running properly (postman can help) -> check the route can be called -> check the objets passed to the request (sometimes it's a serialization problem) -> check also the content-type on the consumer side. (a simple application/json instead of application/vnd.restful+json can trigger a 404 error on the provider side) Good luck.

irldev
2021-02-08 14:53
We think the issue is related to it not being able to see the instance of the http client in memory attached issue). When we run it locally, it can connect fine. https://github.com/pact-foundation/pact-net/issues/240

irldev
2021-02-08 15:19
Thanks. Think we know why it's failing now in CI. It works when we run it locally but in memory in CI it's not happy

yann.courtel
2021-02-08 16:16
You're welcome. yeah, the same thing can happen at the CI, make sure the service is running in the right port and that the configuration is not overridden somewhere.

irldev
2021-02-08 16:36
I think our issue is we need to be able to pass in the actual instance of the http client rather than a URL like localhost

irldev
2021-02-08 16:36
I think our issue is we need to be able to pass in the actual instance of the http client rather to the verifier than a URL like localhost

matt.fellows
2021-02-08 22:29
I?m very confused. On the provider side, your API should simply be started like it would in any other environment. The Pact provider verification process will communicate to that provider over HTTP - why would it need an actual instance of an http client?

matt.fellows
2021-02-08 22:29
if it can?t talk to it via HTTP, it?s not going to work

przemek.sech296
2021-02-08 23:18
has joined #pact-net

vplows
2021-02-09 06:00
has joined #pact-net

irldev
2021-02-09 06:17
From what we can tell it's the same issue as talked about in the link I posted above. It seems based on that, that the .net implementation requires the provider to be deployed either locally or to a real environment, rather than in memory in CI.

matt.fellows
2021-02-09 07:16
Do the docs imply that you can do it any other way? We should update if they do, because it's not how pact works. As stated above, the server must be up and running. It needs to expose a REST API. That implies it can't be in memory

irldev
2021-02-09 08:37
I'm not sure. At this link below it seems to imply you can start the API when your test starts. When we start the API locally and separately using a dot net run command, everything works fine and the provider verification can use localhost. When we try to have the test start it in the same way, the provider verify throws the same error as in the above. https://github.com/pact-foundation/pact-net

matt.fellows
2021-02-09 10:57
> At this link below it seems to imply you can start the API when your test starts you can of course, but the API needs to be up and available by the time the Pact verification begins. If you start it asynchronously, it may not be up in time

matt.fellows
2021-02-09 10:58
It?s possibly because I don?t write .NET - but does this not imply the service should be up and running on port `9222`? (genuinely asking if the docs are clear so that we can fix if not)

rodney.stromlund
2021-02-09 16:18
has joined #pact-net

fnguyen
2021-02-09 18:41
I have been working at implementing pacts test for an azure function recently. The consumer test can run with the other unit tests immediately after building. The consumer test passes, as designed, and the pact is pushed to broker and tagged. For the provider test to run, the service needs to have been deployed *before* the test starts. We do this by deploying to a DEV location then pointing the provider test to that test location. If the provider test succeeds, the deployment to staging happens. We still have the dev deployment done even if the test failed and we may want to roll it back or re-run the deployment step of a previous build.

nada
2021-02-09 19:00
has joined #pact-net

siddhardhan
2021-02-09 20:21
has joined #pact-net

matt.fellows
2021-02-10 00:11
We typically would recommend _not_ deploying to a real environment for Pact tests.

matt.fellows
2021-02-10 00:12
In the case of AWS Lambda, for example, two common patterns exist: 1. Use things like serverless / SAM local (Do azure functions have a similar tool?) 2. Create a small HTTP handler that sits in front of your actual function code delegating to it that Pact can communicate to


fnguyen
2021-02-10 00:15
For azure functions in visual studio there is an emulator. I would be interested if there was a way to do something similar from azure pipeline.

fnguyen
2021-02-10 07:00
I have a consumer test that has some fields like ```jitter = new { value = Match.Type( 0.6742424242424242 ), }, packetLoss = new { value = Match.Type( 0.5848106060606061 ), },``` during producer test is see ```Failure/Error: expect(response_body).to match_term expected_response_body, diff_options, example Actual: { [...] "jitter":{"value":0.6742424242424242},"packetLoss":{"value":0.5848106060606061}, [...] Diff -------------------------------------- Key: - is expected + is actual Matching keys and values are not shown ... , { "jitter": { - "value": Float + "value": NilClass }, "packetLoss": { - "value": Float + "value": NilClass }, Description of differences -------------------------------------- * Expected a Float (like 0.6742424242424242) but got nil at $.[...].jitter.value * Expected a Float (like 0.5848106060606061) but got nil at $.[...].packetLoss.value``` Is there a way to specify the type so it verifies correctly?


matt.fellows
2021-02-10 07:18
you should be able to use those to run the function locally - both in dev and in CI. Using tools like VS to simulate is great, but as you?ve discovered, it?s useless for CI. IMO it?s best to use tools and processes that can be repeated across dev and CI. It leads to less surprises and you don?t need to maintain multiple ways of doing it

lars.hisken916
2021-02-10 08:08
has joined #pact-net

pauligoe10
2021-02-10 08:19
has joined #pact-net

tusharvarm
2021-02-10 09:38
has joined #pact-net

igorsharf
2021-02-10 10:39
has joined #pact-net

patrick.hendron
2021-02-10 13:52
@patrick.hendron has left the channel

kieran
2021-02-10 17:13
has joined #pact-net

poward
2021-02-10 18:17
has joined #pact-net

ckhadilkar
2021-02-10 21:16
has joined #pact-net

fnguyen
2021-02-11 16:02
It was a user error. The data returned was very big and i was no suspecting that there would be some null. It looks like the test did exactly it was supposed to do!

neild
2021-02-11 18:53
has joined #pact-net

painenigowthami
2021-02-11 22:32
has joined #pact-net

stephenkilbourn
2021-02-11 23:02
has joined #pact-net

tcarlson
2021-02-11 23:05
has joined #pact-net

fnguyen
2021-02-12 01:19
I am trying to match either a float or null. I read ? https://github.com/pact-foundation/pact-js/issues/51, ? https://github.com/pact-foundation/pact-support/pull/86 ? https://github.com/pact-foundation/pact-net/issues/198 in PactNet.Matchers I only see Type, MinType and Regex matchers (and these just set the Match to "Pact::SomethingLike", "Pact::ArrayLike" or "Pact::Term") Is there no way to match either null or a number? Is there a way to match anything (just checking the attribute exists) ? I was thinking at doing a regex to match null or a decimal but regex probably only works with quoted strings. Thanks

fnguyen
2021-02-12 01:57
From what I read at https://github.com/pact-foundation/pact-specification/tree/version-3 it would be written as ```{ "matchingRules": { "$.body.jitter.value": { "combine": "OR", "matchers": [ {"match": "decimal", "value": "0.123456"}, {"match": "null" } ] } } } }``` But https://github.com/pact-foundation/pact-net#pactnet PactNet for now is only 2.0 compliant so there is no way to specify these matchers yet.

matt.fellows
2021-02-12 02:21
You need to write two tests Francois


matt.fellows
2021-02-12 02:21
the OR matcher I think is only supported in JVM and even then we discourage it (I think it might get deprecated)

matt.fellows
2021-02-12 02:21
At least, that?s the current state of affairs

matt.fellows
2021-02-12 02:21
the link I just posted explains the philosophy of this

r.strauch
2021-02-12 10:15
has joined #pact-net

ztlboy05
2021-02-12 14:57
has joined #pact-net

smith260194
2021-02-12 15:22
has joined #pact-net

fnguyen
2021-02-12 17:02
Thank you Matt. Writing two tests assumes the float or null are from separate queries. In my case, the query returns an array where some values are null and some are float. I (consumer am in .NET but my provider is in java. I had read the part about array min size cannot be 0. I had skipped the paragraph above: _The same goes for specifying "SOME_VALUE or null". If all your provider verification test data returned nulls for this key, you might think that you had validated the "SOME_VALUE", but in fact, you never had. You could get a completely different "SOME_VALUE" for this key in production, which may then cause issues._ However I would prefer if pact were a tool to let me do things I want even if weaker. If the producer tells me the value they return a null or a float, I want to be able to test that, so I can test it's there and is not e.g. a string. Pact will not make the producer team redesign their API because pact thinks they are doing it wrong. If I cannot test against null or float, I will have to just drop the test. Maybe in a future specification it would be possible to tag my field matchers and as a whole the tests would check all the options have been tested: i had some nulls and some float for my specific field.

dabfleming
2021-02-12 20:34
has joined #pact-net

prasanthp
2021-02-13 00:45
has joined #pact-net

bhardwajdiwakar
2021-02-14 22:38
has joined #pact-net

hiteshpatadia
2021-02-15 06:29
has joined #pact-net

vikrant.sarkaniya
2021-02-15 13:31
has joined #pact-net

lemitrou
2021-02-15 14:20
has joined #pact-net

helloraj
2021-02-16 08:09
has joined #pact-net

jamesmlucas
2021-02-16 19:29
has joined #pact-net

gabe707
2021-02-16 20:31
has joined #pact-net

wangpei9679
2021-02-16 21:29
has joined #pact-net

geir
2021-02-16 23:03
has joined #pact-net

soruma.net
2021-02-17 05:58
has joined #pact-net

therimpact
2021-02-17 12:30
has joined #pact-net

amaljayaraj07
2021-02-17 17:50
has joined #pact-net

andrzej.igielski
2021-02-17 21:41
has joined #pact-net

mikewagner21
2021-02-18 03:15
has joined #pact-net

arindam.datta
2021-02-18 06:25
Hi @matt.fellows, shouldn't there be a tag `master` (provider branch) after completion of the Provider verification? I am using `pact-net` binaries from `message-pact` branch. You can see in the code I am providing the `ProviderBranch` with the parameter `providerVersionTags`.

arindam.datta
2021-02-18 06:26
This is the case when Provider Verification Pipeline is finished after being triggered by `webhook` with exact PactUri.

arindam.datta
2021-02-18 06:33
Hi @neil, as it could be related to the .Net library, bringing this discussion in your notice :point_up:

matt.fellows
2021-02-18 07:22
Could you please turn on debug logging to see what?s happening? are you on the latest version etc.?

khandelwalbhushan
2021-02-18 08:10
has joined #pact-net

aniket.agarwal
2021-02-18 09:21
has joined #pact-net

arpit.modani
2021-02-18 09:43
has joined #pact-net

byronth
2021-02-18 11:45
has joined #pact-net

isa.levine
2021-02-18 23:37
has joined #pact-net

r.strauch
2021-02-19 08:41
@r.strauch has left the channel

brian.pfretzschner
2021-02-19 10:15
has joined #pact-net

chitra.adikesavan
2021-02-20 15:50
has joined #pact-net

chitra.adikesavan
2021-02-20 16:00
Hi, I am new to microservices testing. I am a functional tester trying to test the microservices implemented in .Net , kafka with ksql stream. Is there any sample code available for contract testing in pact for the messages.

matt.fellows
2021-02-20 22:59
Search this channel for message pact. It's currently in beta support in a branch

chitra.adikesavan
2021-02-21 04:29
Hi Matt, I could not find the sample code, would you be able to help. I am a functional tester with basic knowledge in coding. It might be helpful if I can get the sample code for reference for .Net messages. Do I have to install Ruby?

matt.fellows
2021-02-21 04:39
Hi Chitra! are you able to write code? Pact is a code-first tool, so that is a pre-requisite at the moment

matt.fellows
2021-02-21 04:40
This is the latest branch for .NET with message support: https://github.com/pact-foundation/pact-net/pull/276

matt.fellows
2021-02-21 04:40
We?re still working through getting support from new contributors to merge this into master and get it released

matt.fellows
2021-02-21 04:40
Thanks to @arindam.datta for doing this

chitra.adikesavan
2021-02-21 06:24
Thanks for sharing this Matt! I am going to go through and understand how to use it. Yes, our development team completed the first microservice and working on the second. I am trying to find the ways to test these.

ankita.soni
2021-02-22 07:26
has joined #pact-net

jacek.helper
2021-02-22 08:03
has joined #pact-net

dany.marques90
2021-02-22 13:54
@dany.marques90 has left the channel

seanw122
2021-02-22 15:36
has joined #pact-net

akennedy
2021-02-22 15:54
has joined #pact-net

esimpson
2021-02-22 16:42
has joined #pact-net

dagrawal
2021-02-22 17:24
has joined #pact-net

venkata.pro
2021-02-22 21:47
has joined #pact-net

matt.fellows
2021-02-23 00:41
@bart.schotten :point_up: as per your note at https://github.com/bartschotten/com-pact, we are in need of a new maintainer to help drive the framework forward. Would you be open to potentially taking Pact Net to the next stage?

chitra.adikesavan
2021-02-23 07:42
Hi Matt, I have two questions: 1. The Pact-net project has for the http-client, is there anything for messages without http? I am new to automation with little bit coding knowledge. Could you please give me sample test case which will help me to understand. I need examples for how to use pact with .net messages. 2. I have downloaded pact-net for windows version 2.6.1. But I could not find the name space PactNet.PactMessage, am i using the correct version?

irldev
2021-02-23 19:08
We eventually got this working. It turns out we needed to pass some authentication tokens into the headers that pact verify was using.

jordan.levin
2021-02-23 19:14
has joined #pact-net

matt.fellows
2021-02-23 21:42
Hi Chitraa, as mentioned previously, the .net work for messages currently resides in a branch. You?ll need to use that branch to do non-http testing

matt.fellows
2021-02-23 21:44
There may be others here on the forum that could help out, unfortunately I don?t know .NET at all very well, I?m just trying to help


matt.fellows
2021-02-23 21:44
I think that answers both questions!

francesco.latorre
2021-02-24 05:59
has joined #pact-net

aniket.g2185
2021-02-24 09:13
has joined #pact-net

sundaresank360
2021-02-24 12:12
has joined #pact-net

arindam.datta
2021-02-24 12:49
My consumer test is not able to start Ruby Host. The same code is running on different project successfully.

arindam.datta
2021-02-24 12:52
@bethskurrie: any help? Thanks in advance! :pray:

matt.fellows
2021-02-24 13:03
See if you can start the ruby process yourself, outside of the .NET code

matt.fellows
2021-02-24 13:04
it?ll be somewhere in the path like this `?/tests/bin/Debug/netcoreapp2.0/pact-linux-x86/lib/vendor/ruby/2.2.0/bin/pact-mock-service`

matt.fellows
2021-02-24 13:04
try running it without arguments, if it doesn?t start, that?s helpful

arindam.datta
2021-02-24 13:04
Ok @matt.fellows, thanks for your suggestion. I'll try that. I'll update my findings here

matt.fellows
2021-02-24 13:05
if it does, that means it?s somewhere else. Perhaps it?s taking too long to start, or there is an issue connecting to it

matt.fellows
2021-02-24 13:05
np

jhawthor
2021-02-24 15:18
has joined #pact-net

chris.r.thomas
2021-02-24 16:54
has joined #pact-net

peter.cook
2021-02-24 17:05
has joined #pact-net

arindam.datta
2021-02-24 17:19
Sorry for the late reply. I tried to start the ruby process, but couldn't. Probably I don't know how to do that.

arindam.datta
2021-02-24 17:20
I am running project on Windows with no ruby installed..

arindam.datta
2021-02-24 17:20
Can the filePath length be a issue? My project is pretty much deep down few sub-directories.

arindam.datta
2021-02-24 17:21
can it be something related to this? https://github.com/pact-foundation/pact-net/issues/160

arindam.datta
2021-02-24 17:22
It's strange, I run tests (consumer) on one project, it successfully starts `ruby` and tests are successful. But fails on another project, `ruby` process doesn't start at all

arindam.datta
2021-02-24 17:36
As per the above GitHub issue, my exact path is `273` chars. `D:\Projects\DecosPlatform\CollaborationServices\Decos.Collaboration.SessionManagement\tests\Decos.Collaboration.SessionManagement.Services.Tests\bin\Debug\netcoreapp3.1\pact-win32\lib\vendor\ruby\2.2.0\gems\pact-mock_service-3.6.2\lib\pact\mock_service\request_handlers`

arindam.datta
2021-02-24 17:37
However, I am not sure where to look for that error message as mentioned in the Github issue.

jayeshguru81
2021-02-24 18:34
has joined #pact-net

ben.kirberger
2021-02-24 19:16
has joined #pact-net

matt.fellows
2021-02-24 22:49
You don?t need ruby installed to run the process, so if it doesn?t run that could be it

matt.fellows
2021-02-24 22:49
what error does it through trying to execute the binary?

matt.fellows
2021-02-24 22:49
have you tried moving your project up a few directories to reduce the length?

arindam.datta
2021-02-25 04:42
Hi @matt.fellows, yes it's confirmed now. When I move my project up the directory structure it works now. Is there any workaround for this issue? It's hard to control/dictate directory structure in a large team.

m.stephkan
2021-02-25 05:30
has joined #pact-net

matt.fellows
2021-02-25 06:59
That's the workaround at the moment. Also search pact node for similar issue, there are windows registry hacks you can do

matt.fellows
2021-02-25 06:59
V3 should solve this problem, albeit we don't yet have a contributor path forward for this yet

matt.fellows
2021-02-25 06:59
In . net

stephen.tjasink
2021-02-25 08:23
has joined #pact-net

beatrizwaclawek
2021-02-25 20:27
has joined #pact-net

zhoutianli1234
2021-02-25 21:09
has joined #pact-net

travis.day
2021-02-26 04:06
has joined #pact-net

andrew.cunningham
2021-02-26 11:13
has joined #pact-net

andrew.cunningham
2021-02-26 11:54
@andrew.cunningham has left the channel

brianmasschaele
2021-02-27 13:27
has joined #pact-net

pedroefajardo_pactio
2021-02-27 17:18
has joined #pact-net

dominic_herrmann
2021-03-01 06:54
has joined #pact-net

yann.courtel
2021-03-02 08:42
Hi everyone. Is there any developer working on the message-pact branch at the moment? @arindam.datta I saw you on the thread. I'd like to help if possible. If not, at least if we can synchronize each other, that'd be great. Have a great day!

arindam.datta
2021-03-02 08:47
Hi @yann.courtel, no I am not working on that branch. I just tried once to merge 'master' to the 'message-pact' branch and raised a PR, but apparently I messed up one of the ReadMe files. After that I couldn't manage time to do anything. So, you can completely ignore my PR and probably start independently if you want to contribute.

yann.courtel
2021-03-02 09:55
ok got it. Thanks a lot!

matthew.long
2021-03-02 14:08
has joined #pact-net

tmoncm
2021-03-02 17:17
has joined #pact-net

phoenixcampos01
2021-03-02 21:25
has joined #pact-net

hugh.paul.mcgowan
2021-03-03 17:52
has joined #pact-net

normanrs
2021-03-04 11:18
has joined #pact-net

jayson.bailey
2021-03-04 19:18
has joined #pact-net

mjsmcp
2021-03-08 23:46
has joined #pact-net

javier.garcia_cotado
2021-03-09 21:52
has joined #pact-net

siddharth.gupta
2021-03-10 05:28
Hello folks , has anyone tried sending https requests to the PactNet Mock Server , its working for http when running consumer tests but fails for https

siddharth.gupta
2021-03-10 05:28
any idea how to make PactNet mock server work for https ?

siddharth.gupta
2021-03-10 05:30
here is the sample code i am using

siddharth.gupta
2021-03-10 05:30
//Arrange var guidRegex = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"; var eventId = Guid.Parse("83F9262F-28F1-4703-AB1A-8CFD9E8249C9"); var eventType = "DetailsView"; var eventTimestamp = DateTime.UtcNow; // Describe what mock provider service should return when a specfic request is recieved . _mockProviderService.Given(String.Format("there is a event with id '{0}'", eventId)) .UponReceiving(String.Format("a request to retrieve event with id '{0}'", eventId)) .With(new ProviderServiceRequest { Method = HttpVerb.Get, Path = Match.Regex($"/events/{eventId}", $"^\\/events\\/{guidRegex}$"), Headers = new Dictionary<string, object> { { "Accept", "application/json" } } }) .WillRespondWith(new ProviderServiceResponse { Status = 200, Headers = new Dictionary<string, object> { { "Content-Type", "application/json; charset=utf-8" }, { "Server", Match.Type("RubyServer") } }, Body = new { eventId = Match.Regex(eventId.ToString(), $"^{guidRegex}$"), eventType = Match.Type(eventType), timestamp = Match.Regex(eventTimestamp.ToString("o"), "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])T(2[0-3]|[0-1][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$") } }); var consumer = new EventsApiClient(_mockProviderServiceBaseUri); //Act var result = consumer.GetEventById(eventId); //Assert Assert.Equal(eventId, result.EventId); Assert.Equal(eventType, result.EventType); Assert.Equal(eventTimestamp, result.Timestamp); _mockProviderService.VerifyInteractions();

matt.fellows
2021-03-10 05:36
Any reason you have to actually use https? It really doesn't add any value in a pact test so I wouldn't bother

siddharth.gupta
2021-03-10 05:40
on the provider side we are planning to run the pact tests against actual deployment which takes https

siddharth.gupta
2021-03-10 05:45
i tried this MockProviderService = PactBuilder.MockService(MockServerPort, true, IPAddress.Any);

siddharth.gupta
2021-03-10 05:47
but MockProviderService fails to start after 20 checks

matt.fellows
2021-03-10 05:49
Sure, but this is the consumer side and is a unit test. The contract doesn?t capture if the request is http/https

siddharth.gupta
2021-03-10 05:50
ok

matt.fellows
2021-03-10 05:50
does that make sense?

matt.fellows
2021-03-10 05:50
It?s there because some people ask for it, but in 99.9% of the cases it?s just not required

siddharth.gupta
2021-03-10 05:51
so on provider side how do we make these calls on https ,? just update the BaseURI right ?

matt.fellows
2021-03-10 05:51
exactly

matt.fellows
2021-03-10 05:51
Also note, it?s not ideal to be tested against a real, deployed service. It can be done, but it?s not ideal (can?t run tests in parallel for example, don?t get feedback before commiting and so on)

siddharth.gupta
2021-03-10 05:51
ok gr8 , let me try it out , thanks for quick help as always

matt.fellows
2021-03-10 05:52
Is this API documented by OAS or anything, btw?

siddharth.gupta
2021-03-10 05:53
you mean the actual provider side ?

siddharth.gupta
2021-03-10 05:53
its FHIR

matt.fellows
2021-03-10 05:54
FHIR?


matt.fellows
2021-03-10 05:56
The reason I ask is that if that can be also documented as an OAS, we have some tools in Pactflow that may be of help


matt.fellows
2021-03-10 05:57
But back to the other point, do you have to test an actual, deployed provider? Any reason you can?t test against a local one? Doing provider states setup etc. is going to be hard

matt.fellows
2021-03-10 05:59
@siddharth.gupta so even though we?ve resolved it in the thread (for others: you almost certainly don?t need https on a consumer test), the option is there when setting the mock service up. e.g. `MockProviderService = PactBuilder.MockService(MockServerPort, true);` would start a mock server with HTTPS enabled

siddharth.gupta
2021-03-10 06:00
yes , creating medical records in very difficult independently , instead its easy for us to spin of actual deployment and run it quickly

siddharth.gupta
2021-03-10 07:15
Hey Folks , any pointer to article where i can find how to send parameters and its values in consumer request to mock server

matt.fellows
2021-03-10 07:17
Query parameters?

siddharth.gupta
2021-03-10 07:21
yes , multiple

siddharth.gupta
2021-03-10 07:22
was able to send single

matt.fellows
2021-03-10 07:24
Can you show what you mean please?

siddharth.gupta
2021-03-10 07:25
want to send something like http://localhost:Port/ with Path = "/4.0/fhir/Patient?name-or-identifier=" + PatientIdentifier + "&_format=json&_pretty=true",

siddharth.gupta
2021-03-10 07:27
so i did Path = "/4.0/fhir/Patient with Query = Match.Regex($"name-or-identifier={PatientIdentifier}", $"name-or-identifier={PatientIdentifier}"), successfully

siddharth.gupta
2021-03-10 07:27
but how to send more than 1 parameter

matt.fellows
2021-03-10 07:44
Can't you just literally add more to that regex matcher?

matt.fellows
2021-03-10 07:45
Also, do you really need the regex? As in, in your consumer test do you now know which patient ID will be used?

matt.fellows
2021-03-10 07:45
If you always know (which really you should) then you don't need a matcher here

matt.fellows
2021-03-10 07:45
The matcher isn't used on the provider test (because it's on the request)

siddharth.gupta
2021-03-10 07:47
Added a dictionary worked for single , trying for multiple

siddharth.gupta
2021-03-10 07:50
it worked

siddharth.gupta
2021-03-10 07:50
thanks

matt.fellows
2021-03-10 07:50
:+1::+1::+1:

siddharth.gupta
2021-03-10 07:51
Query = new Dictionary<string, object> { { "name-or-identifier",PatientIdentifier }, { "_format","json" }, { "_pretty","true" } }

siddharth.gupta
2021-03-10 10:55
Hi Folks , I was able to instruct mockserver to behave lie my provider . Now when running prvider tests i need to set Authorization token for every API call that provider test invokes . Is there a way to achieve it ?

matt.fellows
2021-03-10 12:25
It?s going to be tough, because it?s running remotely

matt.fellows
2021-03-10 12:26
That?s what provider states are for, but because it?s running on another server, you?ll need to expose an endpoint to manipulate state

matt.fellows
2021-03-10 12:26
Personally, it would be simpler to remove auth from that Pact test altogether (and the pact test environment)

akos.csurai
2021-03-10 13:39
has joined #pact-net

siddharth.gupta
2021-03-10 13:54
ok, i think token also includes user privilege's , how do we handle that then

testme2020testme
2021-03-10 14:12
has joined #pact-net

tommy.mirchandani
2021-03-10 17:13
has joined #pact-net

matt.fellows
2021-03-10 20:47
good question.

matt.fellows
2021-03-10 20:47
other frameworks have the concept of request filters, .NET doesn?t have it. But I found it fairly easy to add to JS/Go and for others to add (e.g. to Python/PHP)

matt.fellows
2021-03-10 20:47
you could have a go at contributing that feature to .NET

matt.fellows
2021-03-10 20:48
it involves creating a provider proxy and creating ?hooks? into each state, such that you could modify the request dynamically prior to issue the provider tests

matt.fellows
2021-03-10 20:48
in those hooks, you could create a new token for that test session and use it instead of the one in the contract


matt.fellows
2021-03-10 20:49
but again, because the environment is not within your control, you?re really working against the way Pact wants to work

varinderjitkaur13
2021-03-11 01:46
has joined #pact-net

krcl.dev
2021-03-11 05:11
has joined #pact-net

krishnaraoveera1294
2021-03-11 17:53
has joined #pact-net

raghavendra.kalakonda
2021-03-11 23:08
has joined #pact-net

andries.spies
2021-03-12 07:25
has joined #pact-net

siddharth.gupta
2021-03-12 08:00
Hey folks , My provider returns following json as response , i want to validate some of the attributes not all , so how do i set the expectations in the consumer side for mock to return selected attribute .

siddharth.gupta
2021-03-12 08:03
for example in the above json i want to only validate "resourceType" : : : : : "Patient", , "id": "Patient-64851", and also validate the json structure

siddharth.gupta
2021-03-12 08:12
i was able to generate token with large alive time and send it in PactVerifierConfig header

siddharth.gupta
2021-03-12 08:53
but now i want to validate selected part of json response and set it as expectation in consumer test

siddharth.gupta
2021-03-12 08:53
i was able to do something like this Body = new { entry = new { resource = new { resourceType = Match.Regex("Patient", "Patient"), id = Match.Regex("Patient-64851", "Patient-64851") } }

siddharth.gupta
2021-03-12 09:12
but the actual format has lot more data and consumer would only validate selected attributes and the structure

siddharth.gupta
2021-03-12 09:13
also as can be see below entry tag has additional parenthesis "[" ```"entry" : : : [ : : : : { : : : "fullUrl" : : : : "https://10.167.167.97:44370/4.0/fhir/Patient/Patient-64851", : : : "resource": : : : { : : : : "resourceType" : : : : : "Patient", : : : : "id": "Patient-64851",```

siddharth.gupta
2021-03-12 11:07
any pointer on above would be really helpful , this should be a very common case

siddharth.gupta
2021-03-12 11:08
where provider response is a json and consumer would want to validate only selected data along with the structure

matt.fellows
2021-03-12 11:12
It is a common case, in fact, it's close to a principle (see Postels Law). what issue have you run into?

matt.fellows
2021-03-12 11:13
You literally just write what you need in the consumer test without regard to any fields you don't need

siddharth.gupta
2021-03-12 11:21
how to ignore the content what is not needed

siddharth.gupta
2021-03-12 11:24
any example to validate json response would be helpful

kamil.klima
2021-03-12 11:38
has joined #pact-net

marcelo
2021-03-12 12:56
@marcelo has left the channel

lswanborough
2021-03-15 00:50
has joined #pact-net

don.tobias
2021-03-15 19:35
has joined #pact-net

sagar.kathuria
2021-03-17 04:25
has joined #pact-net

shao.sum
2021-03-17 08:35
has joined #pact-net

riddhichopra
2021-03-18 01:28
has joined #pact-net

anu.de
2021-03-18 02:28
has joined #pact-net

sreyaslj
2021-03-18 04:25
has joined #pact-net

siddharth.gupta
2021-03-18 07:41
Hey folks ,one of the provider in my organization do not want to keep track of consumer versions and run provider test against all versions of consumer and generate compatibility matrix how can we implement this using PactNet

matt.fellows
2021-03-18 08:19
As per https://github.com/pact-foundation/pact-net/#2-tell-the-provider-it-needs-to-honour-the-pact, you have the option to use the `PactBroker` function, and dynamically find all providers based on the tags you apply to them: ```.PactBroker("http://pact-broker", uriOptions: pactUriOptions, enablePending: true, consumerVersionTags: new List<string> { "master", "prod" }, providerVersionTags: new List<string> { "<ADD PROVIDER TAG HERE>" }, )```


fnguyen
2021-03-18 21:19
I am testing an API that takes a POST with a body. When I try to also use a query string, the mock server fails with a 500. https://github.com/pact-foundation/pact-net/issues/185, I read something about the underlying rack test allows body or query string but not both. It's two years old. Is it still the case or is it supposed to work?

arvind1017
2021-03-18 22:48
has joined #pact-net

matt.fellows
2021-03-19 00:00
I suspect it does not, based on https://github.com/rack/rack-test/issues/225


matt.fellows
2021-03-19 00:01
The new core (Rust) may support this, although I?m not sure it?s an explict thing we test for

matt.fellows
2021-03-19 00:01
the libraries are newer, so it?s probably possible

matt.fellows
2021-03-19 00:01
we are looking for a maintainer at the moment, to help drive the new Rust core into the .NET library

matt.fellows
2021-03-19 00:02
this would unlock a number of new features, solve a bunch of issues, and set us up for the future (e.g. plugins)

sushilvc84
2021-03-19 00:30
has joined #pact-net

tejakoshti7
2021-03-19 06:26
has joined #pact-net

yannick.adler
2021-03-19 12:44
has joined #pact-net

smith260194
2021-03-19 17:40
@smith260194 has left the channel

fnguyen
2021-03-19 18:00
Thanks Matt. No experience with Rust here though.

fnguyen
2021-03-19 18:05
@matt.fellows Would you know if this (query string and content) would be supported in java provider test (Java seems further along than .NET wrt pact) ?

matt.fellows
2021-03-19 20:43
I would know off the top of my head but I'd say it's likely

matt.fellows
2021-03-19 20:44
As for rust, you don't need to know rust to integrate it. It's shipped as a C interface (DLL)

aelse
2021-03-19 23:54
has joined #pact-net

eric2323223
2021-03-20 01:35
has joined #pact-net

jordan.r.stewart
2021-03-20 16:07
has joined #pact-net

tmorrison
2021-03-21 21:45
has joined #pact-net

a.chandrasekaran
2021-03-22 00:50
has joined #pact-net

maksym.motornyi
2021-03-22 11:50
has joined #pact-net

gareth.somerville
2021-03-22 12:10
has joined #pact-net

joseph.method
2021-03-22 19:55
has joined #pact-net

dennyg666
2021-03-22 20:54
has joined #pact-net

me1295
2021-03-23 00:15
has joined #pact-net

anchit.99
2021-03-23 09:04
has joined #pact-net

joseph.method
2021-03-23 14:30
@joseph.method has left the channel

wola.adedeji
2021-03-23 16:25
has joined #pact-net

kenny.shobowale
2021-03-23 16:38
has joined #pact-net

anbu.pandian
2021-03-24 11:54
has joined #pact-net

rachel.barton
2021-03-24 19:12
has joined #pact-net

james522
2021-03-24 22:06
has joined #pact-net

anne.schuth320
2021-03-25 07:49
has joined #pact-net

james.shirtcliffe
2021-03-25 12:04
has joined #pact-net

serhii.makarenko
2021-03-25 12:55
has joined #pact-net

mashabudryte
2021-03-25 14:35
has joined #pact-net

matthew.simon.barnes_
2021-03-25 16:08
has joined #pact-net

fnguyen
2021-03-25 17:49
I have tried to convince legal to let me work a little bit on open source projects but they have been very slow to respond. If I can, I would not mind helping.

fnguyen
2021-03-25 17:54
Note: if I patch the pact file and set the query string in the interactions' "path", the "path" and "body" are used correctly in the provider test. However hacking the pact is not the way I want to go.

jose.manzano
2021-03-26 14:27
has joined #pact-net

chris.faulkner
2021-03-26 16:13
has joined #pact-net

bryanw
2021-03-26 18:46
has joined #pact-net

kerem.durak
2021-03-29 08:34
has joined #pact-net

dave.clissold
2021-03-29 12:40
has joined #pact-net

sidhant.bhayana.15
2021-03-29 18:34
has joined #pact-net

crhawkins85
2021-03-30 21:02
has joined #pact-net

crhawkins85
2021-03-30 21:06
Good evening - I've been playing with Pact for a few days as a PoC and am finding really useful. So much so I went down a massive rabbit hole and think I've figured out a way to get WebApplicationFactory and the ASP Core https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests functionality working with provider verification via proxying the calls through the test client. I added some detail to https://github.com/pact-foundation/pact-net/issues/283 and will try and pull together an example I can share.

matt.fellows
2021-03-30 21:15
that sounds really useful Chris

matt.fellows
2021-03-30 21:15
would you be interested in contributing to the framework?

matt.fellows
2021-03-30 21:16
Separately to this, Pact Message (our support for async) in other libraries depends on having a proxy layer in there to be able to connect message producer (or consumer) functions to the underlying framework

matt.fellows
2021-03-30 21:16
so this sounds useful in that regard also

pranav.gore
2021-03-31 01:58
has joined #pact-net

harsha6988
2021-03-31 12:19
has joined #pact-net

leixu
2021-03-31 14:42
has joined #pact-net

matthew.brown
2021-03-31 15:15
has joined #pact-net

oleksandr.tryshchenko
2021-03-31 19:54
has joined #pact-net

phelantomas
2021-04-01 13:13
has joined #pact-net

ktogias
2021-04-01 20:04
has joined #pact-net

ktogias
2021-04-01 21:36
@ktogias has left the channel

balaji.sivakumar
2021-04-02 05:41
has joined #pact-net

uryadov212
2021-04-05 20:52
has joined #pact-net

soumya.aithal966
2021-04-05 22:45
has joined #pact-net

sheyan.rizfee
2021-04-06 00:55
has joined #pact-net

piotr
2021-04-06 09:24
has joined #pact-net

dmitry.korolev
2021-04-06 11:47
has joined #pact-net

sravyavadrevu988
2021-04-06 20:40
has joined #pact-net

johnnycareer
2021-04-06 21:34
has joined #pact-net

danil.nurgaliev
2021-04-07 12:26
has joined #pact-net

johnnycareer
2021-04-07 17:34
@johnnycareer has left the channel

fnguyen
2021-04-07 19:03
When running the consumer tests as part of a pipeline on azure, I get a bunch of errors (probably one per interaction) in the log although the test finishes successfully: ```ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:24 /home/vsts/work/1/s/PactConsumerTest/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `eof?' /home/vsts/work/1/s/PactConsumerTest/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `run' /home/vsts/work/1/s/PactConsumerTest/bin/Debug/netcoreapp3.1/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/webrick-1.3.1/lib/webrick/server.rb:191:in `block in start_thread'``` Should I be worried or can I ignore these?

gtsifrikas
2021-04-08 08:53
has joined #pact-net

kanapuramamarnath
2021-04-08 09:18
has joined #pact-net

arnaud.dutrillaux
2021-04-09 10:59
has joined #pact-net

gsinghania
2021-04-09 15:40
has joined #pact-net

souravmohanty35
2021-04-09 16:34
has joined #pact-net

itzdavey
2021-04-09 17:23
has joined #pact-net

tmorrison
2021-04-12 00:18
@tmorrison has left the channel

laura.edington
2021-04-13 17:45
has joined #pact-net

laura.edington
2021-04-13 18:15
Hi team, I?m seeing a weird behavior that I can?t find any explanation or resolution for in the docs. I originally had a state in my consumer test that did not have a corresponding provider state. When run, it failed (understandably). I changed the state in my consumer test to correspond to an existing desired provider state. When run, I now see _both_ ?tests? running. That is, in the pact that is posted to pact broker and on the provider side verification I see an array of tests of size 2, that run the same interaction but the first with the original provider state and the second with the new provider state. The original provider state is nowhere in the consumer pact and I only have one interaction there. I have tried deleting and integration and pact from pact broker, but it repopulates with this same 2-test problem. Any insights?

laura.edington
2021-04-13 18:16
this is the example consumer pact ```provider.addInteraction({ state: 'there are orders', uponReceiving: 'a request for orders', withRequest: { path: '/orders', method: 'GET', }, willRespondWith: { body: eachLike({ id: 1, items: eachLike({ name: 'burger', quantity: 2, value: 100, }), }), status: 200, headers: { 'Content-Type': 'application/json; }, }, }) })```

laura.edington
2021-04-13 18:16
And the provider verification looks like so ```Given there are walruses a request for orders with GET /orders returns a response which has status code 200 Given there are orders a request for orders with GET /orders returns a response which has status code 200```

laura.edington
2021-04-13 18:17
where `there are walruses` is the original state that did not have a match on the provider side and I have since changed

liam.mcdermott
2021-04-13 22:38
has joined #pact-net

matt.fellows
2021-04-14 01:54
So this looks like JS code

matt.fellows
2021-04-14 01:55
Can you please share the full suite? You might have it on a mode that appends to an existing contract

wedlaaa
2021-04-14 13:33
has joined #pact-net

laura.edington
2021-04-14 16:12
ah yes, the consumer is JS and the provider is .NET

laura.edington
2021-04-14 16:13
What do you mean by full suite?

laura.edington
2021-04-14 18:39
Interesting update! I fixed another issue where the Pact validation was failing (e.g. response code =/= 200). Once this was fixed, the ghost-of-provider-state-past disappeared

laura.edington
2021-04-14 18:40
perhaps there is a behavior where all integrations are appended until you get a validated pact

laura.edington
2021-04-14 18:40
I appreciate your eyes and thoughts on this - thank you! :raised_hands:

wderksen
2021-04-14 22:26
has joined #pact-net

matt.fellows
2021-04-15 01:11
> What do you mean by full suite? I meant the test suite code. You just shared the matchers, but I wanted to see how it was configured

matt.fellows
2021-04-15 01:11
> perhaps there is a behavior where all integrations are appended until you get a validated pact that definitely doesn?t sound right.

matt.fellows
2021-04-15 01:12
> Interesting update! I fixed another issue where the Pact validation was failing (e.g. response code =/= 200). Once this was fixed, the ghost-of-provider-state-past disappeared I think what?s more likely to have happened. If your consumer test was failing, it wasn?t writing a new contract. So even though your test code was changing, the contract wasn?t changing with it (Pact won?t serialise / update a contract if the tests are failing)

matt.fellows
2021-04-15 01:13
In either case, it?s posible there is a configuration issue that?s leaving the mock server running in the background. If that?s the case, you might get multiple serialised interactions with different states.

matt.fellows
2021-04-15 01:13
Make sure you don?t re-use the same mock server over tests. It should always start/stop.

matt.fellows
2021-04-15 01:13
One way to achieve that, is to not set a Pact port and let it choose a randomly available one from the OS

mail_4brad
2021-04-15 02:34
has joined #pact-net

mail_4brad
2021-04-15 05:15
@mail_4brad has left the channel

goncalosamuel
2021-04-15 15:08
has joined #pact-net

laura.edington
2021-04-15 15:36
Great info, great details to keep in mind when writing pacts. Thanks !

matthew.hall
2021-04-15 17:36
has joined #pact-net

raony
2021-04-15 19:21
has joined #pact-net

gupta.ratnesh9
2021-04-16 04:48
has joined #pact-net

greg595au
2021-04-16 10:00
has joined #pact-net

manel_ben_yahia
2021-04-16 13:59
has joined #pact-net

maxence
2021-04-17 11:07
has joined #pact-net

kranti.deep
2021-04-17 14:17
has joined #pact-net

github
2021-04-17 21:08
:warning: *Action required - upgrade app for Pact Foundation* :warning:

aaronw153
2021-04-17 21:42
has joined #pact-net

github
2021-04-19 00:57
GitHub app is successfully upgraded in your workspace :tada: To receive notifications in your private channels, you need to invite the GitHub app `/invite @GitHub`

dwmahieddine
2021-04-19 12:44
has joined #pact-net

garrettmichael
2021-04-19 18:34
has joined #pact-net

daniel.kalleward
2021-04-20 08:16
has joined #pact-net

matt.fellows
2021-04-20 11:17
@greg595au :wave: thanks for offering to contribute to Pact and Pact .NET, I?ll create a little thread :thread: here to give you some pointers on getting started :point_down:

greg595au
2021-04-20 11:18
Thanks @matt.fellows looking forward to getting my hands on this project


matt.fellows
2021-04-20 11:23
Oh, there are also these intro videos (sorry, you have to hear me speak a bit more!) https://www.youtube.com/playlist?list=PLwy9Bnco-IpfZ72VQ7hce8GicVZs7nm0i After that, you should have a decent idea of what Pact does.


github2
2021-04-20 11:25
[pact-foundation/pact-net] Pull request merged by mefellows

mattias.persson
2021-04-20 12:45
has joined #pact-net

mattias.persson
2021-04-20 12:47
Hi! We?re getting started with Pact and we?re wondering if there are any plans on support the v3 specs for .net? :slightly_smiling_face:

martin.eklund
2021-04-20 12:47
has joined #pact-net

kranti.deep
2021-04-20 13:59
@kranti.deep has left the channel

enda.brody
2021-04-20 17:37
has joined #pact-net

cristian.moisa
2021-04-20 18:25
has joined #pact-net

darccide
2021-04-21 01:35
has joined #pact-net

github2
2021-04-21 19:17
[pact-foundation/pact-net] Pull request opened by dependabot[bot]

github2
2021-04-21 19:17
[pact-foundation/pact-net] Pull request opened by dependabot[bot]

github2
2021-04-21 19:17
[pact-foundation/pact-net] Pull request closed by dependabot[bot]

matt.fellows
2021-04-22 00:51
Looks like no takers just yet!

matt.fellows
2021-04-22 00:52
@mattias.persson :point_up:

stain.witness
2021-04-22 02:43
has joined #pact-net

mattias.persson
2021-04-22 06:13
Hey @yann.courtel me and my team are at a very early stage but we?re attempting to get this to work. I?ll make sure to post here if we manage to make any progress!

oleksandra.pishcheiko
2021-04-22 08:31
has joined #pact-net

akos.csurai.4github
2021-04-22 10:01
has joined #pact-net

akos.csurai.4github
2021-04-22 10:24
Hello, I planned to use non http testing with Message Pact, between JVM and .NET services, but it turned out PACT NET does not support it. Can someone suggest any advice ? What to try ? I found https://github.com/bartschotten/com-pact Can I use its contracts in JVM side ?

christosbouloumpasis
2021-04-22 10:38
has joined #pact-net

matt.fellows
2021-04-22 10:41
You could give it a try. It's not an official library but looks decent. We're looking for co maintainers of pact .NET so if you're interested we'd be happy to talk/help

matt.fellows
2021-04-22 10:42
There is also a PR on the repo you might like to look at, it is functional I believe

temanibeck
2021-04-22 16:04
has joined #pact-net

michael_swiss
2021-04-22 21:04
has joined #pact-net

dawoud.sheraz
2021-04-23 09:34
has joined #pact-net

adriano.tanoue
2021-04-23 12:01
has joined #pact-net

saurabh.goel
2021-04-24 20:10
has joined #pact-net

cemal.onder
2021-04-25 12:22
has joined #pact-net

richard.forjoe
2021-04-26 00:52
has joined #pact-net

ron.aharoni
2021-04-26 11:03
has joined #pact-net

andrewmorton
2021-04-26 13:33
has joined #pact-net

aram
2021-04-26 15:24
has joined #pact-net

marcelo.souzameinberg
2021-04-26 21:32
has joined #pact-net

songqing.gu
2021-04-27 01:25
has joined #pact-net

fortiss.anita
2021-04-27 09:34
has joined #pact-net

keshav.reddy503
2021-04-27 12:06
has joined #pact-net

jeremykeczan
2021-04-27 14:57
has joined #pact-net

yeseniavega411
2021-04-27 15:31
has joined #pact-net

almantusk
2021-04-27 16:56
has joined #pact-net

alexandra.huamani
2021-04-28 00:12
has joined #pact-net

tonynguyenit18
2021-04-28 02:12
has joined #pact-net

agrawalneeraj43
2021-04-28 04:37
has joined #pact-net

shixun.liu1023
2021-04-28 04:39
has joined #pact-net

narendra.pathai
2021-04-28 06:21
has joined #pact-net

greg595au
2021-04-28 11:28
hi matt... finally got through everything above and studying the project. Onto a few issues

greg595au
2021-04-28 11:29
119 - Individual verification of interactions this is something that make sense from a reporting lens, i will give this one some thought and talk with you next week

greg595au
2021-04-28 11:31
135 and 289 - on a superficial level they appear to be related (but... I won't know till I get into the code base and also try on a linux box)

greg595au
2021-04-28 11:32
so - my comments now are - this project will definitely give me a programming profile to point to. As I progress, I expect to handle more complex issues and even start to help the user base :slightly_smiling_face:

marcin.grzejszczak
2021-04-28 13:53
has joined #pact-net

flubniewski
2021-04-28 17:01
has joined #pact-net

matt.fellows
2021-04-28 22:37
Awesome thanks Greg!

yann.courtel
2021-04-30 13:47
Thanks a lot Matthias

roy_collings
2021-04-30 15:15
has joined #pact-net

matt.fellows
2021-04-30 22:54
Where are we a folks? Is there anything I can do to help facilitate?

matt.fellows
2021-04-30 22:54
@jacek.helper cc: if you?re still interested in helping out here

prachi_mangesh_edake
2021-05-03 04:43
has joined #pact-net

mattias.persson
2021-05-03 06:36
Unfortunately we got a bit stuck on the PHP and .NET SDKs, unable to get them to work as expected. We opened an issue on the PHP SDK and are keeping on eye on the progress on the .NET version


greg595au
2021-05-03 07:35
Hey @matt.fellows, in relation to https://github.com/pact-foundation/pact-net/issues/289. Drilling down, we hand off to the ruby engine but I have some related info about the Verifier classes

greg595au
2021-05-03 07:37
I noted that we have a lack of coverage tests for the verifier classes https://user-images.githubusercontent.com/8934535/116691573-518e4e00-a9fe-11eb-922d-7c59669a91f2.png PactUriOptions, PactVerifier, and PactVerifierConfig

greg595au
2021-05-03 07:38
While I was closing the testing gap, I noticed the PactVerifierConfig had a bug in the backward compatible property.

greg595au
2021-05-03 07:41
The code intent appeared to be to remove the value from the Dictionary if CustomHeader was changed, but the value in CustomHeaders is expected to be removed. Using _customHeader.Value.Value fails but changing to _customHeader.Value.Key removes the existing CustomHeaderValue

greg595au
2021-05-03 07:42
I have built tests to cover that and extended the PactUriOptions to cover the use of the @ symbol (allowed)

greg595au
2021-05-03 07:45
Based on the Issue, we would benefit from a Integration test that uses names with @ symbols to trap for the condition that beth encountered and hence tell us if the underlying ruby or rust engines have a problem.

greg595au
2021-05-03 07:48
I will push my branch on this tonight, with a PR for review.

greg595au
2021-05-03 07:54
hmm. may I need pemission to push to the repo

sams.prashanth
2021-05-03 08:04
has joined #pact-net

mattias.persson
2021-05-03 09:31
Correct @matt.fellows!

matt.fellows
2021-05-03 11:00
just push to your own repo for now and submit a PR from there

matt.fellows
2021-05-03 11:00
I?ll work on getting you perms

philip.m.wood
2021-05-03 12:46
has joined #pact-net

amiller
2021-05-03 15:27
has joined #pact-net

agarwal.akash333
2021-05-03 23:14
has joined #pact-net

marcin.grzejszczak
2021-05-04 07:27
@marcin.grzejszczak has left the channel

anand.ilkal
2021-05-04 08:01
has joined #pact-net

dennis.minard
2021-05-04 16:23
has joined #pact-net

chris.williams
2021-05-04 16:41
has joined #pact-net

ssorcnafets
2021-05-04 19:20
has joined #pact-net

kowalczuk.jnr
2021-05-04 22:24
has joined #pact-net

kowalczuk.jnr
2021-05-04 22:25
Hey guys. Is there currently a way to reset the provider states somehow? I see that implementations in other languages have before- and after- hooks, but struggle to find similar functionality in the .net port. Thanks!

hugo
2021-05-05 00:48
has joined #pact-net

matt.fellows
2021-05-05 01:50
I don?t believe so, if there isn?t yet an issue for it on the github repository, could you please raise a feature request for it?

matt.fellows
2021-05-05 02:07
Hello all! So @hugo and @jacek.helper have been working on a feature that is ready for merge and release. @neil are you able to shed some light on the release process for us? We?ll then work to define who should be doing this going forward. We may also need access to the repositories in which they are released etc. (e.g. nuget)

neil
2021-05-05 02:29
Yep sure can! Do we have somewhere non public and non ephemeral (not slack) to capture this sort of stuff?

neil
2021-05-05 02:31
I suppose it doesn?t really need to be non public, so we could document it in a GH markdown. Just the audience is maintainers rather than library users

neil
2021-05-05 02:32
Do we want to add Hugo and Jacek as repo maintainers? If so they?ll need to be added to the builds (AppVeyor) and nuget (package repo).

greg595au
2021-05-05 09:14
@neil while we're at it.. can i be added to this AND happy to document this for future reference

matt.fellows
2021-05-05 09:28
ahoy!

matt.fellows
2021-05-05 09:29
Sorry Neil, I must have closed slack just before you responded. In any case?. > I suppose it doesn?t really need to be non public, so we could document it in a GH markdown. Just the audience is maintainers rather than library users this would be ideal! > Do we want to add Hugo and Jacek as repo maintainers? If so they?ll need to be added to the builds (AppVeyor) and nuget (package repo). Yes, probably. We should also get the core maintainerati group across the credentials as well and made Admins

matt.fellows
2021-05-05 09:29
@greg595au that?d be awesome

neil
2021-05-05 09:30
@matt.fellows I can start by giving you access if you like?

neil
2021-05-05 09:31
You?ll need to create a http://nuget.org user

matt.fellows
2021-05-05 09:32
Yep. It?d be good to increase the bus (and bandwidth) factor to get another maintainer involved


matt.fellows
2021-05-05 09:32
I think I have both, but let me check

neil
2021-05-05 09:32
:thumbsup:

matt.fellows
2021-05-05 09:33
nuget: `` / `matt.fellows`

matt.fellows
2021-05-05 09:34
(I think my old account is gone, from memory they did a migration a while back and I didn?t bother doing anything about it)

greg595au
2021-05-05 09:35
ok - i have a user in nuget

greg595au
2021-05-05 09:35
prob need an org

greg595au
2021-05-05 09:37
and I am in appveyo

greg595au
2021-05-05 09:37
both as

neil
2021-05-05 09:39
I?ll get Matt added for now and docs written etc and then we can go from there

greg595au
2021-05-05 09:40
hi @neil can I assist you with the docs?

neil
2021-05-05 09:41
Thanks for offering @greg595au, but I think this will be easier to just brain dump directly into a doc.

matt.fellows
2021-05-05 09:42
makes sense

matt.fellows
2021-05-05 09:42
next steps after that, are to rehearse a release and fix up any gaps?

neil
2021-05-05 09:45
Yeah I?ll let someone else do the rehearsal. It?s essentially, create a new GH release with a new version, build triggers packages get published.

matt.fellows
2021-05-05 09:45
sounds great!

matt.fellows
2021-05-05 09:45
I have to run (kids dinner/bed time)

neil
2021-05-05 09:46
Looks like master might be broken from a build perspective, so might need to look into that one

hugo
2021-05-05 10:25
Sorry guys for my response time, there is a 12 hours timezone between us as I am located in Canada

hugo
2021-05-05 10:35
Let me know if I can do anything else to help

matt.fellows
2021-05-05 10:40
Thanks Hugo!

matt.fellows
2021-05-05 10:42
Plan from here: 1. Neil is going to get master into a good shape 2. Neil has given me access to release core artifacts 3. Matt to gran similar access to another core maintainer 4. We merge your feature in 5. We watch the release process do its thing 6. Neil will document the release process and anything else useful so we can start the process of introducing some new maintainers (i.e. those on this thread)

neil
2021-05-05 10:44
I?m working in slightly different order of 2, 6, 1.

neil
2021-05-05 10:44
1 might not happen tonight

greg595au
2021-05-05 11:14
is it appropriate to celebrate with https://www.youtube.com/watch?v=NmPhaG1ud38

matt.fellows
2021-05-05 11:15
Haha yes, any Monty python is welcomed

greg595au
2021-05-05 11:16
figured you were a monty python fan

hugo
2021-05-05 11:36
@matt.fellows I just filled out the form you sent me to apply to become a maintainer

matt.fellows
2021-05-05 12:03
Thanks Hugo! no worries about setting up a chat, we?ve already started that process :slightly_smiling_face:

matt.fellows
2021-05-05 12:04
@jacek.helper see above. Please give us a few days to get organised around this to see your change through, and discuss next steps around future contributions

greg595au
2021-05-05 12:36
hi matt - i had to clone the pact-net repo then apply my changes... its gt a PR under my github account

greg595au
2021-05-05 12:37
`test/pact-verifier-new-tests` branch on https://github.com/greghicks01/pact-net-clone.

neil
2021-05-05 12:48
The master branch build is all good. I just saw red and assumed it was master :smile: Some of the PR builds appear to be failing though, so we might want to work that out before merging

hugo
2021-05-05 13:07
Can you share me the details of PR Build?

hugo
2021-05-05 13:09
On our side everything is building

neil
2021-05-05 13:25
Yeah sorry, not sure why I didn?t add a link :smile: https://ci.appveyor.com/project/SEEKJobs/pact-net/history


yann.courtel
2021-05-05 15:14
Hi everyone, has anyone tried to use the pactnet lib within a project in net5? We are updating our libs and are wondering if it works (it is supposed to. cf. Microsoft). Thanks a lot.

jadelong
2021-05-05 15:51
has joined #pact-net

matt.fellows
2021-05-05 23:54
Thanks, could you please submit a pull request to the main repo?

matt.fellows
2021-05-05 23:54
That?s the standard workflow: 1. Fork the repository to your own workspace 2. Create a branch with the changes 3. Submit a PR to the main repo

hugo
2021-05-06 00:52
Hi Guys, from my standpoint it's building and all tests are Green:

hugo
2021-05-06 00:57
Is there any specific build parameter you are using in your pipeline? Or/And can you provide more error details? (AppVeyor is not giving much details)

hugo
2021-05-06 00:58
There was not code commit since January (only documentation and markdown commit) So It could not be a merge conflict

matt.fellows
2021-05-06 01:02
There is one conflict as far as the PR goes

matt.fellows
2021-05-06 01:02
but the build looks green to me

hugo
2021-05-06 01:02
However, I noticed that on AppVeyor it seem to have 2 additionals commits that are not present on Github exactly where the build start failing:

matt.fellows
2021-05-06 01:02
oh, wait. there?s no green build there

matt.fellows
2021-05-06 01:02
We should get appveyor to submit status checks to the PR

matt.fellows
2021-05-06 01:06
hmm is there a reason why branch builds don?t run Neil?

matt.fellows
2021-05-06 01:07
maybe it?s just the appveyor interface. This failed 5 days ago, is it the right build Hugo? https://ci.appveyor.com/project/SEEKJobs/pact-net/builds/38953788

hugo
2021-05-06 01:07
Hi Matt, they file that appear to be in conflict is an irrelevant timestamp sample. You may choose any version and it will work:

hugo
2021-05-06 01:08
Exactly it's the right build :thumbsup:

matt.fellows
2021-05-06 01:10
It?s failing though, any ideas why?

greg595au
2021-05-06 01:11
hey matt, never done it that way before, but i think that looks simple enough. Will have to try that tonight or tomorrow might

hugo
2021-05-06 01:12
Humm, possibly because PR 524 and 525 were failing before. Can we revert and re-apply those change later?

matt.fellows
2021-05-06 01:16
those PRs don?t exist as far as i can tell

hugo
2021-05-06 01:16
Ok probably just built number

matt.fellows
2021-05-06 01:16
ah

hugo
2021-05-06 01:17
I can revert the sample timestamp file and push it again to see if it build ...

hugo
2021-05-06 01:17
Let me know what you prefer?

matt.fellows
2021-05-06 01:19
It should still build without the conflict, but yes, if you could please resolve the conflict that?d be ace

hugo
2021-05-06 01:23
done :wink:

matt.fellows
2021-05-06 01:24
My laptop just ran out of battery (on train) so I'll have to resume this thread later. :crossed_fingers: Build passes

hugo
2021-05-06 01:26
Allright, I will keep and eye on this :wink: Let me know if you figure out what make it fail?

hugo
2021-05-06 01:52
:disappointed: still failing, any idea why?

alexei.solcanu
2021-05-06 02:01
has joined #pact-net


neil
2021-05-06 03:55
for example it?s set to build in VS 2017, which I?m assuming isn?t what you are building with?

zonkor
2021-05-06 08:08
has joined #pact-net

hugo
2021-05-06 12:42
VS 2019 but should not be the issue

florian.mautendorfer
2021-05-06 14:04
has joined #pact-net

hugo
2021-05-06 14:07
Tried in a fresh VM with VS 2017 and it is building correctly (confirming that is not the issue). Any other clues?

hugo
2021-05-06 14:08
Can flushing and purging build server nuget package help?

hugo
2021-05-06 14:50
Other option could be to put more verbosity to help us figure out what wrong:

john.mcnulty
2021-05-06 16:49
has joined #pact-net

hugo
2021-05-06 20:42
Gentlement we have a Green Build (Pushed adjustment for old c# version):

hugo
2021-05-06 20:43
:balloon: Ready for merge :tada:

fnguyen
2021-05-06 22:22
pactnet does not support OR (verify a field is a string OR null) I understand the reasoning for not allowing it (although i would rather be the one to decide, not being forced by the library) Is there a way to verify we have a field without specify what it is so we can catch if the field were missing/renamed?

bethskurrie
2021-05-06 22:23
Unfortunately not @fnguyen


fnguyen
2021-05-06 22:23
Is there a feature request for that already or should i create one?

bethskurrie
2021-05-06 22:24
Having an "optional" won't let you find if the field has been renamed.

fnguyen
2021-05-06 22:24
i have read it and disagree

bethskurrie
2021-05-06 22:24
It will just never fail.

bethskurrie
2021-05-06 22:24
How would you imagine it would pick up that a field had been renamed?

bethskurrie
2021-05-06 22:26
If for every test you have the expectation "the field firstName may exist" and it always came back as "first_name", all your tests would pass, and they would never pick up the error. How would it alert you to the fact that the field wasn't there?

fnguyen
2021-05-06 22:26
in my expected body i specify a match that matches anything, if the field Name were renamed to Names, Name is missing and i catch it. Currently if Name could be a string or null, my only option is to not check it.

bethskurrie
2021-05-06 22:27
If you can't control the test data, then Pact is not a good fit for your usecase unfortunatey.

fnguyen
2021-05-06 22:27
I not saying it may exist, but that it's value may be null.

fnguyen
2021-05-06 22:28
Yes i read that part.

bethskurrie
2021-05-06 22:28
Ok, I see what you mean now.

fnguyen
2021-05-06 22:28
it's the first line

bethskurrie
2021-05-06 22:28
The same logic applies though.

bethskurrie
2021-05-06 22:28
If it was always null, then came back as an integer in prod, you have a bug.

bethskurrie
2021-05-06 22:29
Having said that, I believe the "or null" is possible in v3 of the pact specification. I just don't know when PactNet will be moving to that. We're looking for some more maintainers at the moment.

fnguyen
2021-05-06 22:31
OR is in v3 but i was told it's deprecated and may be removed...

bethskurrie
2021-05-06 22:31
Yes, because of the reason I outlined.

bethskurrie
2021-05-06 22:32
Can you explain what the issue is setting up the test data?

fnguyen
2021-05-06 22:32
i will a little later. I have an appointment now

bethskurrie
2021-05-06 22:36
:thumbsup::skin-tone-3: happy to chat.

fnguyen
2021-05-06 23:12
Our schema allows for some objects to have their name null. I don't think PACT should dictate changes in our schema.

bethskurrie
2021-05-06 23:13
It's not dictating your schema, it's saying, for a specific example, it has to ether be one or the other.

bethskurrie
2021-05-06 23:13
You can have one example where it is null and one where it is populated.

fnguyen
2021-05-06 23:17
I understand what you say, with two tests checking different things. Our test data comes from a live source. I agree _Firstly, it is assumed that you have control over the provider's data (and consumer's data) when doing the verification tests. If you don't, then maybe Pact is https://docs.pact.io/getting_started/what_is_pact_good_for._ but it works in most cases and PACT could but decides to not let me shoot myself in the foot.

fnguyen
2021-05-06 23:21
I will see how possible it is for use to have a source that is fully controlled and not live so we can test separately for cases when the type is string or null. Thanks.

bethskurrie
2021-05-06 23:24
I've had a chat to the maintainer of the Rust lib (which the pact net library will be moving to at some stage), and he says that they're deprecated in the sense that we don't recommend people use them, but they will still be available. So you can shoot yourself in the foot at that stage :laughing:

bethskurrie
2021-05-06 23:24
I'm sorry that I can't give you a date on that though.

fnguyen
2021-05-06 23:29
Thanks @bethskurrie for the clarification. I wish I could help with PactNet.

fnguyen
2021-05-06 23:31
Would a Matcher that accept anything and only validate the presence of a field be more acceptable ?

bethskurrie
2021-05-06 23:32
There may be one. You'll have to look at the pact specification.

fnguyen
2021-05-06 23:32
oh, i thought you wrote there isn't one.

bethskurrie
2021-05-06 23:32
I'm not across the latest proposals for the new version of the pact spec.

matt.fellows
2021-05-06 23:37
Awesome Hugo!

fnguyen
2021-05-06 23:44
I read https://github.com/pact-foundation/pact-specification/tree/version-3 and I did not see any lenient matcher that would accept anything.

fnguyen
2021-05-06 23:45
and in V2, only regex, type mintype and maxtype are supported.

hugo
2021-05-07 00:29
Thank Matt! This PR solve 2 issues. Who have the power to push the "merge on master" button right now?

yann.courtel
2021-05-07 07:18
I had confirmation on my end that libs contacted by application in net5 are retro-compatible. So a lib in net5 can call a lib in netstandard 2.0 for instance and it should work fine. Thank you.

github2
2021-05-08 08:41
[pact-foundation/pact-net] Pull request opened by greghicks01

greg595au
2021-05-08 08:45
@matt.fellows :wave: can i get review on #292 :middle_finger: please

matt.fellows
2021-05-08 11:27
Awesome thanks!

matt.fellows
2021-05-08 11:32
@hugo @jacek.helper you guys keen to once over this? I'll get these merged and released next week (I don't want to do on weekend as I want to make sure I have time to test the released artifact)

jacek.helper
2021-05-08 11:44
I can take a look on this today evening or tomorrow.

matt.fellows
2021-05-08 11:45
:pray:

github2
2021-05-10 00:31
[pact-foundation/pact-net] Pull request merged by mefellows

matt.fellows
2021-05-10 00:32
Merging and releasing :clap:


github2
2021-05-10 02:03
[pact-foundation/pact-net] Pull request merged by mefellows

github2
2021-05-10 02:04
[pact-foundation/pact-net] Pull request merged by mefellows

github2
2021-05-10 02:54
[pact-foundation/pact-net] New release _https://github.com/pact-foundation/pact-net/releases/tag/2.6.2_ published by mefellows

matt.fellows
2021-05-10 06:01
So Neil, I?ve tagged the repo (see https://github.com/pact-foundation/pact-net/releases/tag/2.6.2) but appveyor didn?t do its thing. It looks like it is configured to do it though

tarunmehrotra3
2021-05-10 06:31
has joined #pact-net

matt.fellows
2021-05-10 06:46
hmm nvm, I think https://ci.appveyor.com/project/SEEKJobs/pact-net/builds/39082864 is actually the branch build. Haven?t used appveyor as much as I should have?


matt.fellows
2021-05-10 07:27
yep! Thanks, just me interpreting logs :stuck_out_tongue:

matt.fellows
2021-05-10 13:04
Thanks to @neil, @hugo and @jacek.helper - the latest release of Pact .NET is out with the new remote mock server feature, and the bus factor has improved! Hopefully this is the first of many contributions:pray:

jbecker
2021-05-10 16:31
has joined #pact-net

neil
2021-05-11 02:09
Heads up I?m going to be getting the build moved into a pact foundation appveyor account, so there may be some things I?ll be working through to get the builds functional after that.

greg595au
2021-05-11 02:15
@neil I am one of the newer members to this team - i would like to see what actions you are taking with appveyor so I can learn to fault find and fix in the future

neil
2021-05-11 02:41
@greg595au At this point, just requesting the project to be moved into the pact foundation account.

matt.fellows
2021-05-11 03:10
I?m assuming you mean moving from `SEEK-Jobs` github to `pact-foundation`, right? It would be great to at some point send status checks back to Github PRs (so we can see if it?s safe to merge)

james.wettenhall
2021-05-11 04:54
has joined #pact-net

neil
2021-05-11 06:21
@matt.fellows Not github, appveyor