bethskurrie
2018-05-29 11:09
has joined #pact-ruby-xml

such.su
2018-05-29 11:10
has joined #pact-ruby-xml

bethskurrie
2018-05-29 11:10
@such.su I'll ask the person who is interested in implementing the xml matching to join this channel so they can keep you updated when it starts.

such.su
2018-05-29 11:11
Awesome, thank you Beth.

uldis.sturms
2018-05-30 13:41
has joined #pact-ruby-xml

uldis.sturms
2018-05-30 13:42
Hey, I guess the person in question is me :slightly_smiling_face:. I'm on holiday at the moment, returning in 2 weeks. Plan to start to work on the implementation then with the help from @bethskurrie.

uldis.sturms
2018-05-30 13:46
Current workarounds for pact XML assertions for us (company I work for) are: * generate match for match responses - when none of the returned values change (strictly not a contract tests - as we are forced to care about every field even though we might not) * use regex expressions (can get complex quickly for deeply nested structures and assertion on the full path is required)

such.su
2018-05-31 02:10
Hey @uldis.sturms thanks for the input. I am still a bit confused:thinking_face: could you be more elaborate on `generate match for match responses`?

uldis.sturms
2018-05-31 12:56
Hi @such.su, that's my english there :smile:. `generate matching response for interaction` would probably be more appropriate.

uldis.sturms
2018-05-31 12:58
We use `pact-js` and in javascript it is quite easy to use function composition to generate expected responses based on requests.

uldis.sturms
2018-05-31 12:59
Let's say there is a fields `x`in request that is uuid and is generated, we would then use the same uuid to generate expected response in case that fields was included in response.

uldis.sturms
2018-05-31 12:59
We've seen this with some APIs that implement some sorts of correlation ids.

uldis.sturms
2018-05-31 13:03
Some of these _hacks_ can probably go away once we have proper XML support in pact.

uldis.sturms
2018-05-31 13:03
At times another thing we need to do is regenerate pact contract every time on build server because *provider* does idempotency checks - so that request with the same values will fail.

such.su
2018-06-01 09:28
Hmm, I got it. Thank you very much:handshake:

matt
2018-06-11 01:40
has joined #pact-ruby-xml

uldis.sturms
2018-06-25 17:46
Hey, I have some time now. Would love to start working on adding the implementation. @bethskurrie - do you have some time this week to kick it off?

such.su
2018-06-26 02:03
That?s awesome!!!

bethskurrie
2018-06-26 03:13
Hi @uldis.sturms, sorry, it's been my turn to be on holidays.

bethskurrie
2018-06-26 03:14
I'll get back to you next week if that's OK.

uldis.sturms
2018-06-27 08:02
Absolutely, enjoy @bethskurrie!

such.su
2018-07-09 06:54
:wave:@bethskurrie @uldis.sturms About the XML implementation is there a roadmap or plan coming out?

bethskurrie
2018-07-09 06:54
We're catching up this weekend to discuss it.

such.su
2018-07-09 06:55
In this channel?

bethskurrie
2018-07-09 06:58
I hadn't actually thought that far.

bethskurrie
2018-07-09 06:58
Are you interested in helping out?

such.su
2018-07-09 07:00
I would love to but I know nothing about Ruby currently:joy:

bethskurrie
2018-07-09 07:00
It might be a tricky introduction!

such.su
2018-07-09 07:06
Yup, sorry?

bethskurrie
2018-07-14 10:11
@uldis.sturms it might be worth searching for pure ruby XML parsers, because of jruby

bethskurrie
2018-07-14 10:11
There are only about 3 people and a dog using jruby, but XML is the kind of thing that jruby users would use

bethskurrie
2018-07-14 10:13
Have a look at the last commit to pact-xml. I've made the "string with matching rules" class that will be passed in to the differ.

bethskurrie
2018-07-14 10:13
todo: I need to fix the travis build for ruby 2.2

uldis.sturms
2018-07-14 10:20
@bethskurrie great, will do.

uldis.sturms
2018-07-14 10:22
why do we need pact_specification_version in that object?

uldis.sturms
2018-07-14 10:24
also what is the purpose of expected_xml_string? should we not just use matching rules?

uldis.sturms
2018-07-14 10:24
Is it a fallback if no matching rules are specified?

bethskurrie
2018-07-14 11:00
The matching rules are in a different format between v2 and v3

bethskurrie
2018-07-14 11:00
You'll only need to deal with v3, so you can ignore it for now.

bethskurrie
2018-07-14 11:00
Well may need it for v4.

uldis.sturms
2018-07-14 11:00
okay

bethskurrie
2018-07-14 11:02
You know when you make a pact term, and you give it a matcher, and a value to generate?

bethskurrie
2018-07-14 11:03
In this case, the XML string is the generated value, and the matcher is in the matching rules.

bethskurrie
2018-07-14 11:04
It takes a while to get your head around it.

uldis.sturms
2018-07-14 11:06
But we only match on the rules, right? The generated value is used as a stub response for consumer in mock-server and the actual request for provider, right?

bethskurrie
2018-07-14 11:14
If there is no rule for a particular path, the match is done against the same path in the expected XML string.

bethskurrie
2018-07-14 11:15
I would start without the rules, personally. Just do a plain diff, one that allows extra nodes and attributes, and one that does not.

bethskurrie
2018-07-14 11:15
Get that working, and we'll try it out with the whole pact gem.

bethskurrie
2018-07-14 11:16
Then, we can add the rules on top.

uldis.sturms
2018-07-14 11:16
Okay, understood.

bethskurrie
2018-07-14 11:16
:+1:

uldis.sturms
2018-07-15 20:19
Hey, I?ve put in first pull request for some stuff to get initial feedback to see if I?m going in the right direction. https://github.com/pact-foundation/pact-xml/pull/1

uldis.sturms
2018-07-15 20:21
I welcome logic & style comments as I?ve never done anything too serious in ruby before.

uldis.sturms
2018-07-15 20:21
Thinking of putting in rubocop or something of that sorts to lint code for best practices.

uldis.sturms
2018-07-15 20:22
Is rubocop still the way to lint code in Ruby btw?

uldis.sturms
2018-07-15 20:23
Initially seems that we should be able to get away with using Ruby native REXML lib. Not the fastest and nicest to work with but hey - at least it is not nokogiri and installs fast.

uldis.sturms
2018-07-15 20:24
Was also looking at Ox - seemed quite cool but wasn?t sure about the JRuby support as it build C native code as well.

uldis.sturms
2018-07-15 20:24
One plus of using REXML was the distinction between elements & attributes.

bethskurrie
2018-07-23 01:11
REXML sounds like a good choice then @uldis.sturms

bethskurrie
2018-07-23 01:11
I've used rubocop before, and would again.

bethskurrie
2018-07-23 01:11
I've been meaning to introduce it into the other projects, but have never gotten around to it.

bethskurrie
2018-07-23 01:12
I've merged the PR, and I've created an end to end test for it.


bethskurrie
2018-07-23 01:13
When the expectations match the actual, everything passes. When there is a mismatch, something goes wrong in the rendering of the diff.

bethskurrie
2018-07-23 01:15
It looks like what is being pass into to the diff formatter is not what it is expecting. It should be the result of the Diff call, which is an array, but it looks like it's expecting a Difference object.

bethskurrie
2018-07-23 01:15
Awesome work on this so far though!

uldis.sturms
2018-07-23 05:53
Thanks for merging @bethskurrie & feedback.

bethskurrie
2018-07-23 05:55
Let me know if you find anything that needs changing in the standard pact libs - from what I've seen, it should "just work" once you've tweaked the diff formatter.

bethskurrie
2018-07-23 05:55
We can do a release once the no-rules matching is done, and see if we can find some beta testers for it.

jim
2018-07-23 18:01
has joined #pact-ruby-xml

jim
2018-07-23 18:08
@uldis.sturms, thanks for this initial implementation, I was literally just now looking into pact-xml, as we want to be able to verify both JSON and XML contracts, and saw your pull request. I'm happy to help with any work on this, or to beta-test once it is in a state that needs some actual use cases. Also, thanks @bethskurrie for all your work and contributions to Pact. I'm just learning it, seeing the tremendous value, and championing it within my organization. Looking forward to learning and doing more with it, and hope to be able to contribute back to this project as well!

uldis.sturms
2018-07-23 18:44
Welcome @jim. Feel free to open a PR if you see anything to improve or fix. :wink:

uldis.sturms
2018-07-23 20:12
@bethskurrie this PR should fix the formatting issue: https://github.com/pact-foundation/pact-xml/pull/2

uldis.sturms
2018-07-23 20:13
More details there - did't want to flood Slack. But seems that I did anyways :smile:

kurst03
2018-11-18 00:53
has joined #pact-ruby-xml

bethskurrie
2019-06-06 06:57
we've lost our history because it's a free slack account. Who was working on pact xml please?

uri.goldstein
2019-06-06 07:48
has joined #pact-ruby-xml

uldis.sturms
2019-07-31 11:11
Hi @bethskurrie, sorry for the late reply haven?t been using Slack for long time. If I remember correctly then we got to a point where we could integrate XML matching with the core project?

uldis.sturms
2019-07-31 11:12
Not using Soap anymore, since I moved on to a different project but would be kind of cool to see it through. Happy to do fix ups, cleanups extra features. Just give me a shout here or via email if I don?t reply in a day or so. :wink:

yousafn
2022-04-29 14:38
has joined #pact-ruby-xml

heytaco
2022-05-09 18:01
has joined #pact-ruby-xml

orbit
2022-05-09 18:01
has joined #pact-ruby-xml

slacksync
2022-06-08 17:21
has joined #pact-ruby-xml

duynguyenptithcm
2022-08-20 07:25
has joined #pact-ruby-xml

orbit
2022-12-01 15:45
has joined #pact-ruby-xml