Hello Im looking for the use the specific pact ver...
# pact-net
a
Hello Im looking for the use the specific pact version to verify my contract... In PACT URL for example, I have it: https://pactbroker/pacts/provider/my-provider/consumer/my-consumer/version/01001 However, in the consumer selectors I dont see any selector related to version... Can anyone help me to get the specific version directly in code?
y
It doesn't look possible via consumer version selectors https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors#properties Here are the ruby and rust core selectors pulled out https://github.com/pact-foundation/docs.pact.io/issues/171
if it doesn't have a tag, and a branch, and isn't the latest, why does it need to be verified by the consumer version selectors
enabling WIP pacts should pick up the verification if it hasn't run before, on a provider change ci run or via pact url on a consumer contract requiring verification event being published, and picked up by a provider verification build
m
It doesn’t look possible via consumer version selectors
selectors are all about dynamically discovering the pacts to verify. You don’t need to discover them, because you have the URL.
In Pact NET, there should be an option to simply specific the URL, file or folder as a source
1
j
@Yousaf Nabi (pactflow.io) I am trying to verify pact but
consumer_version_selectors
does not seem to work. Below is the code snippet I used to select only the consumer I want to verify
Copy code
success, logs = verifier.verify_with_broker(
        **broker_opts,
        verbose=True,
        provider_states_setup_url="<http://127.0.0.1:8000/_pact/provider_states>",
        enable_pending=False,
        headers=headers,
        consumer_version_selectors=[
            {"consumer": "cmedia-adf-management-api"},
        ],
        log_dir="/tmp",
    )
y
How doesn't it work?
I can't see anywhere in the docs that suggest you can only provide the consumer name
These show consumer used in conjuction with other options https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors#advanced
• `consumer`: allows a selector to only be applied to a certain consumer. Can be specified with any of the above properties.
so it a filter based on the other CVS's you provide