newman icon indicating copy to clipboard operation
newman copied to clipboard

Feature:Option --exclude-folder added to the options.

Open adityaofficial10 opened this issue 4 years ago • 8 comments

Fixes #2465 What this PR does? This PR adds an option --exclude-folder to the list of options. This is in response to the feature request #2465

What changes have been made?

  • There are changes to the main newman file and the run/options.js file in particular, with --exclude-folder option added.
  • Tests have been added to test the option, i.e CLI tests, Unit tests, Integration tests and Library Tests.

What is the added option --exclude-folder all about?

  • The option --exclude-folder can take in one or more than one folders and it excludes them from items to be executed.
  • This option rules supreme in case same folder has been passed using both --folder and --exclude-folder options.

adityaofficial10 avatar Feb 13 '21 20:02 adityaofficial10

Codecov Report

Merging #2620 (6d3ec81) into develop (994a0e6) will increase coverage by 0.15%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2620      +/-   ##
===========================================
+ Coverage    90.85%   91.01%   +0.15%     
===========================================
  Files           21       21              
  Lines         1105     1124      +19     
  Branches       334      342       +8     
===========================================
+ Hits          1004     1023      +19     
  Misses         101      101              
Flag Coverage Δ
cli 83.00% <100.00%> (+0.56%) :arrow_up:
integration 42.88% <78.94%> (+0.62%) :arrow_up:
library 61.12% <89.47%> (+0.57%) :arrow_up:
unit 76.86% <78.94%> (+0.03%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
bin/newman.js 90.19% <ø> (ø)
lib/run/index.js 94.16% <100.00%> (+0.56%) :arrow_up:
lib/run/options.js 95.65% <100.00%> (+0.23%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 994a0e6...6d3ec81. Read the comment docs.

codecov[bot] avatar Feb 13 '21 20:02 codecov[bot]

@codenirvana @vvs11 This was a feature request actually. So I'd like to hear from you guys on this.

adityaofficial10 avatar Feb 13 '21 20:02 adityaofficial10

@adityaofficial10 This is great but I am not sure about mutating the collection here. 🤔

Actually @codenirvana , We use entrypoint for folders option and imitating something similar would require a change to the postman-runtime. So mutating was a better option according to me.. It would be really great if you could guide me regarding the correct way.

Also, why just folders? What about excluding requests?

Also, I am working on that in my next patch. I'll follow up with that shortly..

adityaofficial10 avatar Mar 11 '21 18:03 adityaofficial10

@codenirvana @shamasis @coditva For requests, I think of passing a path to the request like folder1/folder2/request1 and then using search mechanism to exclude it. Does this look good?

adityaofficial10 avatar Mar 26 '21 08:03 adityaofficial10

@adityaofficial10 I think the best way to implement request/folder skipping would be maintaining symmetry with the --folder option, in which one can specify a folder name or a request name directly.

Having said that, I do think it'd be nice to be able to specify full paths to folders/requests rather than just the name. This has been brought up several times in the forums throughout the years (for the --folder case) and has never been addressed.

rozanecm avatar Jul 08 '21 12:07 rozanecm

Hey there, it's been 2+ years and the PR is still open, may I know any ETA for this?
Is there any alternative for this until then? I've currently written a function that fetches all the folder names excluding the name the folder that needs to be ignored and this has a lot of overhead.

pixincreate avatar Aug 07 '23 05:08 pixincreate

when can we use this option?

daniavander avatar Apr 19 '24 07:04 daniavander