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

Pact provider reports when there are multiple consumers tested #1128

Closed
anddreiu opened this issue Jun 16, 2020 · 19 comments
Closed

Pact provider reports when there are multiple consumers tested #1128

anddreiu opened this issue Jun 16, 2020 · 19 comments

Comments

@anddreiu
Copy link

I have multiple consumers (7, at the moment) for the same provider and I am running all the provider tests in a test suite using Junit 4.

The generated Pact provider report (the markdown report) contains currently 130 interactions and it's a little bit hard to search in it if there are failed tests.

It would be a great enhancement if the report could be improved a bit, maybe to have like a summary of all the interactions run based on the consumer names or to group the interactions based on the consumer and then to have all the run interactions.

Thanks!

@anto-ac
Copy link
Collaborator

anto-ac commented Jun 16, 2020

@anddreiu Which version of pact-jvm are you using? This side of things has been recently improved.

@anddreiu
Copy link
Author

anddreiu commented Jun 16, 2020

@anto-ac I am using pact provider junit 4.1.1. I know it has been improved recently. What I am suggesting here is to enhance more the reports which might help when there are a lot of interactions. As I said in the description, to have like a summary, a table, and then to have the interactions grouped based on the consumer name. Because what we have now is a big list of interactions that were run and we have to check for each one if it's OK or Failed.

@uglyog
Copy link
Member

uglyog commented Jun 17, 2020

A summary would be a really useful feature.

@anddreiu
Copy link
Author

Hi guys. Are there any updates related to this? It would be really nice and useful to have a summary in the report.
Thanks!

uglyog pushed a commit that referenced this issue Oct 4, 2020
uglyog pushed a commit that referenced this issue Oct 4, 2020
uglyog pushed a commit that referenced this issue Oct 17, 2020
@uglyog
Copy link
Member

uglyog commented Oct 18, 2020

4.1.9 released with the summary added

@anddreiu
Copy link
Author

anddreiu commented Oct 19, 2020

Hey @uglyog . Just tried the new version and the summary. It looks like just the first consumer is added in the summary table. Then there are a lot of blank lines and afterwards we have the normal report information added. Please check below the output from an .md report file generated after running the Pact provider tests using Junit runner.

In my case I have different test classes for each consumer and then I am running all of them using a test suite. But I've tried also having the tests for all the consumers in a single test class, but the report looks the same.

# providerName
|  Description   |                      Value                      |
|----------------|-------------------------------------------------|
| Date Generated | 2020-10-19T10:06:17.957+03:00[Europe/Bucharest] |
| Pact Version   | 4.1.9                                           |
## Summary
|       Consumer        | Result |
|-----------------------|--------|
| consumerName1         | OK     |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
|                       |        |
## Verifying a pact between _consumerName1_ and _providerName_

@uglyog
Copy link
Member

uglyog commented Oct 23, 2020

How many consumers do you have?

@anddreiu
Copy link
Author

I have 8 consumers for the same provider.

@uglyog
Copy link
Member

uglyog commented Nov 6, 2020

@anddreiu version 4.1.10 has been released with the fix

@anddreiu
Copy link
Author

anddreiu commented Nov 6, 2020

Thanks @uglyog. I've just upgraded the version in my project and tested this. Now the summary looks good, but the results are not quite alright. I always get OK result even if there are failed interactions for few of the consumers.

@anddreiu
Copy link
Author

anddreiu commented Nov 10, 2020

I can see that the summary contains correct result when a provider state is failed: State change call failed. But it has to show also failed message when the actual interaction failed (when the status code is not alright or when matching body or rules are failed)

@uglyog
Copy link
Member

uglyog commented Nov 15, 2020

If the provider state change has failed, it will not attempt to verify the interaction so there will be no message to display for that.

@anddreiu
Copy link
Author

That case is alright. The problem appears when there isn’t a provider state and the interaction fails, this is not reported ok in the summary.

@uglyog
Copy link
Member

uglyog commented Jan 10, 2021

If the interaction fails, why would you want it to report it as ok in the summary?

@anddreiu
Copy link
Author

I was misunderstood. I wanted to say that if the interaction fails it is not reported correctly in the summary (it should be failed, but it's reported to be ok). Not sure how to reproduce this, because for some of the consumers it's reported fine, but for others not.

I am using now 4.1.13 version.

@uglyog
Copy link
Member

uglyog commented Jan 19, 2021

It might be a concurrency issue. I'll try adding a file lock on the report file to see if that fixes the issue.

@uglyog
Copy link
Member

uglyog commented Jul 21, 2021

4.2.8 is released

@uglyog
Copy link
Member

uglyog commented Aug 1, 2021

Released 4.1.24 and 4.2.9

@YOU54F
Copy link
Member

YOU54F commented Jun 26, 2024

Closing as complete, if anyone is encountering similar issues, please raise a new one and you can always reference this one.

Thanks

@YOU54F YOU54F closed this as completed Jun 26, 2024
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

No branches or pull requests

5 participants