Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portman/newman not returning nonzero exit code when using "abortOnFailure"=false #504

Open
chyde80 opened this issue Jul 31, 2023 · 5 comments

Comments

@chyde80
Copy link

chyde80 commented Jul 31, 2023

I am running in a Jenkins pipeline and am seeing "collection run completed" when the run actually has failed tests. Why is the exit code not coming back correctly w/ an error? I have "abortOnFailure" set to false so that I can run the entire collection w/ tests before failing the pipeline stage. I can see in the console that newman/portman is reporting "Collection run completed" instead of what I would expect from Newman's docs which should throw "collection run encountered an error", which I expect would throw a non-zero exit code.

@chyde80
Copy link
Author

chyde80 commented Aug 2, 2023

@thim81 @nicklloyd ?

@chyde80
Copy link
Author

chyde80 commented Sep 11, 2023

I had to write a custom workaround for this - I published results as junit, published them in jenkins using the junit plugin, and then parsed the # of failed tests. If >0, I set the build to failed. It would be cleaner if portman could correctly pass back a nonzero exit code when there are failed tests even when the run completes. Any updates on this?

@thim81
Copy link
Collaborator

thim81 commented Oct 28, 2023

@chyde80 Can you try this PR, that should provide a better exit code?
#530

@thim81
Copy link
Collaborator

thim81 commented Jan 5, 2024

@chyde80 did you had the chance to test the PR?

@chyde80
Copy link
Author

chyde80 commented Jan 30, 2024

I don't have a convenient way of testing until it's merged into the product - please do so if you're comfortable and I'll let you know. Or, publish it to an alternate version on NPM and I'll test on that version instead of latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants