reportportal / agent-js-postman

Agent to integrate Postman (based on Newman collection runner) with ReportPortal.
https://www.npmjs.com/package/@reportportal/newman-reporter-agent-js-postman
Apache License 2.0
17 stars 8 forks source link

Unable to connect with remote Report Portal instance, but localhost is provided in error output #42

Closed AdamHepner closed 3 years ago

AdamHepner commented 3 years ago

Newman version: 5.2.2 agent-js-postman version: 5.0.0

I launch newman in such manner:

newman  run <snip>.json -e <snip>.json  --bail \
    -r @reportportal/agent-js-postman \
    --reporter-@reportportal/agent-js-postman-endpoint=https://reportportal.<snip>.io/api/v1 \
    --reporter-@reportportal/agent-js-postman-token=<snip> \
    --reporter-@reportportal/agent-js-postman-launch=<snip> \
    --reporter-@reportportal/agent-js-postman-project=<snip> \
    -x

and receive following output:

Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: connect ECONNREFUSED 127.0.0.1:80
    at axios.then.catch (/usr/lib/node_modules/@reportportal/newman-reporter-agent-js-postman/node_modules/@reportportal/client-javascript/lib/rest.js:31:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)

This happens regardless if I provide endpoint by hostname only, or with endpoint path /api/v1. What I've managed to identify is that it seems to be an axios problem - when no host is provided, is tries to connect to 127.0.0.1:80 by default.

AmsterGet commented 3 years ago

Hi @AdamHepner ! We've already released a fix in the version 5.0.1. This issue was related to incorrect parsing of parameters when using the CLI (https://github.com/reportportal/agent-js-postman/issues/43). I'll close this issue but feel free to open it again if you have any other questions on the topic.