Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working examples running from package.json #65

Open
contd opened this issue Aug 9, 2021 · 2 comments
Open

Working examples running from package.json #65

contd opened this issue Aug 9, 2021 · 2 comments

Comments

@contd
Copy link

contd commented Aug 9, 2021

I've had success using the postman/newman package running tests from package.json or as a command line reporter. I'm having trouble doing the same with the mocha (agent-js-mocha) one. Here is what I am trying:

mocha --inspect=8888 -r ts-node/register --reporter=@reportportal/agent-js-mocha --reporter-option agent-js-mocha-endpoint=https://reportportal.xxxxxx.com/api/v1 --reporter-option agent-js-mocha-token=xxxxxxxxx --reporter-option agent-js-mocha-launch=Helmsdeepcc-MochaTest tests/${1:-*}.spec.ts

This is the part of the output I'm getting where it seems like it is trying to send to the ReportPortal but not getting the options to know what endpoint and so on:

@apex-org/helmsdeep-cc: Failed to finish child item. Error: connect ECONNREFUSED 127.0.0.1:80
@apex-org/helmsdeep-cc: at axios.then.catch (/home/jason/apex/citadel/packages/helmsdeep/packages/helmsdeep-cc/node_modules/@reportportal/client-javascript/lib/rest.js:36:23)
@apex-org/helmsdeep-cc: at process._tickCallback (internal/process/next_tick.js:68:7)
@apex-org/helmsdeep-cc: Failed to finish suite. Error: connect ECONNREFUSED 127.0.0.1:80
@apex-org/helmsdeep-cc: at axios.then.catch (/home/jason/apex/citadel/packages/helmsdeep/packages/helmsdeep-cc/node_modules/@reportportal/client-javascript/lib/rest.js:36:23)
@apex-org/helmsdeep-cc: at process._tickCallback (internal/process/next_tick.js:68:7)
@apex-org/helmsdeep-cc: Failed to finish run. Error: connect ECONNREFUSED 127.0.0.1:80
@apex-org/helmsdeep-cc: at axios.then.catch (/home/jason/apex/citadel/packages/helmsdeep/packages/helmsdeep-cc/node_modules/@reportportal/client-javascript/lib/rest.js:36:23)
@apex-org/helmsdeep-cc: at process._tickCallback (internal/process/next_tick.js:68:7)

Is there some example of using this agent from the command line that shows how to properly set the options?

@contd
Copy link
Author

contd commented Aug 9, 2021

I think I was able to figure this out utilizing the .mocharc.yaml approach but I still need to specify multiple reporters. Is this possible with this approach or how can I accomplish this? I tried this which of course fails because of duplicate keys:

`inspect: 8888
require:

  • 'ts-node/register'
  • 'tsconfig-paths/register'
  • 'source-map-support/register'
    timeout: 60000
    reporter: 'xunit'
    reporter-options:
  • 'output=hd-junit.xml'
    reporter: '@reportportal/agent-js-mocha'
    reporter-options:
  • 'endpoint=https://reportportal.xxx.com/api/v1'
  • 'token=xxxxxxxxxx'
  • 'launch=Helmsdeepcc-MochaTest'
  • 'project=default_personal'
  • 'description=Helmsdeepcc-MochaTest'
    exit: true`

@nixpix
Copy link

nixpix commented Oct 11, 2022

I had the same issues and errors because our Report Portal was set up to use HTTPS.
I belive the package doesn't handle HTTPS requests correctly.

We tried different things, and the only solution was to switch to HTTP internal hosting, which resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants