Pact Download Location config is not working
See original GitHub issueThank 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:
- Created 5 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top GitHub Comments
Alright, version 6.19.4 is going out now with the fix and accompanying tests to prevent regression 😃
Really appreciate! Looking forward to it 😉