Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/amqp support #175

Closed
wants to merge 37 commits into from

Conversation

nirpet
Copy link

@nirpet nirpet commented Dec 4, 2018

No description provided.

@neilcampbell
Copy link
Member

Yeah the other thing is that I'm not sure if there is a web server implementation in .net that works cross platform on. net standard/core and full .net.

@nirpet
Copy link
Author

nirpet commented Dec 23, 2018

So we'll leave it as is for now?

@nirpet
Copy link
Author

nirpet commented Jan 17, 2019

Hi @neilcampbell, any update?

@neilcampbell
Copy link
Member

@nirpet Sorry, life has been very busy at the moment and haven't done much more.
I'm going to try sit down this weekend and come up with a list of the remaining work.

Hopefully then we have a bit of a plan and can both pick up smaller pieces of work until it's done.

@nirpet
Copy link
Author

nirpet commented Jan 18, 2019

Sounds good

@neilcampbell
Copy link
Member

@nirpet I just pushed a TODO.txt to the pact-message branch. Those are the things I can think about at the moment, however there will likely be more as we tick off those items. I'm going to do the readme one.

Would you be interested in working on Run through a bunch of different failures scenarios to make sure the user can diagnose the problem. The idea is to go through lots of different ways a user can have a failing Pact (rather than testing for code bugs) on both consumer and provider side and make sure there is enough details output for them to understand what happened and correct the problem.

@nirpet
Copy link
Author

nirpet commented Jan 22, 2019

Sure @neilcampbell.
We are using the same package to verify the message pacts (pact-provider-verifier), I guess that failing message pacts will have the same error messages as for failing http pacts but I'll check.

@neilcampbell
Copy link
Member

@nirpet Created a PR for the readme #183

@nirpet nirpet mentioned this pull request Feb 7, 2019
@nirpet
Copy link
Author

nirpet commented Apr 4, 2019

Hi @neilcampbell,
I finally had some time to complete my task.
I did found one strange behavior but it happens also for HTTP pacts.
When the regex validation fails along with the correct error message we get the entire stack trace from the pact-provider-verifier package. (I don't think it can be fixed inside Pact-Net)
Other than that everything looks good, if you approve I'll delete this task from the TODO file.

@Gokulaprakash
Copy link

Hi, Do you have any update on when this will be merged to master?

@neilcampbell
Copy link
Member

@nirpet How did you end up setting up the samples to capture any consumer failure messages? I started down the track of IMessageSink, but that didn't work for me. In the message sample in Handle_WhenAPetIsCreated_SavesThePet if you change type = Match.Regex(pet.Type.ToString(), "^(Dog|Cat|Fish)$") to type = Match.Regex(PetType.Dog.ToString(), "^(Cat|Fish)$"), you should see what I mean.

@neilcampbell
Copy link
Member

@Gokulaprakash No. Heads up this branch actually won't be merged into master, the message-pact one will. If you want to use it, you can build your own nuget package from that branch.

@ghost
Copy link

ghost commented Apr 10, 2019

@neilcampbell there is an existing project for message verifications - https://github.com/Mattersight/pact-net-messages
probably, you can take a look, so it will help to release message functionality quicker

@nirpet
Copy link
Author

nirpet commented Apr 12, 2019

@neilcampbell, maybe I've missed something.
I'm really busy right now so I'll check this out only next week.

@bartschotten
Copy link

the message-pact one will. If you want to use it, you can build your own nuget package from that branch.

I'm currently testing this. My tests succeed when running from Windows, but fail when I'm running them from Linux. This only happens with the message pact tests, the "api" pact tests succeed on both platforms.

Is this a known issue? I see that there was a commit on master that may be related to this, but even after merging in the latest master the issue still occurs.

I'll see if I can find the root cause.

@neilcampbell
Copy link
Member

@bartschotten I haven't tried running them on Linux (only Windows). It would be awesome if you could look into it!

That reminds me, I'll need to merge master into message-pact again.

@bartschotten
Copy link

bartschotten commented May 14, 2019

When testing with the included sample projects I get the same issue. I've also noticed that, even on Windows, the MessagePact does not generate log files, and that the provided Outputter is never called. This unfortunately makes it very hard to debug.

By the way, I've also done tests with the latest version of the ruby core. That doesn't help either.

@bartschotten
Copy link

Sorry for spamming this thread. I'm just thinking out loud a bit here, but the output I've been able to generate suggests that there's a problem parsing the json on Linux:

/mnt/c/Repos/Pact-Net/Samples/MessageZooEvents/ZooEventsConsumer.Tests/bin/Debug/netcoreapp2.2/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/json-2.1.0/lib/json/common.rb:156:in 'parse': 757: unexpected token at ''{id:{json_class:Pact::SomethingLike,contents:2},name:{json_class:Pact::SomethingLike,contents:Terence},type:{json_class:Pact::SomethingLike,contents:Giraffe}}'' (JSON::ParserError) from /mnt/c/Repos/Pact-Net/Samples/MessageZooEvents/ZooEventsConsumer.Tests/bin/Debug/netcoreapp2.2/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/json-2.1.0/lib/json/common.rb:156:in 'parse' from /mnt/c/Repos/Pact-Net/Samples/MessageZooEvents/ZooEventsConsumer.Tests/bin/Debug/netcoreapp2.2/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/json-2.1.0/lib/json/common.rb:335:in 'load' from /mnt/c/Repos/Pact-Net/Samples/MessageZooEvents/ZooEventsConsumer.Tests/bin/Debug/netcoreapp2.2/pact-linux-x86_64/lib/vendor/ruby/2.2.0/gems/pact-message-0.5.0/lib/pact/message/cli.rb:24:in 'reify'

@bartschotten
Copy link

I've found the issue. The problem occurs when calling the ruby script with a json string as an argument like this (set in the ReifyCommand class):
reify '{"key":"value"}'

This works on Windows but on Linux the double quotes get lost somewhere.
It does work when it is called like this:
reify "{\"key\":\"value\"}"

Now let's see if I can fix it in a less hacky way than I currently have.

@neilcampbell
Copy link
Member

@bartschotten Nice work! Also if you could do it on the message-pact branch rather than this PR, that would be sweet!

@neilcampbell
Copy link
Member

@bartschotten Also heads up I just merged the latest master into message-pact.

@bartschotten
Copy link

There's another issue that I ran into while running on WSL or on docker with volume sharing. It causes an infamous ruby warning (see for example microsoft/WSL#1426), which messes up the output that's captured in MessagePact.VerifyConsumer.
Locally I did an ugly fix to avoid this, but we may want to think about a proper way to handle this (or not).

@drkghost
Copy link

Hi, @neilcampbell @bartschotten @nirpet
Please refer to my question #246 (comment)
I'd like know if I can help with smth, and which branch can be taken for further work

Thank you in advance

@drkghost drkghost mentioned this pull request Feb 16, 2021
@adamrodger
Copy link
Contributor

Closed due to #315 being merged instead to add message pact support to v4.x

@adamrodger adamrodger closed this Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants