question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with custom reporters in Docker

See original GitHub issue
  1. Newman Version (can be found via newman -v): 4.6.0

  2. OS details (type, version, and architecture): Linux (within a docker container, if that changes anything)

  3. Are you using Newman as a library, or via the CLI? CLI

  4. Did you encounter this recently, or has this bug always been there: Recently

  5. Expected behaviour: Running correctly

  6. Command / script used to run Newman: newman run /usr/<project_folder>/collections/SmokeTests.postman_collection.json -e /usr/<project_folder>/collections/environment.json -r <custom_reporter_name>

  7. Sample collection, and auxiliary files (minus the sensitive details): The issue is not in the collection/environment files

  8. Screenshots (if applicable): N/A


I have created a custom reporter. This reporter works fine when I run it locally on my machine having installed both newman and the reporter globally.

~ ❯ ls /usr/lib/node_modules/
newman  newman-reporter-<custom_reporter_name>  npm

However, when inside a docker container, it apparently fails. As you can see from the following logs, both newman and the reporter are installed globally as well, and appear in the same directory.

Step 14/20 : RUN npm install -g newman
/usr/bin/newman -> /usr/lib/node_modules/newman/bin/newman.js
+ newman@4.6.0
added 166 packages from 197 contributors in 12.175s

Step 15/20 : 
RUN npm install -g /usr/<project_folder>/newman-reporter-<custom_reporter_name>
+ newman-reporter-<custom_reporter_name>@0.0.1
added 167 packages from 198 contributors in 7.742s

(...)

Step 17/20 : RUN ls /usr/lib/node_modules
newman
newman-reporter-<custom_reporter_name>
npm

Step 18/20 : RUN ls /usr/lib/node_modules/newman-reporter-<custom_reporter_name>
index.js
node_modules
package.json

When I launch the container, which contains a Python script executing the newman command posted above in CLI mode, I receive the following error:

container    | newman: could not find "<custom_reporter_name>" reporter
container    |   ensure that the reporter is installed in the same directory as newman
container    |   please install reporter using npm
container    | 

Thanks in advance for your help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
BamBalaamcommented, Mar 17, 2020

@shamasis I might have found the issue, but I’m struggling to reproduce it consistently.

In some cases, if the code of the custom reporter has some type of JS error, instead of failing explicitly and raising the JS error, newman says it can’t find the reporter.

Hope this helps somehow.

1reaction
shamasiscommented, Mar 17, 2020

Nope. Very odd. Closing for now. Will look forward to know more as to why this happened. Meanwhile I will explore as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker - ERROR : The provided "html" reporter does not exist
My objective is to generate HTML report using a docker image. It appears the official testcafe docker image does not have ...
Read more >
Overview | Docker Documentation
This page contains information on: How to diagnose and troubleshoot Docker Desktop issues; Check the logs; Find workarounds for common problems ...
Read more >
Docker Developer Guide for Confluent Platform
Docker Developer Guide for Confluent Platform¶. This document assumes knowledge of Docker and Dockerfiles . To review best practices for writing Dockerfiles ...
Read more >
Custom Docker container labels are not present on service ...
This bug appears to be due to the fact that the configuration for service containers is created in a separate function from other...
Read more >
Reporters | Concepts | Guides | Docs
Reporters are plugins used to output test run reports in a certain format. ... Here are some custom reporters developed by the community....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found