question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pact Download Location config is not working

See original GitHub issue

Thank you for providing Pact as so wonderful a contract testing tool. But we got some problems when working with it.

Our team was spiking pact and decided to use pact as our contract test tool. As we need to deploy our project to an internal machine, it can’t access github releases to get the binaries needed by pact-node when running npm install. I was very happy when I saw there was a configuration to solve this problem.

But when I set the config following the introduction from https://github.com/pact-foundation/pact-node/blob/master/README.md#pact-download-location, it still downloaded the binaries from github.

This made me very confused, so I digged into the code here https://github.com/pact-foundation/pact-node/blob/master/standalone/install.ts, and found that findPackageConfig() changed PACT_BINARY_LOCATION after const BINARIES had already set!

I also run node postinstall.js locally and printed console log, then got the following result:

findPackageConfig: tries: undefined
PACT_BINARY_LOCATION: https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.47.2/
-----------------
findPackageConfig: tries: 9
PACT_BINARY_LOCATION: https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.47.2/
-----------------
findPackageConfig: tries: 8
PACT_BINARY_LOCATION: https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.47.2/
----------setup-----------
---------download---------
Installing Pact Standalone Binary for darwin.
Downloading Pact Standalone Binary v1.47.2 for platform darwin from https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.47.2/pact-1.47.2-osx.tar.gz
Please note: we are tracking this download anonymously to gather important usage statistics. To disable tracking, set 'pact_do_not_track: true' in your package.json 'config' section.
Downloaded 0.21%...
Downloaded 0.89%...
Downloaded 2.95%...

It showed that it started to download the binaries just while the findPackageConfig working hadn’t finished. So the config for pact_binary_location doesn’t work at all!

versions: “@pact-foundation/pact” : “5.9.1”, “@pact-foundation/pact-node”: “6.19.2”

Hope get your feedback soon.

Thank you!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mboudreaucommented, Jul 9, 2018

Alright, version 6.19.4 is going out now with the fix and accompanying tests to prevent regression 😃

0reactions
niuwanlucommented, Jul 9, 2018

Really appreciate! Looking forward to it 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Pact Docs
Troubleshooting. If you are having issues, a good place to start is setting logLevel: 'debug' when configuring the new Pact({...}) object.
Read more >
pact-foundation/pact-node
Start using @pact-foundation/pact-node in your project by running ... Do Not Track; Pact Download Location; Skip Pact binary downloading.
Read more >
Profile Installation Failed
'Profile Installation Failed' · For iOS 11 and older please go to device Settings > OurPact Jr. > Location > Always. · For...
Read more >
python - Pact simple example ad setup issues
what i did was: downloaded the project; followed the description and did the install & execution. Im getting the folling error invoke ...
Read more >
Consumer Driven Contracts with Pact
For this configuration to work, we have to place the test_consumer-test_provider.json file in the pacts folder of our REST service project. Next ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found