Tien Vo
03/08/2023, 7:02 AMStub Server (Rust)
:
If I run this command:
PACT_BROKER_BASE_URL=abc ./vendor/pact-foundation/pact-php/bin/pact-stub-server/pact-stub-server --file tests/Contract/pacts/my-family-tree-relationship-my-family-tree-user.json
I will got this error:
2023-03-08T06:56:49.189486Z INFO main pact_verifier::pact_broker: Fetching path '/' from pact broker
2023-03-08T06:56:49.189512Z ERROR main pact_stub_server: There were errors loading the pact files.
2023-03-08T06:56:49.189515Z ERROR main pact_stub_server: - Invalid URL - relative URL without a base
Error: ExitCode(unix_exit_status(3))
I think stub server should load from the json file and ignore the env var PACT_BROKER_BASE_URL
(and should not return that error).
Is this a bug?uglyog
--broker-url
parameteruglyog
--broker-url abc
Tien Vo
03/08/2023, 10:53 AM--broker-url
option manually, so I expect stub server didn't go to pact broker to look for pacts.
• the env var PACT_BROKER_BASE_URL
was set by Github/Gitlab for the publishing pacts
feature after running consumer's contract tests. I didn't know that it will force stub server ignore --file
option and look for pacts on pact broker instead. It's unexpected to me.uglyog
Tien Vo
05/31/2023, 4:30 AMPACT_BROKER_BASE_URL
from pact-stub-server
process, and it will load pact file I specified. All good for me.