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

consumerVersionSelectors errors are not propagating to the user #351

Closed
orekav opened this issue Dec 20, 2023 · 1 comment
Closed

consumerVersionSelectors errors are not propagating to the user #351

orekav opened this issue Dec 20, 2023 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@orekav
Copy link

orekav commented Dec 20, 2023

When: failIfNoPactsFound: false
Expected behaviour: no error
Actual result:

Failures:

1) Failed to load pact - No pacts found matching the given consumer version selectors in pact broker '

// {"name":"Error","message":"Verfication failed","stack":"Error: Verfication failed\n    at /....

When wrongly using consumerVersionSelectors together the error I see this.

By using branch & latest together with deployedOrReleased, the only way to see the error is from the Rust logs

const opts: VerifierOptions = {
        logLevel: "info",
        pactBrokerUrl: PACT_BROKER_BASE_URL,
        pactBrokerToken: PACT_BROKER_TOKEN,
        publishVerificationResult: isStageTest(STAGE),
        provider: pkg.config.pactParticipantName,
        providerVersion: pkg.version,
        providerBranch: BRANCH_NAME,
        consumerVersionSelectors: [
            {
                branch: "mainx",
                latest: true,
                deployedOrReleased: true,
            },
        ],
        failIfNoPactsFound: false,
        providerBaseUrl: apiUrl,
        changeOrigin: true,
        requestFilter,
2023-12-20T12:17:32.559427Z  INFO ThreadId(11) pact_verifier::pact_broker: error response for pacts for verification: failed validation - ["consumerVersionSelectors: cannot specify the fields branch/latest with the field deployedOrReleased (at index 0)"] 
2023-12-20T12:17:32.561122Z ERROR ThreadId(11) pact_verifier: No pacts found matching the given consumer version selectors in pact broker 'https://skyai.pactflow.io/': failed validation - ["consumerVersionSelectors: cannot specify the fields branch/latest with the field deployedOrReleased (at index 0)"]
2023-12-20T12:17:32.562776Z ERROR ThreadId(11) pact_verifier: Failed to load pact - No pacts found matching the given consumer version selectors in pact broker '<REDACTED>'
2023-12-20T12:17:32.563719Z  WARN ThreadId(11) pact_matching::metrics: 

By using branch together with deployedOrReleased,

2023-12-20T12:19:00.414088Z  INFO ThreadId(11) pact_verifier::pact_broker: error response for pacts for verification: failed validation - ["consumerVersionSelectors: cannot specify the field branch with the field deployedOrReleased (at index 0)"] 
2023-12-20T12:19:00.414601Z ERROR ThreadId(11) pact_verifier: No pacts found matching the given consumer version selectors in pact broker '<REDACTED>': failed validation - ["consumerVersionSelectors: cannot specify the field branch with the field deployedOrReleased (at index 0)"]
@rholshausen rholshausen added the bug Indicates an unexpected problem or unintended behavior label Dec 20, 2023
@mefellows
Copy link
Member

Thanks for posting this, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants