Aniket Rane
08/07/2023, 3:27 AM[03:20:05.795] INFO (62): pact-core@13.13.8: Publishing Pacts to Broker
[03:20:05.799] INFO (62): pact-core@13.13.8: Publishing pacts to broker at: <http://localhost:9292/>
[03:20:26.475] WARN (62): pact-core@13.13.8: Pact exited with code 1.
[03:20:26.476] ERROR (62): pact-core@13.13.8: Pact publication failed with non-zero exit code. Full output was:
`ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to localhost:9292 (Connection refused - connect(2) for "localhost" port 9292) /opt/atlassian/pipelines/agent/build/node_modules/@pact-foundation/pact-core/standalone/linux-x64-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in block in perform_request', attempt 1 of 5
I have tried a few suggestions from other's post (stackoverflow/ Atlassian Support) but have to yet find a solution that works for me.
Do you have any suggestions for me try?Matt (pactflow.io / pact-js / pact-go)
localhost but if it’s running on your machine, the CI won’t be able to reach that
it should be deployed somewhere centrally that your dev environment, CI and other team members can access.Aniket Rane
08/07/2023, 2:21 PM# Template NodeJS build
# This template allows you to validate your NodeJS code.
# The workflow allows running tests and code linting on the default branch.
image: node:16
options:
docker: true
definitions:
caches:
docker-cliplugins: ~/.docker/cli-plugins
yaml-anchors:
- &setup-docker-compose-latest-script >-
wget --no-verbose --no-clobber <https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64> --output-document ~/.docker/cli-plugins/docker-compose
|| true
; chmod a+x ~/.docker/cli-plugins/docker-compose
&& ln --symbolic ~/.docker/cli-plugins/docker-compose /usr/local/bin/docker-compose
pipelines:
default:
- step:
name: Install dependencies
caches:
- node
script:
- npm install
- step:
name: Start Docker container
services: [docker]
caches: [docker-cliplugins]
script:
- *setup-docker-compose-latest-script
- docker compose version
- docker-compose -f docker-compose.yml up -d
- step:
name: Run Contract Tests
caches:
- node
- docker
script:
- npm run test:consumer
- npm run test:provider
- step:
name: Stop Docker container
services: [docker]
caches: [docker-cliplugins]
script:
- docker-compose downAniket Rane
08/07/2023, 2:29 PMMatt (pactflow.io / pact-js / pact-go)
PACT_BROKER_BASE_URL should point exactly to the base URL of your broker. It’s not a comma separated listMatt (pactflow.io / pact-js / pact-go)
<https://host.docker.internal> is a special DNS only available within docker containers, not from outside