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 Request: Allow consumers to set individual interactions to "Pending" or "WIP" (not via branches/versions) #392

Open
JakeTheCorn opened this issue Sep 20, 2023 · 6 comments

Comments

@JakeTheCorn
Copy link

Hi, big fan.

The product seems to assume (and even calls it "Best practice") to use feature branches. While I disagree on the "best practice" aspect, that is not particularly why I am here...

I need a way to allow our teams to not have to march in lock step while still specifying future interactions.

IE, a consumer should be able to specify an interaction they Will need, not only what they need now.

I'll call these "future interactions"

They should also be able to run 'can-i-deploy' without those "future interactions" preventing their release... while can-i-deploy still preventing release when non "future interactions" have no matching verification.

This would serve as communication to provider teams, as well as allowing consumer teams to keep moving while publishing next pacts to providers.

We don't have the need or desire to manage versioning at the moment, so we generally don't.

What I'm requesting is similar to...

(
    pact
                .pending_verification() # <---- this is the request
                .upon_receiving("a fake pending contract endpoint")
                .with_request("get", "/at-some-url")
                .will_respond_with(
                    200, body=Like({"timestamp_1": Format().iso_datetime}), headers={"Content-Type": "application/json"}
                )
)

Which, when the provider pulls and verifies, they will receive a json field similar to

{
   "isPending": true
}

Which would allow for warnings to be printed.

I've used and set up the enable_pending on the provider, but feel I'm still not getting what I would desire as a way to Tdd the service layer.

Any ideas?

Thanks much!

@elliottmurray
Copy link
Contributor

Can't you just use the pytest xfail or similar feature? Adding to the pact spec is quite an onerous step

@elliottmurray
Copy link
Contributor

@JakeTheCorn
Copy link
Author

Thanks for the reply.

Good question... I have read that link through prior to opening this issue.

I'm not really wanting to skip the running of these tests as they're still valuable in the sense that they produce documentation for needed functionality.

IE, I want them to run, just that they can publish a pending sort of data point for the tools to integrate on.

@JakeTheCorn
Copy link
Author

is there somewhere else I should be asking this to?

@mefellows
Copy link
Member

I think what you're asking for is pact-foundation/pact-specification#73? If so, it needs to be added to the V4 interface being built (in the FFI integration work).

This currently is not supported in the V2 library.

@JakeTheCorn
Copy link
Author

Thanks much @mefellows

Let me check that link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issue
Development

No branches or pull requests

3 participants