0

I'm having problems outputting a report from newman. Here's the gitlab-ci.yml code i'm using :

Postman_Tests_Dev: 
  stage: test_dev
  image:
    name: postman/newman:5.2.3-alpine
    entrypoint: ["/bin/sh", "-c"] 
  script:
    - newman --version
    - npm install -g install-peerdeps
    - npm i -g newman-reporter-htmlextra
    #- install-peerdeps newman-reporter-html
    - newman run ./devAPIs.json --reporters cli, html --reporter-html-export devtestresults.html
  artifacts:
    paths: 
      - devtestresults.html
  tags:
    - dockerA

The error I'm seeing is "newman: could not find "" reporter". Please see the output below:

Skipping Git submodules setup
Executing "step_script" stage of the job script
01:24
$ newman --version
5.2.3
$ npm install -g install-peerdeps
npm WARN deprecated @babel/polyfill@7.12.1:  This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
/usr/local/bin/install-peerdeps -> /usr/local/lib/node_modules/install-peerdeps/lib/cli.js
> core-js@2.6.12 postinstall /usr/local/lib/node_modules/install-peerdeps/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
+ install-peerdeps@3.0.3
added 26 packages from 10 contributors in 4.567s
$ npm install reporter
npm WARN saveError ENOENT: no such file or directory, open '/builds/jj/pipelinetests/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/builds/jj/pipelinetests/package.json'
npm WARN pipelinetests No description
npm WARN pipelinetests No repository field.
npm WARN pipelinetests No README data
npm WARN pipelinetests No license field.
+ reporter@0.1.0
added 2 packages from 2 contributors and audited 2 packages in 2.171s
found 0 vulnerabilities
$ install-peerdeps newman-reporter-html
install-peerdeps v3.0.3
Installing peerdeps for newman-reporter-html@latest.
npm install newman-reporter-html@1.0.5 newman@4 --save
SUCCESS newman-reporter-html
  and its peerDeps were installed successfully.
$ newman run ./devAPIs.json --reporters cli, html --reporter-html-export devtestresults.html
newman: could not find "" reporter
  ensure that the reporter is installed in the same directory as newman
  please install reporter using npm
newman
devAPIs.json
→ healthCheck
  GET https://XXX.azurewebsites.net/api/health/status?code=asdfadsf== [200 OK, 261B, 745ms]
→ notification
  POST https://XXX.azurewebsites.net/api/od/notifications?code=4fff== [200 OK, 254B, 126ms]
┌─────────────────────────┬─────────────────────┬────────────────────┐
│                         │            executed │             failed │
├─────────────────────────┼─────────────────────┼────────────────────┤
│              iterations │                   1 │                  0 │
├─────────────────────────┼─────────────────────┼────────────────────┤
│                requests │                   2 │                  0 │
├─────────────────────────┼─────────────────────┼────────────────────┤
│            test-scripts │                   0 │                  0 │
├─────────────────────────┼─────────────────────┼────────────────────┤
│      prerequest-scripts │                   0 │                  0 │
├─────────────────────────┼─────────────────────┼────────────────────┤
│              assertions │                   0 │                  0 │
├─────────────────────────┴─────────────────────┴────────────────────┤
│ total run duration: 914ms                                          │
├────────────────────────────────────────────────────────────────────┤
│ total data received: 35B (approx)                                  │
├────────────────────────────────────────────────────────────────────┤
│ average response time: 435ms [min: 126ms, max: 745ms, s.d.: 309ms] │
└────────────────────────────────────────────────────────────────────┘
Uploading artifacts for successful job
00:11
Uploading artifacts...
WARNING: devtestresults.html: no matching files    
ERROR: No files to upload                          
Cleaning up file based variables
00:10
Job succeeded

Edit 1

I uncommented the line to

  • install-peerdeps newman-reporter-html

And I also removed the space between "cli" and "html" but now this is the error:

$ newman run ./devAPIs.json --reporters cli,html --reporter-html-export devtestresults.html
newman: could not find "html" reporter
  ensure that the reporter is installed in the same directory as newman
  run `npm install newman-reporter-html`
dot
  • 14,928
  • 41
  • 110
  • 218
  • You would need to close the space between the reporters `cli,html` – Danny Dainton Jun 10 '21 at 19:13
  • @DannyDainton that didn't work. But it did change the error. Please see my edit 1 – dot Jun 10 '21 at 20:10
  • I just use `[" "]` as the entry point on that image, not sure why that works better for me. Newman and any of the reporters need to live at the same level but I'm not sure where that's getting installed. Can you do a `which` on that to log the location? – Danny Dainton Jun 10 '21 at 20:20

0 Answers0