Open adam-pike-dunelm opened 6 years ago
FYI: I can pull down the pact file via a Postman GET
Can I just check: your examples above reference http and https, is that just an oversight as you wrote up the issue?
Correct - I have the whole lot as https. I copied the first snippet from from the pact documentation, will edit.
Actually, I've just realised - where I have successfully download via Postman, I had read access username and password basic auth. Are there any options for this on the scala-pact CLI?
OK I gave that a go and I get the same result. I copied the url from the console output and compared it with what I have in postman and they're exactly the same.
Just for thoroughness I tried switching to our guest wifi and I now get a different error:
Error: Client request timeout after 2 seconds.
So I suspect the first fail was something to do with the corp network - although it allowed postman requests weirdly.
Is there a way I can extend the default timeout of 2 seconds?
Yes, sounds like we might be making some progress. You're literally the second person to report this problem and the first guy also submitted the PR with the test case I pointed you to. :-)
Try this:
sbt "pact-verify --host
There is, unfortunately, this issue which I discovered yesterday: https://github.com/ITV/scala-pact/issues/99
That issuse shouldn't be the problem however, just a symptom of something else, 2 seconds to Scala-Pact might as well be two minutes. Assuming you're contract file isn't gigantic and you're network isn't really really poor, then a client timeout usually means that the details to your pact broker or to your running service are incorrect.
Something to try!
Use Postman or Curl to download the Pact file, and then do this to run the verification from a local source:
sbt "pact-verify --host
If that works, then it's definitely something to do with your ability to connect to pact broker, if it doesn't work then the problem (or one of the problems) is that you're not setup to hit your service properly.
Let me know how you get on!
Thanks Dave,
Using the --clientTimeout
does prevent my timeouts so I just have rubbish internets here. But I'm back to the original error being shown constantly. I can run against the downloaded file as a local source no problem and I really can't see what is wrong with my pact setup for downloading - the documented setup is really simple and I've double checked everything is right.
I'm not going to burn more time on it for now as there's a simple solution - I download from Pact Broker to a local directory with another client as a pre-step to running pact.
Hmmm.. I'll also take an action to look into this more carefully. I was satisfied that the committer had done the right thing the first time around (given that he'd fixed his own problem!) but I'll give it some more attention when I get a few minutes and see if I can replicate it at least.
Glad to hear you have a work around for now though.
Description:
I want to verify my provider against a pact on a remotely hosted Pact Broker (the Beta version provided by Pact). But I get a
Failed to load consumer pact from: <url>
message.There's nothing to help me understand why either in the consol or the logs. The Verification works fine against a local pact file.
Steps:
Added the following to my build.sbt
Have checked that all of my values are correct on the above and even tried adding it to a pact.sbt but got the same result.
Ran the following:
sbt "pact-verify --host localhost --port <port-number-of-running-service>"
Expectation:
If all is well a test result. If all is not well, a useful error message that points to why it failed
Actual:
Sorry if I have missed anything obvious, but I didn't really know where to start with debugging this.