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

Verifier Results with empty notices #404

Closed
JP-Ellis opened this issue Mar 20, 2024 · 2 comments
Closed

Verifier Results with empty notices #404

JP-Ellis opened this issue Mar 20, 2024 · 2 comments

Comments

@JP-Ellis
Copy link
Contributor

When implementing the compatibility suite, I came across the following scenario (ref)

  Scenario: Verifying an interaction where a provider state callback is not configured
    Given a provider is started that returns the response from interaction 1
    And a Pact file for interaction 1 is to be verified with a provider state "state one" defined
    When the verification is run
    Then the verification will be successful
    And a warning will be displayed that there was no provider state callback configured for provider state "state one"

It requires checking that a warning is displayed, which to my knowledge, is difficult to do through the FFI. When logging is enabled, the FFI does emit the correct warning:

WARN ThreadId(01) verify_interaction{interaction="interaction 1"}: pact_verifier::callback_executors: State Change ignored as there is no state change URL provided for interaction 

However inspecting the logs requires logging to a buffer, and would fail if logging to stderr is configured for example.

Inspecting the verifier results, there is a notices key, though it appears to be empty:

{
  "errors": [],
  "notices": [],
  "output": [
    "\nVerifying a pact between \u001b[1mconsumer\u001b[0m and \u001b[1mprovider\u001b[0m",
    "",
    "  interaction 1 (0s loading, 159ms verification)",
    "     Given state one",
    "    returns a response which",
    "      has status code \u001b[1m200\u001b[0m (\u001b[32mOK\u001b[0m)",
    "      includes headers",
    "        \"\u001b[1mContent-Type\u001b[0m\" with value \"\u001b[1mapplication/json\u001b[0m\" (\u001b[32mOK\u001b[0m)",
    "      has a matching body (\u001b[32mOK\u001b[0m)",
    "",
    ""
  ],
  "pendingErrors": [],
  "result": true
}

and I am left wondering whether this is an error with the FFI or not.

@rholshausen
Copy link
Contributor

notices contains any notices returned from the Pact Broker.

Just make the step a no-op as the underlying Rust code will emit the warning.

@JP-Ellis
Copy link
Contributor Author

Cool, I'll make this a no-op.

JP-Ellis added a commit to pact-foundation/pact-python that referenced this issue Mar 20, 2024
Following recommendations from Ron, making the check a no-op.

Ref: pact-foundation/pact-reference#404
Signed-off-by: JP-Ellis <[email protected]>
JP-Ellis added a commit to pact-foundation/pact-python that referenced this issue Mar 22, 2024
Following recommendations from Ron, making the check a no-op.

Ref: pact-foundation/pact-reference#404
Signed-off-by: JP-Ellis <[email protected]>
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

2 participants