I would like to run my Postman tests in CI/CD with the ability to skip certain requests located in same collection/driectory. However Postman CLI treats requests with pm.execution.skipRequest(); as failed. Everything works fine when using manual run.
Is there any remedy to that?
Hey @adam-cimoch-d8f487b0
What’s the outcome what you run this with the Collection Runner?
Do you need more info? Is it a feature? :0
Can you provide some more context about where you have placed this and the logic around it?
With that failed request in the CLI, what was the given reason? Are there any error messages?
Sure @danny-dainton
I’m running into a peculiar issue with Postman CLI and how it handles skipped requests when I specify a collection by name.
My Setup:
-
I have a Postman collection called “API”.
-
Within this collection, I have 3 folders, each containing a few requests.
-
I run a single folder at a time.
-
I provide iteration data (both via CLI and UI) which I use to determine which requests to skip dynamically via scripts.
What Works (No Issues):
-
Running a folder via the Postman UI.
-
Running a folder via the Postman CLI using folder UUIDs. In both these cases, skipped requests are handled correctly and do not cause any errors.
postman collection run uuid-iuuid—iteration-datapath
The Problem:
- When I run a folder via the Postman CLI using the collection name, any requests that are skipped (based on my iteration data logic) are unexpectedly treated as failed requests, even though they were never executed.
postman collection run pathToCollection-isubFolderName—iteration-datapath
Error Message: For these skipped-but-failed requests, I receive the following error: Request could not be completed at request inside "API People/GetAllPeople"
This behavior only occurs when using the folder name located inside a collection via the CLI, not with UUIDs or the UI.
Terminal result for UUID:
Terminal result for named -i paramter