pact-php
pact-php copied to clipboard
Pact Version 3 support
Just a question if this is planned or already happening?
I'll more or less paste my answer I posted on issue #27.
There are lots of plans. Keeping in mind, I original ported the Pact.Net 1.1 solution, which did not call Ruby. I'd say I based my entire knowledge of Pact from that implementation. My expertise tends to follow PHP, .Net, JS, then R in that order. The day I finished Pact.Php 1.0, the .Net solution released Pact 2.0 support. I really needed Matcher support for my organization. Thus, I wrote the base of PHP Pact 2.0 support on two long airplane rides (I got some odd looks as we all do). My main concern at the time is that PHP's external calls are finicky. Sometimes, you need to make exec, sometimes new COM("WScript.Shell"); on different versions of Windows. Let's say I have a history.
Looking back, I should have started PHP Pact 2.0 using Ruby. I also do not want to waste that effort if the Rust implementation is around the corner. Should have happened and will happen. The question is when. Next up, I desperately need AMPQ and/or ZMQ support in both the .Net and PHP versions. I was thinking about making two different libraries that could ideally be merged into Pact-PHP and Pact.Net when they support Pact 3.0 specifications. I'd like to do both of these by the end of the year. This is probably the wrong format for my response but through it all out there.
@DerManoMann ,
Out of curiosity, is there a feature or feature set you are looking for in 3.0? I'm particularly interested in the Message Bus specification. I could certainly use some help there.
I'm looking at exposing the v2 pact matching via a CLI - that could be used to give you a leg up on the message queue stuff.
@mattermack Not really a feature - I am having problems with the providerState which is required by the library. The broker we are using fails on those pact files (empty or null value is fine!!). We use both Java and PHP and the Java projects generate v3 pact files. I was kinda hoping that might perhaps fix the problem....
@DerManoMann can you clarify what you mean by "The broker we are using fails on those pact files"? Do you mean the broker fails to render it in HTML? Can you raise an issue in the pact_broker repository then.
Yeah, I thought about that - I do not know enough about the specs to judge this, but having a behaviour where all values other than non-empty string work does not seem right :)
Reopening as this should be the issue when it is supported (comment earlier on has reference on the state)
Can you answer, please, when pactV3 will approximately supported?
Unfortunately it is dependent on pact v3 being done in the ruby implementation. I've added the pact message support, but I haven't added any of the new matchers. @arkonchik which feature of v3 are you after?
Oh, I've just seen your other post @arkonchik . @mattermack, @mefellows and I can help you out with adding the message support.
Thanks. I'll be traveling for a bit. I was originally thinking of implementing something outside of the implementation like https://github.com/Mattersight/pact-net-messages. If the ruby conversion is further along when this starts, the better. @arkonchik , we do not have implementation timeline, other than soon. I personally have a need to get PHP up to V3 with messages like the related .Net implementation but would like to be more inline with the rest of the community. So ... soon :)
We've already got a pact message beta out for javascript and go using the ruby standalone. There's really quite a small amount of work that needs doing to integrate it into another language.
@bethesque you guessed. I need message queue support. I can try to help with this too.
@bethesque How can I help with message queue support?
@arkonchik I've done a bit of a brain dump here: https://github.com/pact-foundation/pact-message-demo
But there is so much to explain, that writing it down would take me ages. Perhaps we could have an online catch up where we could discuss it "in person" with @mattermack and @mefellows?
Would love to discuss this in "person" too :)
FWIW I've added some more notes to the original POC gist: https://gist.github.com/bethesque/c858e5c15649ae525ef0cc5264b8477c#gistcomment-2596746
It's far from a guide, but hopefully will be handy.
On Tue, May 22, 2018 at 11:02 AM, Beth Skurrie [email protected] wrote:
@arkonchik https://github.com/arkonchik I've done a bit of a brain dump here: https://github.com/pact-foundation/pact-message-demo
But there is so much to explain, that writing it down would take me ages. Perhaps we could have an online catch up where we could discuss it "in person" with @mattermack https://github.com/mattermack and @mefellows https://github.com/mefellows?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-php/issues/29#issuecomment-390830114, or mute the thread https://github.com/notifications/unsubscribe-auth/AADSjKcycJ5XzSvsX3qRARS1-DjStMsBks5t02OSgaJpZM4Qv6GA .
-- Matt Fellows
- http://www.onegeek.com.au/
Here is the pact message consumer diagram:
- Test case sets up the interaction, and accepts a message consumer that should be able to handle the message
- Test case invokes Verify on the wrapper language
- Wrapper may optionally reach out to
pact-message
toreify
the data structure back into its generated form (i.e. strip out all of the matchers etc.) - Wrapper then invokes the message consumer
- If the consumer errors, it fails the test
- If the consumer passes, it calls
pact-message update
to save the pact.
I can add this to your repo if you like Beth?
On Tue, May 22, 2018 at 5:51 PM, Matt Fellows [email protected] wrote:
Would love to discuss this in "person" too :)
FWIW I've added some more notes to the original POC gist: https://gist.github.com/bethesque/c858e5c15649ae525ef0cc5264b847 7c#gistcomment-2596746
It's far from a guide, but hopefully will be handy.
On Tue, May 22, 2018 at 11:02 AM, Beth Skurrie [email protected] wrote:
@arkonchik https://github.com/arkonchik I've done a bit of a brain dump here: https://github.com/pact-foundation/pact-message-demo
But there is so much to explain, that writing it down would take me ages. Perhaps we could have an online catch up where we could discuss it "in person" with @mattermack https://github.com/mattermack and @mefellows https://github.com/mefellows?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-php/issues/29#issuecomment-390830114, or mute the thread https://github.com/notifications/unsubscribe-auth/AADSjKcycJ5XzSvsX3qRARS1-DjStMsBks5t02OSgaJpZM4Qv6GA .
-- Matt Fellows
- http://www.onegeek.com.au/
-- Matt Fellows
- http://www.onegeek.com.au/
Added :)
On Tue, May 22, 2018 at 6:41 PM, Matt Fellows [email protected] wrote:
Here is the pact message consumer diagram:
- Test case sets up the interaction, and accepts a message consumer that should be able to handle the message
- Test case invokes Verify on the wrapper language
- Wrapper may optionally reach out to
pact-message
toreify
the data structure back into its generated form (i.e. strip out all of the matchers etc.)- Wrapper then invokes the message consumer
- If the consumer errors, it fails the test
- If the consumer passes, it calls
pact-message update
to save the pact.I can add this to your repo if you like Beth?
On Tue, May 22, 2018 at 5:51 PM, Matt Fellows <[email protected]
wrote:
Would love to discuss this in "person" too :)
FWIW I've added some more notes to the original POC gist: https://gist.github.com/bethesque/c858e5c15649ae525ef0 cc5264b8477c#gistcomment-2596746
It's far from a guide, but hopefully will be handy.
On Tue, May 22, 2018 at 11:02 AM, Beth Skurrie [email protected] wrote:
@arkonchik https://github.com/arkonchik I've done a bit of a brain dump here: https://github.com/pact-foundation/pact-message-demo
But there is so much to explain, that writing it down would take me ages. Perhaps we could have an online catch up where we could discuss it "in person" with @mattermack https://github.com/mattermack and @mefellows https://github.com/mefellows?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-php/issues/29#issuecomment-390830114, or mute the thread https://github.com/notifications/unsubscribe-auth/AADSjKcycJ5XzSvsX3qRARS1-DjStMsBks5t02OSgaJpZM4Qv6GA .
-- Matt Fellows
- http://www.onegeek.com.au/
-- Matt Fellows
- http://www.onegeek.com.au/
-- Matt Fellows
- http://www.onegeek.com.au/
Yes, we can try to discuss online if my english level will enough.
FYI, I started flushing out message support. Definitely WIP
https://github.com/pact-foundation/pact-php/tree/feat/message-pact
nice! 👍
On Sat, Jun 30, 2018 at 2:00 AM, mattermack [email protected] wrote:
FYI, I started flushing out message support. Definitely WIP
https://github.com/pact-foundation/pact-php/tree/feat/message-pact
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-php/issues/29#issuecomment-401398643, or mute the thread https://github.com/notifications/unsubscribe-auth/AADSjGqZriEbFEbeTMyaPXQam3ZV9yEdks5uBk8JgaJpZM4Qv6GA .
-- Matt Fellows
- http://www.onegeek.com.au/
I have a first draft of the consumer pact creation leveraging pact-message ruby classes: https://github.com/pact-foundation/pact-php/tree/feat/message-pact
To follow up on:
- Currently only allows one message per pact - perhaps craft a listener to this somehow
- Research why pact-message is returning contents: null
- Implement provider side
- Update readme and create better examples from rabbit
@nbrink91, want to take a peek at the implementation? I need another set of eyes.
Nice one @mattermack!
- Do you mean per pact file, or per "test case"? I haven't been able to think of a good use case where you would want to allow multiple messages in a test case.
- When is pact-message returning contents null - in reification?
On Sat, Jul 7, 2018 at 7:15 AM, mattermack [email protected] wrote:
I have a first draft of the consumer pact creation leveraging pact-message ruby classes: https://github.com/pact-foundation/pact-php/tree/feat/ message-pact
To follow up on:
- Currently only allows one message per pact - perhaps craft a listener to this somehow
- Research why pact-message is returning contents: null
- Implement provider side
- Update readme and create better examples from rabbit
@nbrink91 https://github.com/nbrink91, want to take a peek at the implementation? I need another set of eyes.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-php/issues/29#issuecomment-403148695, or mute the thread https://github.com/notifications/unsubscribe-auth/AADSjMX8iYOaJAuc9ML06mmonYquLe7Rks5uD9NVgaJpZM4Qv6GA .
-- Matt Fellows
- http://www.onegeek.com.au/
Ah, I see https://github.com/pact-foundation/pact-ruby-standalone/issues/20#issuecomment-403162767. Ignore #2. I do seem to remember getting this myself, but it was the content
vs contents
field problem, which seems to be correct glancing at your code.
For #1, the way I have it written, if a consumer and provider pair shared more than one message, the entire pact would need to be written by a single phpunit class. I could see this being a hindrance.
On Fri, Jul 6, 2018, 10:25 PM Matt Fellows [email protected] wrote:
Ah, I see pact-foundation/pact-ruby-standalone#20 (comment) https://github.com/pact-foundation/pact-ruby-standalone/issues/20#issuecomment-403162767. Ignore #2 https://github.com/pact-foundation/pact-php/pull/2. I do seem to remember getting this myself, but it was the content vs contents field problem, which seems to be correct glancing at your code.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-php/issues/29#issuecomment-403184979, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZX6Ia5BUf-nh82v37eMeQ9_G_7Nft2ks5uECoegaJpZM4Qv6GA .
Updated list of to-dos (because lists are fun to cross off)
- ~~Currently only allows one message per pact - perhaps craft a listener to this somehow~~
- ~~Research why pact-message is returning contents: null~~
- Implement provider side 3.1. ~~Implement provider proxy service~~ 3.2. ~~Attempt to move from Amp\Monolog in Provider implementation to Symphony's PSR log~~ 3.3. ~~Move much of the hard coded values to a config~~
- Create better examples from rabbit 4.0. Better example on metadata when publishing directly to a queue or an exchange 4.1. Multiple unit test functions in a single test case writing to the same consumer-provider pair 4.2. Multiple files with single unit test per test case writing to the same consumer-provider pair
- Update readme with better examples 5.1 Is there a better way of getting metadata about the queue/routing_key into the pact? The current examples stinks.
After attempting React and spatie/async for days, I finally got Amp Async to work as all others appear to have limited Windows support for async processes.
Update: at the Ruby version is at the appropriate mock level, where we do not fully support the entire Pact Specification 3 but do support Message implementations.
!up
@mattermack Is the todo list up to date? What is the top priority?