newman: How to Stop NEWMAN when any assertion fails
- Newman Version (can be found via
newman -v
):
- OS details (type, version, and architecture):
- Are you using Newman as a library, or via the CLI?
- Did you encounter this recently, or has this bug always been there:
- Expected behaviour:
- Command / script used to run Newman:
- Sample collection, and auxilliary files (minus the sensitive details):
- Screenshots (if applicable):
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (6 by maintainers)
IMO there needs to be a
newman verify
command that can look at a summary report and exit with an error if there test run failures. We havenewman run
happening and we do not fail if there were test failures (need to do other things like dump a coverage report and stop the server) - so we need a way to programatically fail a pipeline after the test run exits. I suppose we could use the exit code of the run command. But that is hard to do in Maven if you want to bind to the verify goal. Anyway just a thought.Hi, I am trying to execute a Jenkins pipeline in which one stage is dedicated for newman run(using collection). I want to know if I can abort the build if my newman assertions are failed.
@Sripathi1983 You can use the
--bail
option to stop collection runs on the first failure, like so: