pact-foundation / pact-provider-verifier

Cross-platform, generic language, Pact provider verification tool
http://pact.io
MIT License
32 stars 24 forks source link

feat: Use load for monkeypatch instead of require #69

Closed konalegi closed 2 years ago

konalegi commented 3 years ago

I've noticed that, during provider verification, if I have more than one pact file to verify, monkey changes are applied just for the first verification. I'm adding extra config params to Pact.configure and Rspec.configure, which are being cleared up on each pact file verification.

Even if theoretically it could be breaking change, @bethesque suggested to changes require to load without any switch. Original PR https://github.com/pact-foundation/pact-provider-verifier/pull/68

bethesque commented 3 years ago

Btw, what extra params are you adding? Is it something we just might want to support properly?

konalegi commented 3 years ago

@bethesque it's complicated, in general We are adapting pact tools (pact-provider-verifier, pact, pact-broker-client) to support apollo graphql gateway in our infrastructure. but for this specifically, we call intermediate service after pact file has been verified.

::RSpec.configure do |config|
  config.before(:all) do
    client.call('/pact_file_about_to_verify', { pact_url: pact_uri.uri })
  end

  config.after(:all) do
    client.call('/pact_file_verification_complete', { pact_url: pact_uri.uri })
  end
end

I'm sure we are going to share our experience once we complete our work.

YOU54F commented 2 years ago

Hey @konalegi ,

Just going through old PR's, how did you get on?

bethesque commented 2 years ago

I'm going to close this, but we can reopen if necessary.